|
1.0: Final Release | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
LocationControl
is an interface for manipulating
the virtual location of an object (usually a SoundSource3D
or the listener via the Spectator
) in the virtual
acoustic space.
This interface allows the location to be specified
in a 3-dimensional space with setCartesian()
or setSpherical()
methods.
One of the main features of this API is the possibility to locate sound sources in a virtual space. Humans can perceive the direction of a sound source quite accurately using certain physical properties of the sound arriving to the ears. These so-called location cues can be simulated by a computer and thus a virtual direction for the arriving sound can be created.
The distance has an effect of attenuating the far positioned source and also lowering the relative level of the source compared to the reverberation level. Therefore, giving just the direction of the source is not enough, because the distance of the source can also be simulated.
In this API, the sound sources have a location primarily defined in 3D coordinates so that both the distance and the direction are specified by just giving the XYZ coordinates. The coordinate system used is right-handed. Giving the location using radius and angles instead of XYZ coordinates is an optional method. The direction where the sound is actually heard from depends both on the location of the sound source and the location of the listener.
The default location of all location controls (whether the application has obtained them or not) is the origin:
x = 0
y = 0
z = 0
Control
,
Player
,
Spectator
,
SoundSource3D
,
OrientationControl
,
CommitControl
Method Summary | |
int[] |
getCartesian()
Gets the coordinates of the current location. |
void |
setCartesian(int x,
int y,
int z)
Moves the object to the new location. |
void |
setSpherical(int azimuth,
int elevation,
int radius)
Moves the object to the new location. |
Method Detail |
public void setCartesian(int x, int y, int z)
Moves the object to the new location.
Sets the location using cartesian right-handed coordinates that are relative to the origin.
x
- the x-coordinate of the new location in millimetersy
- the y-coordinate of the new location in millimetersz
- the z-coordinate of the new location in millimetersgetCartesian()
public void setSpherical(int azimuth, int elevation, int radius)
Moves the object to the new location.
Sets the new location using spherical coordinates. The negative z-axis is the reference. That is, a location where both azimuth and elevation are zero, is on the negative z-axis. Radius is defined in millimeters.
azimuth
- the azimuth angle of the new location in degrees.
The azimuth is measured from the negative z-axis
in the direction of the x-axis.elevation
- the elevation angle of the new location in degrees.
The elevation is measured from the x-z-plane in the direction
of the y-axis.radius
- the radius of the new location from the origin in millimeters
java.lang.IllegalArgumentException
- if radius
< 0public int[] getCartesian()
|
1.0: Final Release | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |