2#include <lib/nw4r/math/vec.hpp>
4#include <game/mLib/m_angle.hpp>
5#include <lib/egg/math.hpp>
18 mVec2_c(
const f32 *p) { x = p[0]; y = p[1]; }
26 void set(
float x,
float y) {
33 void incX(
float x) { this->x += x; }
37 void incY(
float y) { this->y += y; }
40 mVec2_c &operator=(
const mVec2_c &v) { x = v.x; y = v.y;
return *
this; }
43 operator f32*() {
return &x; }
46 operator const f32*()
const {
return &x; }
52 operator const Vec2*()
const {
return (
const Vec2*)&x; }
107 mVec3_c(
const f32 *p) { x = p[0]; y = p[1]; z = p[2]; }
110 mVec3_c(f32 fx, f32 fy, f32 fz) { x = fx; y = fy; z = fz; }
119 operator f32*() {
return &x; }
122 operator const f32*()
const {
return &x; }
128 operator const Vec*()
const {
return (
const Vec*)&x; }
A two-dimensional floating point vector.
A two-dimensional floating point vector.
mVec2_c(const mVec2_c &v)
Copy constructor.
mVec2_c operator+() const
Positive operator.
bool operator!=(const mVec2_c &v) const
Inequality operator.
mVec2_c & operator+=(const mVec2_c &v)
Augmented addition operator.
mVec2_c operator+(const mVec2_c &v) const
Addition operator.
mVec2_c()
Constructs an empty vector.
mVec2_c & operator/=(f32 f)
Augmented scalar division operator.
mVec2_c operator/(f32 f) const
Scalar division operator.
bool operator==(const mVec2_c &v) const
Equality operator.
mVec2_c(const f32 *p)
Constructs a vector from a float array.
void incY(float y)
Increments the Y coordinate.
mVec2_c(f32 fx, f32 fy)
Constructs a vector from two floating point values.
mVec2_c & operator*=(f32 f)
Augmented scalar product operator.
mVec2_c operator*(f32 f) const
Scalar product operator.
mVec2_c & operator-=(const mVec2_c &v)
Augmented subtraction operator.
mVec2_c operator-(const mVec2_c &v) const
Subtraction operator.
mVec2_c operator-() const
Negative operator.
void incX(float x)
Increments the X coordinate.
A three-dimensional floating point vector.
mVec3_c operator/(f32 f) const
Scalar division operator.
static mVec3_c Ex
The unit vector for the X axis.
static mVec3_c Ey
The unit vector for the Y axis.
mVec3_c(const nw4r::math::VEC3 &v)
Constructs a new vector from an existing vector from the nw4r::math library.
mVec3_c & operator-=(const mVec3_c &v)
Augmented subtraction operator.
mVec3_c operator*(f32 f) const
Scalar product operator.
mVec3_c & operator+=(const mVec3_c &v)
Augmented addition operator.
bool normalizeRS()
Normalizes the vector.
mVec3_c operator-() const
Negative operator.
mVec3_c operator-(const mVec3_c &v) const
Subtraction operator.
mVec3_c(f32 fx, f32 fy, f32 fz)
Constructs a vector from three floating point values.
mVec3_c(const f32 *p)
Constructs a vector from a float array.
float normalize()
Normalizes the vector.
bool operator==(const mVec3_c &v) const
Equality operator.
mVec3_c & operator*=(f32 f)
Augmented scalar product operator.
mVec3_c operator+() const
Positive operator.
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.
static mVec3_c Zero
The null vector.
mVec3_c & operator/=(f32 f)
Augmented scalar division operator.
bool operator!=(const mVec3_c &v) const
Inequality operator.
mVec3_c(const Vec &v)
Constructs a new vector from an existing vector from the MTX library.
mVec3_c operator+(const mVec3_c &v) const
Addition operator.
mVec3_c()
Constructs an empty vector.
static mVec3_c Ez
The unit vector for the Z axis.
A two-dimensional floating point vector.
A three-dimensional floating point vector.
A one-dimensional short angle vector.
A three-dimensional floating point vector.