cleaned up

This commit is contained in:
Brian Matzon 2004-03-25 22:44:31 +00:00
parent 177a0bfe84
commit 2d16504529
2 changed files with 22 additions and 22 deletions

View File

@ -98,6 +98,19 @@ public abstract class BasicTest {
return temp.asFloatBuffer(); return temp.asFloatBuffer();
} }
/**
* Creates a float buffer to hold specified float array
* - strictly a utility method
*
* @param array to hold
* @return created FloatBuffer
*/
protected FloatBuffer createFloatBuffer(float[] data) {
FloatBuffer temp = createFloatBuffer(data.length).put(data);
temp.flip();
return temp;
}
/** /**
* Pauses the invoking thread for specified milliseconds * Pauses the invoking thread for specified milliseconds
* *

View File

@ -58,32 +58,32 @@ public class PositionTest extends BasicTest {
private IntBuffer soundSources = createIntBuffer(3); private IntBuffer soundSources = createIntBuffer(3);
/** Position of listener */ /** Position of listener */
private FloatBuffer listenerPosition = createFloatBuffer(3).put(new float[] { 0.0f, 0.0f, 0.0f }); private FloatBuffer listenerPosition = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
/** Velocity of listener */ /** Velocity of listener */
private FloatBuffer listenerVelocity = createFloatBuffer(3).put(new float[] { 0.0f, 0.0f, 0.0f }); private FloatBuffer listenerVelocity = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
/** Orientation of listener */ /** Orientation of listener */
private FloatBuffer listenerOrientation = private FloatBuffer listenerOrientation =
createFloatBuffer(6).put(new float[] { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f }); createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f });
/** Position of left sound */ /** Position of left sound */
private FloatBuffer leftPosition = createFloatBuffer(3).put(new float[] { -2.0f, 0.0f, 0.0f }); private FloatBuffer leftPosition = createFloatBuffer(new float[] { -2.0f, 0.0f, 0.0f });
/** Velocity of left sound */ /** Velocity of left sound */
private FloatBuffer leftVelocity = createFloatBuffer(3).put(new float[] { 0.0f, 0.0f, 0.0f }); private FloatBuffer leftVelocity = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
/** Position of center sound */ /** Position of center sound */
private FloatBuffer centerPosition = createFloatBuffer(3).put(new float[] { 0.0f, 0.0f, -4.0f }); private FloatBuffer centerPosition = createFloatBuffer(new float[] { 0.0f, 0.0f, -4.0f });
/** Velocity of center sound */ /** Velocity of center sound */
private FloatBuffer centerVelocity = createFloatBuffer(3).put(new float[] { 0.0f, 0.0f, 0.0f }); private FloatBuffer centerVelocity = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
/** Position of right sound */ /** Position of right sound */
private FloatBuffer rightPosition = createFloatBuffer(3).put(new float[] { 2.0f, 0.0f, 0.0f }); private FloatBuffer rightPosition = createFloatBuffer(new float[] { 2.0f, 0.0f, 0.0f });
/** Velocity of right sound */ /** Velocity of right sound */
private FloatBuffer rightVelocity = createFloatBuffer(3).put(new float[] { 0.0f, 0.0f, 0.0f }); private FloatBuffer rightVelocity = createFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f });
// --------------------------------------------------- // ---------------------------------------------------
/** /**
@ -146,19 +146,6 @@ public class PositionTest extends BasicTest {
AL.create(); AL.create();
listenerPosition.flip();
listenerVelocity.flip();
listenerOrientation.flip();
leftPosition.flip();
leftVelocity.flip();
centerPosition.flip();
centerVelocity.flip();
rightPosition.flip();
rightVelocity.flip();
AL10.alListener(AL10.AL_POSITION, listenerPosition); AL10.alListener(AL10.AL_POSITION, listenerPosition);
AL10.alListener(AL10.AL_VELOCITY, listenerVelocity); AL10.alListener(AL10.AL_VELOCITY, listenerVelocity);
AL10.alListener(AL10.AL_ORIENTATION, listenerOrientation); AL10.alListener(AL10.AL_ORIENTATION, listenerOrientation);