|
Game Audio Module
A C++ audio system using miniaudio with Python bindings
|
3D vector for spatial audio positioning More...
#include <vec3.h>
Public Member Functions | |
| Vec3 () | |
| Default constructor (initializes to origin) | |
| Vec3 (float x, float y, float z) | |
| Constructor with components. | |
| float | Distance (const Vec3 &other) const |
| Calculate distance to another point. | |
| float | DistanceSquared (const Vec3 &other) const |
| Calculate squared distance to another point (faster, no sqrt) | |
| float | Length () const |
| Get the length of the vector. | |
| float | LengthSquared () const |
| Get the squared length of the vector (faster, no sqrt) | |
| void | Normalize () |
| Normalize the vector in place. | |
| Vec3 | Normalized () const |
| Get a normalized copy of the vector. | |
| bool | operator!= (const Vec3 &other) const |
| Vec3 | operator* (float scalar) const |
| Vec3 & | operator*= (float scalar) |
| Vec3 | operator+ (const Vec3 &other) const |
| Vec3 & | operator+= (const Vec3 &other) |
| Vec3 | operator- (const Vec3 &other) const |
| Vec3 & | operator-= (const Vec3 &other) |
| Vec3 | operator/ (float scalar) const |
| Vec3 & | operator/= (float scalar) |
| bool | operator== (const Vec3 &other) const |
Public Attributes | |
| float | x |
| X component. | |
| float | y |
| Y component. | |
| float | z |
| Z component. | |
3D vector for spatial audio positioning
Represents a position or direction in 3D space. This is engine-agnostic and can be used with any game engine by converting from the engine's vector type to Vec3.
The Vec3 struct uses simple x, y, z float components, making it easy to convert from any engine's vector type (e.g., Basilisk Engine nodes, Unity Vector3, Unreal FVector, etc.).
Example conversion from a game engine node:
|
inline |
Default constructor (initializes to origin)
|
inline |
Constructor with components.
| x | X component |
| y | Y component |
| z | Z component |
|
inline |
Calculate distance to another point.
| other | Other point |
|
inline |
Calculate squared distance to another point (faster, no sqrt)
| other | Other point |
|
inline |
Get the length of the vector.
|
inline |
Get the squared length of the vector (faster, no sqrt)
|
inline |
Normalize the vector in place.
|
inline |
Get a normalized copy of the vector.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| float audio::Vec3::x |
X component.
| float audio::Vec3::y |
Y component.
| float audio::Vec3::z |
Z component.