Skip to content

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.

AmVector3 Amplitude::Zone::GetDirection () const

Returns:

The direction vector.

GetFactor[1/3]

Gets the factor according to the position of the given entity in the zone.

inline virtual AmReal32 Amplitude::Zone::GetFactor (
    const Entity & entity
) const

Parameters:

  • entity The 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.

inline virtual AmReal32 Amplitude::Zone::GetFactor (
    const Listener & listener
) const

Parameters:

  • listener The 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.

virtual AmReal32 Amplitude::Zone::GetFactor (
    const AmVector3 & position
) const = 0

Parameters:

  • position The 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.

const AmVector3 & Amplitude::Zone::GetLocation () const

Returns:

The current location of this zone.

GetOrientation

Gets the orientation of this zone.

const Orientation & Amplitude::Zone::GetOrientation () const

Returns:

The orientation of this zone.

GetUp

Gets the up vector of the zone.

AmVector3 Amplitude::Zone::GetUp () const

Returns:

The up vector.

SetLocation

Sets the location of this zone in the 3D environment.

void Amplitude::Zone::SetLocation (
    const AmVector3 & location
) 

Parameters:

  • location The zone location.
SetOrientation

Sets the orientation of this zone.

void Amplitude::Zone::SetOrientation (
    const Orientation & orientation
) 

Parameters:

  • orientation The new orientation.
Zone

Creates a new zone from the given inner and outer shapes.

explicit Amplitude::Zone::Zone (
    std::shared_ptr< Shape > inner,
    std::shared_ptr< Shape > outer
) 

Parameters:

  • inner The inner shape.
  • outer The outer shape.
~Zone

Default destructor.

virtual Amplitude::Zone::~Zone () 

Protected Attributes Documentation

m_innerShape

The inner shape of the zone.

std::shared_ptr<Shape> SparkyStudios::Audio::Amplitude::Zone::m_innerShape;
m_outerShape

The outer shape of the zone.

std::shared_ptr<Shape> SparkyStudios::Audio::Amplitude::Zone::m_outerShape;

The documentation for this class was generated from the following file: include/SparkyStudios/Audio/Amplitude/Math/Shape.h