Zone¶
A tuple of shapes that represents a zone in the world.
Inherited by the following classes: SparkyStudios::Audio::Amplitude::BoxZone, SparkyStudios::Audio::Amplitude::CapsuleZone, SparkyStudios::Audio::Amplitude::ConeZone, SparkyStudios::Audio::Amplitude::SphereZone
Detailed Description¶
This shape is mainly used by attenuation and environments. It's composed of an inner Shape and an outer Shape. The inner shape is the place where the factor is equal to one all the time. The outer shape is the place where the factor increases or decreases according to the shortest distance of the game object from the outer edge.
If the game object is outside the outer shape (thus, outside the zone), the factor is zero.
Public Functions¶
| Type | Name |
|---|---|
| AmVector3 | GetDirection () const Gets the direction vector of the zone. |
| virtual AmReal32 | GetFactor (const Entity & entity) const Gets the factor according to the position of the given entity in the zone. |
| virtual AmReal32 | GetFactor (const Listener & listener) const Gets the factor according to the position of the given listener in the zone. |
| virtual AmReal32 | GetFactor (const AmVector3 & position) const = 0 Gets the factor according to the given position in the zone. |
| const AmVector3 & | GetLocation () const Gets the current location of this zone. |
| const Orientation & | GetOrientation () const Gets the orientation of this zone. |
| AmVector3 | GetUp () const Gets the up vector of the zone. |
| void | SetLocation (const AmVector3 & location) Sets the location of this zone in the 3D environment. |
| void | SetOrientation (const Orientation & orientation) Sets the orientation of this zone. |
| Zone (std::shared_ptr< Shape > inner, std::shared_ptr< Shape > outer) Creates a new zone from the given inner and outer shapes. | |
| virtual | ~Zone () Default destructor. |
Protected Attributes¶
| Type | Name |
|---|---|
| std::shared_ptr< Shape > | m_innerShape The inner shape of the zone. |
| std::shared_ptr< Shape > | m_outerShape The outer shape of the zone. |
Public Functions Documentation¶
GetDirection
Gets the direction vector of the zone.
Returns:
The direction vector.
GetFactor[1/3]
Gets the factor according to the position of the given entity in the zone.
Parameters:
-
entityThe entity to get the factor for.
Returns:
The factor.
Note:
The factor is a value in the range [0, 1].
GetFactor[2/3]
Gets the factor according to the position of the given listener in the zone.
Parameters:
-
listenerThe listener to get the factor for.
Returns:
The factor.
Note:
The factor is a value in the range [0, 1].
GetFactor[3/3]
Gets the factor according to the given position in the zone.
Parameters:
-
positionThe position in the zone to get the factor for.
Returns:
The factor.
Note:
The factor is a value in the range [0, 1].
GetLocation
Gets the current location of this zone.
Returns:
The current location of this zone.
GetOrientation
Gets the orientation of this zone.
Returns:
The orientation of this zone.
GetUp
Gets the up vector of the zone.
Returns:
The up vector.
SetLocation
Sets the location of this zone in the 3D environment.
Parameters:
-
locationThe zone location.
SetOrientation
Sets the orientation of this zone.
Parameters:
-
orientationThe new orientation.
Zone
Creates a new zone from the given inner and outer shapes.
Parameters:
-
innerThe inner shape. -
outerThe outer shape.
Protected Attributes Documentation¶
m_innerShape
The inner shape of the zone.
m_outerShape
The outer shape of the zone.
The documentation for this class was generated from the following file: include/SparkyStudios/Audio/Amplitude/Math/Shape.h