NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
mVec3_c Class Reference

#include <game/mLib/m_vec.hpp>

Inheritance diagram for mVec3_c:
[legend]

Description

A three-dimensional floating point vector.

Todo
Add EGG::vector3f operators.

Definition at line 100 of file m_vec.hpp.

Public Member Functions

 mVec3_c ()
 Constructs an empty vector.
 
 mVec3_c (const f32 *p)
 Constructs a vector from a float array.
 
 mVec3_c (f32 fx, f32 fy, f32 fz)
 Constructs a vector from three floating point values.
 
 mVec3_c (const Vec &v)
 Constructs a new vector from an existing vector from the MTX library.
 
 mVec3_c (const nw4r::math::VEC3 &v)
 Constructs a new vector from an existing vector from the nw4r::math library.
 
 operator f32 * ()
 Float cast operator.
 
 operator const f32 * () const
 Const float cast operator.
 
 operator Vec * ()
 Vec cast operator.
 
 operator const Vec * () const
 Const Vec cast operator.
 
 operator nw4r::math::VEC3 * ()
 nw4r::math::VEC3 cast operator.
 
 operator const nw4r::math::VEC3 * () const
 Const nw4r::math::VEC3 cast operator.
 
mVec3_coperator+= (const mVec3_c &v)
 Augmented addition operator.
 
mVec3_coperator-= (const mVec3_c &v)
 Augmented subtraction operator.
 
mVec3_coperator*= (f32 f)
 Augmented scalar product operator.
 
mVec3_coperator/= (f32 f)
 Augmented scalar division operator.
 
mVec3_c operator+ () const
 Positive operator.
 
mVec3_c operator- () const
 Negative operator.
 
mVec3_c operator+ (const mVec3_c &v) const
 Addition operator.
 
mVec3_c operator- (const mVec3_c &v) const
 Subtraction operator.
 
mVec3_c operator* (f32 f) const
 Scalar product operator.
 
mVec3_c operator/ (f32 f) const
 Scalar division operator.
 
bool operator== (const mVec3_c &v) const
 Equality operator.
 
bool operator!= (const mVec3_c &v) const
 Inequality operator.
 
float normalize ()
 Normalizes the vector.
 
bool normalizeRS ()
 Normalizes the vector.
 
void rotX (mAng angle)
 Rotates the vector on the X axis by the given angle.
 
void rotY (mAng angle)
 Rotates the vector on the Y axis by the given angle.
 
- Public Member Functions inherited from nw4r::math::VEC3
 VEC3 (float fx, float fy, float fz)
 

Static Public Attributes

static mVec3_c Zero = mVec3_c(0.0f, 0.0f, 0.0f)
 The null vector.
 
static mVec3_c Ex = mVec3_c(1.0f, 0.0f, 0.0f)
 The unit vector for the X axis.
 
static mVec3_c Ey = mVec3_c(0.0f, 1.0f, 0.0f)
 The unit vector for the Y axis.
 
static mVec3_c Ez = mVec3_c(0.0f, 0.0f, 1.0f)
 The unit vector for the Z axis.
 

Additional Inherited Members

- Public Attributes inherited from nw4r::math::_VEC3
float x
 
float y
 
float z
 

Constructor & Destructor Documentation

◆ mVec3_c() [1/5]

mVec3_c::mVec3_c ( )
inline

Constructs an empty vector.

Definition at line 104 of file m_vec.hpp.

◆ mVec3_c() [2/5]

mVec3_c::mVec3_c ( const f32 * p)
inline

Constructs a vector from a float array.

Definition at line 107 of file m_vec.hpp.

◆ mVec3_c() [3/5]

mVec3_c::mVec3_c ( f32 fx,
f32 fy,
f32 fz )
inline

Constructs a vector from three floating point values.

Definition at line 110 of file m_vec.hpp.

◆ mVec3_c() [4/5]

mVec3_c::mVec3_c ( const Vec & v)
inline

Constructs a new vector from an existing vector from the MTX library.

Definition at line 113 of file m_vec.hpp.

◆ mVec3_c() [5/5]

mVec3_c::mVec3_c ( const nw4r::math::VEC3 & v)
inline

Constructs a new vector from an existing vector from the nw4r::math library.

Definition at line 116 of file m_vec.hpp.

Member Function Documentation

◆ operator f32 *()

mVec3_c::operator f32 * ( )
inline

Float cast operator.

Definition at line 119 of file m_vec.hpp.

◆ operator const f32 *()

