Retrieves the position, velocity, and orientation of the listener.
Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
[DllImportAttribute("bass")] public static bool BASS_Get3DPosition( BASS_3DVECTOR pos, BASS_3DVECTOR vel, BASS_3DVECTOR front, BASS_3DVECTOR top )
Parameters
- pos
- Type: Un4seen.BassBASS_3DVECTOR
The position of the listener... = don't retrieve it. - vel
- Type: Un4seen.BassBASS_3DVECTOR
The listener's velocity... = don't retrieve it. - front
- Type: Un4seen.BassBASS_3DVECTOR
The direction that the listener's front is pointing... =don't retrieve it. - top
- Type: Un4seen.BassBASS_3DVECTOR
The direction that the listener's top is pointing... = don't retrieve it.
Return Value
Type: BooleanIf succesful, then is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks
The front and top parameters must both be retrieved in a single call, they can not be retrieved individually.
When using multiple devices, the current thread's device setting (as set with BASS_SetDevice(Int32)) determines which device this function call applies to.
ERROR CODE | Description |
---|---|
BASS_ERROR_INIT | BASS_Init(Int32, Int32, BASSInit, IntPtr, IntPtr) has not been successfully called. |
BASS_ERROR_NO3D | The device was not initialized with 3D support. |
Examples
BASS_3DVECTOR position = new BASS_3DVECTOR(camera.RealPosition.x, camera.RealPosition.y, camera.RealPosition.z); BASS_3DVECTOR direction = new BASS_3DVECTOR(camera.RealDirection.x, camera.RealDirection.y, camera.RealDirection.z); BASS_3DVECTOR up = new BASS_3DVECTOR(-camera.RealUp.x, -camera.RealUp.y, -camera.RealUp.z); if (!Bass.BASS_Set3DPosition(position, velocity, direction, up)) throw new AudioException("Could not set the 3d position of the listener", "listener", Bass.BASS_ErrorGetCode()); Bass.BASS_Apply3D();
See Also