Class DirectSound3dListener
public class DirectSound3dListener implements
IDirectSound3dListener
{
// Methods
public void commitDeferredSettings();
public void getAllParameters(DS3dListener listener);
public void getDistanceFactor(float[] distanceFactor);
public void getDopplerFactor(float[] dopplerFactor);
public void getOrientation(D3dVector orientFront,
D3dVector orientTop);
public void getPosition(D3dVector position);
public void getRolloffFactor(float[] rolloffFactor);
public void getVelocity(D3dVector velocity);
public void setAllParameters(DS3dListener listener,
int applyFlag);
public void setDistanceFactor(float distanceFactor,
int applyFlag);
public void setDopplerFactor(float dopplerFactor, int applyFlag);
public void setOrientation(float xFront, float yFront,
float zFront, float xTop, float yTop, float zTop,
int applyFlag);
public void setPosition(float x, float y, float z, int applyFlag);
public void setRolloffFactor(float rolloffFactor, int applyFlag);
public void setVelocity(float x, float y, float z, int applyFlag);
}
public void commitDeferredSettings();
Commits any deferred settings made since the last call to this method.
Return Value:
No return value.
public void getAllParameters(DS3dListener listener);
Retrieves information that describes the current state of the 3D world and listener.
Return Value:
No return value.
Parameter | Description |
listener
| The DS3dListener object that contains the current state of the 3D world and listener.
|
public void getDistanceFactor(float[] distanceFactor);
Retrieves the current distance factor.
Return Value:
No return value.
Parameter | Description |
distanceFactor
| The array that will contain the current distance factor values.
|
public void getDopplerFactor(float[] dopplerFactor);
Retrieves the current Doppler effect factor.
Return Value:
No return value.
Parameter | Description |
dopplerFactor
| The array that will contain the current Doppler factor values.
|
Remarks:
This Doppler factor has a range of 0 (no Doppler effects) to 10.0 (10 times the Doppler effects found in the physical world). The default value is DS3D_DEFAULTDOPPLERFACTOR (1.0).
public void getOrientation(D3dVector orientFront, D3dVector orientTop);
Retrieves the listener's current orientation in vectors: a front vector and a top vector.
Return Value:
No return value.
Parameter | Description |
orientFront
| The D3dVector object that will contain the listener's front orientation vector.
|
orientTop
| The D3dVector object that will contain the listener's top orientation vector.
|
Remarks:
The front vector points in the direction of the listener's nose, and the top vector points out the top of the listener's head. By default, the front vector is (0,0,1.0) and the top vector is (0,1.0,0).
public void getPosition(D3dVector position);
Retrieves the listener's current position in distance units. By default, these units are meters, but this can be changed by calling the setDistanceFactor method.
Return Value:
No return value.
Parameter | Description |
position
| The D3dVector that will contain the listener's position vector.
|
public void getRolloffFactor(float[] rolloffFactor);
Retrieves the current rolloff factor.
Return Value:
No return value.
Parameter | Description |
rolloffFactor
| Tha array that will contain the current rolloff factor values.
|
Remarks:
The default value is DS3D_DEFAULTROLLOFFFACTOR (1.0). For additional information about the rolloff factor, see Rolloff Factor.
public void getVelocity(D3dVector velocity);
Retrieves the listener's current velocity.
Return Value:
No return value.
Parameter | Description |
velocity
| The D3dVector that will contain the listener's current velocity.
|
Remarks:
Velocity is used only for Doppler effects. It does not actually move the listener. To change the listener's position, use the setPosition method. The default velocity is (0,0,0).
public void setAllParameters(DS3dListener listener, int applyFlag);
Sets all 3D listener parameters from a given DS3dListener class that describes all aspects of the 3D listener at a moment in time.
Return Value:
No return value.
Parameter | Description |
listener
| Address of a DS3dListener class that contains information describing all current 3D listener parameters.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
public void setDistanceFactor(float distanceFactor, int applyFlag);
Sets the current distance factor.
Return Value:
No return value.
Parameter | Description |
distanceFactor
| New distance factor.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
public void setDopplerFactor(float dopplerFactor, int applyFlag);
Sets the current Doppler effect factor.
Return Value:
No return value.
Parameter | Description |
dopplerFactor
| New Doppler factor value.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
Remarks:
This Doppler factor has a range of 0 (no Doppler effects) to 10.0 (10 times the Doppler effects found in the physical world). The default value is DS3D_DEFAULTDOPPLERFACTOR (1.0).
public void setOrientation(float xFront, float yFront, float zFront,
float xTop, float yTop, float zTop, int applyFlag);
Sets the listeners orientation, given a front vector and a top vector.
Return Value:
No return value.
Parameter | Description |
xFront
| The x component of the front vector.
|
yFront
| The y component of the front vector.
|
zFront
| The z component of the front vector.
|
xTop
| The x component of the top vector.
|
yTop
| The y component of the top vector.
|
ztop
| The x component of the top vector.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
Remarks:
The front vector points in the direction of the listener's nose, and the top vector points out the top of the listener's head.
public void setPosition(float x, float y, float z, int applyFlag);
Retrieves the listener's current position in distance units. By default, these units are meters, but this can be changed by calling the DirectSound3dListener.setDistanceFactor method.
Return Value:
No return value.
Parameter | Description |
x
| The x component of the vector that will contain the listener's position.
|
y
| The y component of the vector that will contain the listener's position.
|
z
| The z component of the vector that will contain the listener's position.
|
applyFlag
| Flag values.
|
public void setRolloffFactor(float rolloffFactor, int applyFlag);
Sets the rolloff factor.
Return Value:
No return value.
Parameter | Description |
rolloffFactor
| New rolloff factor.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
Remarks:
The default value is DS3D_DEFAULTROLLOFFFACTOR (1.0). For additional information about the rolloff factor, see Rolloff Factor.
public void setVelocity(float x, float y, float z, int applyFlag);
Sets the listener's velocity.
Return Value:
No return value.
Parameter | Description |
x
| The x coordinate of the listener's new velocity vector.
|
y
| The y coordinate of the listener's new velocity vector.
|
z
| The z-coordinate of the listener's new velocity vector.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
Remarks:
Velocity is used only for Doppler effects. It does not actually move the listener. To change the listener's position, use the setPosition method. The default velocity is (0,0,0).