|
1.0: Final Release | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
OrientationControl
is an interface for manipulating
the virtual orientation of an object in the virtual acoustical space.
Usually, the object is either the listener
via the Spectator
or a source via a SoundSource3D
.
In the case of a sound source, subinterfaces DirectivityControl
and/or MacroscopicControl
are used instead of
the superinterface OrientationControl
.
Orientation is a representation of a direction in a virtual acoustical space. Orientation is defined in rotation angles around coordinate axes. Positive rotation directions around the coordinate axes are counterclockwise when looking towards the origin from a positive coordinate position on each axis. The initial orientation is towards the negative Z-axis. Orientation is defined in three angles: heading that represents rotation around the Y-axis, pitch that represents rotation around the X-axis, and roll that represents rotation around the Z-axis. Orientation is applied in the following order: heading, pitch, and roll. Therefore, notice that heading rotates the X-axis and therefore affects the pitch, and similarly heading and pitch rotate the Z-axis and therefore affect the roll.
The default orientation of all orientation controls (whether the application has obtained them or not) is pointing directly towards the negative Z-axis:
frontVector = (0, 0, -1000)
upVector = (0, 1000, 0)
In rotation angles this is equivalent to:
heading = 0
pitch = 0
roll = 0
Control
,
DirectivityControl
,
LocationControl
Method Summary | |
int[] |
getOrientationVectors()
Gets the orientation of the object using two vectors. |
void |
setOrientation(int[] frontVector,
int[] aboveVector)
Turns the object to the new orientation. |
void |
setOrientation(int heading,
int pitch,
int roll)
Turns the object to the new orientation. |
Method Detail |
public void setOrientation(int heading, int pitch, int roll)
Turns the object to the new orientation.
The new orientation is given using rotation angles. A zero vector corresponds to the orientation pointing directly towards the negative Z-axis. Orientation is applied in the following order: heading, pitch, and roll. Therefore, notice that heading rotates the X-axis and therefore affects the pitch, and similarly heading and pitch rotate the Z-axis and therefore affect the roll.
heading
- the rotation around the Y-axis in degreespitch
- the rotation around the X-axis in degreesroll
- the rotation around the Z-axis in degreespublic void setOrientation(int[] frontVector, int[] aboveVector) throws java.lang.IllegalArgumentException
Turns the object to the new orientation.
The orientation is specified using two vectors, one specifying the direction of the front vector of the object in world coordinates, and another specifying the "above" vector of the object. The right and up vectors of the object are calculated by first calculating the "right" vector as the cross product of the front vector and the "above" vector, and then the up vector as a cross product of the right and front vectors. (The magnitudes of the front and up vectors may be adjusted by the implementation.)
The specified vectors need not be unit vectors (i.e. normalized): they can have any non-zero magnitude.
frontVector
- a 3-element array specifying the front vector of the
object in the world coordinate systemaboveVector
- a 3-element array specifying the "above" vector mentioned above
java.lang.IllegalArgumentException
- if any argument has fewer than or
greater than 3 elements in the array; or if any argument is the zero
vector; or if the specified vectors are parallel. (The orientation of
the object will remain unchanged.)public int[] getOrientationVectors()
Gets the orientation of the object using two vectors.
setOrientation(int[] frontVector, int[] aboveVector)
|
1.0: Final Release | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |