Exemple #1
0
  public void setSoundPan(long soundId, float pan, float volume) {
    if (!soundIdToSource.containsKey(soundId)) return;
    int sourceId = soundIdToSource.get(soundId);

    AL10.alSource3f(
        sourceId,
        AL10.AL_POSITION,
        MathUtils.cos((pan - 1) * MathUtils.PI / 2),
        0,
        MathUtils.sin((pan + 1) * MathUtils.PI / 2));
    AL10.alSourcef(sourceId, AL10.AL_GAIN, volume);
  }
 /**
  * @return The existing instance for the specified pointer, or a newly created instance if the
  *     instance didn't exist
  */
 public static btCollisionObject getInstance(final long swigCPtr, boolean owner) {
   if (swigCPtr == 0) return null;
   btCollisionObject result = instances.get(swigCPtr);
   if (result == null) result = new btCollisionObject(swigCPtr, owner);
   return result;
 }
 /**
  * @return The existing instance for the specified pointer, or null if the instance doesn't exist
  */
 public static btCollisionObject getInstance(final long swigCPtr) {
   return swigCPtr == 0 ? null : instances.get(swigCPtr);
 }
Exemple #4
0
 public void setSoundPitch(long soundId, float pitch) {
   if (!soundIdToSource.containsKey(soundId)) return;
   int sourceId = soundIdToSource.get(soundId);
   AL10.alSourcef(sourceId, AL10.AL_PITCH, pitch);
 }
Exemple #5
0
 public void setSoundLooping(long soundId, boolean looping) {
   if (!soundIdToSource.containsKey(soundId)) return;
   int sourceId = soundIdToSource.get(soundId);
   alSourcei(sourceId, AL10.AL_LOOPING, looping ? AL10.AL_TRUE : AL10.AL_FALSE);
 }
Exemple #6
0
 public void setSoundGain(long soundId, float volume) {
   if (!soundIdToSource.containsKey(soundId)) return;
   int sourceId = soundIdToSource.get(soundId);
   AL10.alSourcef(sourceId, AL10.AL_GAIN, volume);
 }
Exemple #7
0
 public void resumeSound(long soundId) {
   if (!soundIdToSource.containsKey(soundId)) return;
   int sourceId = soundIdToSource.get(soundId);
   if (alGetSourcei(sourceId, AL_SOURCE_STATE) == AL_PAUSED) alSourcePlay(sourceId);
 }
Exemple #8
0
 public void pauseSound(long soundId) {
   if (!soundIdToSource.containsKey(soundId)) return;
   int sourceId = soundIdToSource.get(soundId);
   alSourcePause(sourceId);
 }
Exemple #9
0
 public void stopSound(long soundId) {
   if (!soundIdToSource.containsKey(soundId)) return;
   int sourceId = soundIdToSource.get(soundId);
   alSourceStop(sourceId);
 }