Skip to content

Zone

class Zone

A tuple of shapes that represents a zone in the world.

This shape is mainly used by attenuations 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 increase or decrease 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.

Variables

Name Description
m_innerShape The inner shape of the zone.
m_outerShape The outer shape of the zone.

Functions

Name Description
Zone Creates a new Zone from the given inner and outer shapes.
~Zone Default destructor.
GetFactor Gets the factor according to the position of the given entity in the zone.
GetFactor Gets the factor according to the position of the given listener in the zone.
GetFactor Gets the factor according to the given position in the zone.
SetLocation Sets the location of this zone in the 3D environment.
GetLocation Gets the current location of this zone.
SetOrientation Sets the orientation of this zone.
GetOrientation Gets the orientation of this zone.
GetDirection Gets the direction vector of the zone.
GetUp Gets the up vector of the zone.

Variable Details

m_innerShape

Shape* m_innerShape

The inner shape of the zone.

m_outerShape

Shape* m_outerShape

The outer shape of the zone.

Function Details

GetDirection

[[nodiscard]] AmVec3 GetDirection() const

Gets the direction vector of the zone.

Return
The direction vector.

GetFactor

[[nodiscard]] virtual inline AmReal32 GetFactor(const Entity& entity)

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

Parameter entity
The entity to get the factor for.
Return
The factor.

Note

The factor is a value in the range [0, 1].

[[nodiscard]] virtual inline AmReal32 GetFactor(const Listener& listener)

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

Parameter listener
The listener to get the factor for.
Return
The factor.

Note

The factor is a value in the range [0, 1].

[[nodiscard]] virtual AmReal32 GetFactor(const AmVec3& position) = 0

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

Parameter position
The position in the zone to get the factor for.
Return
The factor.

Note

The factor is a value in the range [0, 1].

GetLocation

[[nodiscard]] const AmVec3& GetLocation() const

Gets the current location of this zone.

Return
The current location of this zone.

GetOrientation

[[nodiscard]] const Orientation& GetOrientation() const

Gets the orientation of this zone.

Return
The orientation of this zone.

GetUp

[[nodiscard]] AmVec3 GetUp() const

Gets the up vector of the zone.

Return
The up vector.

SetLocation

void SetLocation(const AmVec3& location)

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

Parameter location
The zone location.

SetOrientation

void SetOrientation(const Orientation& orientation)

Sets the orientation of this zone.

Parameter orientation
The new orientation.

Zone

explicit Zone(Shape* inner, Shape* outer)

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

Parameter inner
The inner shape.
Parameter outer
The outer shape.

~Zone

virtual ~Zone() = default

Default destructor.