public void alListener(int param, FloatBuffer data) { AL10.alListener(param, data); }
@Override public void updateListener(Vector3f position, Quat4f orientation, Vector3f velocity) { AL10.alListener3f(AL10.AL_VELOCITY, velocity.x, velocity.y, velocity.z); OpenALException.checkState("Setting listener velocity"); Vector3f dir = orientation.rotate(Direction.FORWARD.getVector3f(), new Vector3f()); Vector3f up = orientation.rotate(Direction.UP.getVector3f(), new Vector3f()); FloatBuffer listenerOri = BufferUtils.createFloatBuffer(6).put(new float[] {dir.x, dir.y, dir.z, up.x, up.y, up.z}); listenerOri.flip(); AL10.alListener(AL10.AL_ORIENTATION, listenerOri); OpenALException.checkState("Setting listener orientation"); this.listenerPosition.set(position); AL10.alListener3f(AL10.AL_POSITION, position.x, position.y, position.z); OpenALException.checkState("Setting listener position"); }
alListener(AL_ORIENTATION, orientation); FloatBuffer velocity = (FloatBuffer)BufferUtils.createFloatBuffer(3).put(new float[] {0.0f, 0.0f, 0.0f}).flip(); alListener(AL_VELOCITY, velocity); FloatBuffer position = (FloatBuffer)BufferUtils.createFloatBuffer(3).put(new float[] {0.0f, 0.0f, 0.0f}).flip(); alListener(AL_POSITION, position);
alListener(AL_ORIENTATION, orientation); FloatBuffer velocity = (FloatBuffer)BufferUtils.createFloatBuffer(3).put(new float[] {0.0f, 0.0f, 0.0f}).flip(); alListener(AL_VELOCITY, velocity); FloatBuffer position = (FloatBuffer)BufferUtils.createFloatBuffer(3).put(new float[] {0.0f, 0.0f, 0.0f}).flip(); alListener(AL_POSITION, position);
public void alListener(int param, FloatBuffer data) { AL10.alListener(param, data); }
/** * Sets the orientation of the listener in terms of an "at" (direction) and "up" vector. */ public void setOrientation (float ax, float ay, float az, float ux, float uy, float uz) { if (_ax != ax || _ay != ay || _az != az || _ux != ux || _uy != uy || _uz != uz) { _vbuf.put(_ax = ax).put(_ay = ay).put(_az = az); _vbuf.put(_ux = ux).put(_uy = uy).put(_uz = uz).rewind(); AL10.alListener(AL10.AL_ORIENTATION, _vbuf); } }
/** * Sets the orientation of the listener in terms of an "at" (direction) and "up" vector. */ public void setOrientation (float ax, float ay, float az, float ux, float uy, float uz) { if (_ax != ax || _ay != ay || _az != az || _ux != ux || _uy != uy || _uz != uz) { _vbuf.put(_ax = ax).put(_ay = ay).put(_az = az); _vbuf.put(_ux = ux).put(_uy = uy).put(_uz = uz).rewind(); AL10.alListener(AL10.AL_ORIENTATION, _vbuf); } }
listenerVel.flip(); listenerOri.flip(); AL10.alListener(AL10.AL_POSITION, listenerPos); AL10.alListener(AL10.AL_VELOCITY, listenerVel); AL10.alListener(AL10.AL_ORIENTATION, listenerOri);
listenerVel.flip(); listenerOri.flip(); AL10.alListener(AL10.AL_POSITION, listenerPos); AL10.alListener(AL10.AL_VELOCITY, listenerVel); AL10.alListener(AL10.AL_ORIENTATION, listenerOri);
alListener(AL_ORIENTATION, orientation); FloatBuffer velocity = (FloatBuffer)BufferUtils.createFloatBuffer(3).put(new float[] {0.0f, 0.0f, 0.0f}).flip(); alListener(AL_VELOCITY, velocity); FloatBuffer position = (FloatBuffer)BufferUtils.createFloatBuffer(3).put(new float[] {0.0f, 0.0f, 0.0f}).flip(); alListener(AL_POSITION, position);
alListener(AL_ORIENTATION, orientation); FloatBuffer velocity = (FloatBuffer) BufferUtils.createFloatBuffer(3).put(new float[] { 0.0f, 0.0f, 0.0f }) .flip(); alListener(AL_VELOCITY, velocity); FloatBuffer position = (FloatBuffer) BufferUtils.createFloatBuffer(3).put(new float[] { 0.0f, 0.0f, 0.0f }) .flip(); alListener(AL_POSITION, position);