mVec3_c::operator const f32 * ( ) const
inline

Const float cast operator.

Definition at line 122 of file m_vec.hpp.

◆ operator Vec *()

mVec3_c::operator Vec * ( )
inline

Vec cast operator.

Definition at line 125 of file m_vec.hpp.

◆ operator const Vec *()

mVec3_c::operator const Vec * ( ) const
inline

Const Vec cast operator.

Definition at line 128 of file m_vec.hpp.

◆ operator nw4r::math::VEC3 *()

mVec3_c::operator nw4r::math::VEC3 * ( )
inline

nw4r::math::VEC3 cast operator.

Definition at line 131 of file m_vec.hpp.

◆ operator const nw4r::math::VEC3 *()

mVec3_c::operator const nw4r::math::VEC3 * ( ) const
inline

Const nw4r::math::VEC3 cast operator.

Definition at line 134 of file m_vec.hpp.

◆ operator+=()

mVec3_c & mVec3_c::operator+= ( const mVec3_c & v)
inline

Augmented addition operator.

Definition at line 137 of file m_vec.hpp.

◆ operator-=()

mVec3_c & mVec3_c::operator-= ( const mVec3_c & v)
inline

Augmented subtraction operator.

Definition at line 140 of file m_vec.hpp.

◆ operator*=()

mVec3_c & mVec3_c::operator*= ( f32 f)
inline

Augmented scalar product operator.

Definition at line 143 of file m_vec.hpp.

◆ operator/=()

mVec3_c & mVec3_c::operator/= ( f32 f)
inline

Augmented scalar division operator.

Definition at line 146 of file m_vec.hpp.

◆ operator+() [1/2]

mVec3_c mVec3_c::operator+ ( ) const
inline

Positive operator.

Definition at line 149 of file m_vec.hpp.

◆ operator-() [1/2]

mVec3_c mVec3_c::operator- ( ) const
inline

Negative operator.

Definition at line 152 of file m_vec.hpp.

◆ operator+() [2/2]

mVec3_c mVec3_c::operator+ ( const mVec3_c & v) const
inline

Addition operator.

Definition at line 155 of file m_vec.hpp.

◆ operator-() [2/2]

mVec3_c mVec3_c::operator- ( const mVec3_c & v) const
inline

Subtraction operator.

Definition at line 158 of file m_vec.hpp.

◆ operator*()

mVec3_c mVec3_c::operator* ( f32 f) const
inline

Scalar product operator.

Definition at line 161 of file m_vec.hpp.

◆ operator/()

mVec3_c mVec3_c::operator/ ( f32 f) const
inline

Scalar division operator.

Definition at line 164 of file m_vec.hpp.

◆ operator==()

bool mVec3_c::operator== ( const mVec3_c & v) const
inline

Equality operator.

Definition at line 167 of file m_vec.hpp.

◆ operator!=()

bool mVec3_c::operator!= ( const mVec3_c & v) const
inline

Inequality operator.

Definition at line 170 of file m_vec.hpp.

◆ normalize()

float mVec3_c::normalize ( )

Normalizes the vector.

Returns
The vector's magnitude.

Definition at line 18 of file m_vec.cpp.

◆ normalizeRS()

bool mVec3_c::normalizeRS ( )

Normalizes the vector.

Returns
If the operation was successful.

Definition at line 27 of file m_vec.cpp.

◆ rotX()

void mVec3_c::rotX ( mAng angle)

Rotates the vector on the X axis by the given angle.

Definition at line 37 of file m_vec.cpp.

◆ rotY()

void mVec3_c::rotY ( mAng angle)

Rotates the vector on the Y axis by the given angle.

Definition at line 46 of file m_vec.cpp.

Member Data Documentation

◆ Zero

mVec3_c mVec3_c::Zero = mVec3_c(0.0f, 0.0f, 0.0f)
static

The null vector.

Definition at line 183 of file m_vec.hpp.

◆ Ex

mVec3_c mVec3_c::Ex = mVec3_c(1.0f, 0.0f, 0.0f)
static

The unit vector for the X axis.

Definition at line 184 of file m_vec.hpp.

◆ Ey

mVec3_c mVec3_c::Ey = mVec3_c(0.0f, 1.0f, 0.0f)
static

The unit vector for the Y axis.

Definition at line 185 of file m_vec.hpp.

◆ Ez

mVec3_c mVec3_c::Ez = mVec3_c(0.0f, 0.0f, 1.0f)
static

The unit vector for the Z axis.

Definition at line 186 of file m_vec.hpp.