gwnavruntime/math/matrix3x3f.h Source File
Go to the documentation of this file.
9 #ifndef Navigation_Matrix3x3f_H
10 #define Navigation_Matrix3x3f_H
64 bool operator==(
const Matrix3x3f& other)
const;
65 bool operator!=(
const Matrix3x3f& other)
const;
75 for (
int i = 0; i < 9; ++i)
76 SwapEndianness(e,
self.m[i]);
79 KY_INLINE Matrix3x3f::Matrix3x3f()
84 KY_INLINE Matrix3x3f::Matrix3x3f(
94 KY_INLINE Matrix3x3f::Matrix3x3f(
const Vec3f& v_x,
const Vec3f& v_y,
const Vec3f& v_z)
99 KY_INLINE Matrix3x3f::Matrix3x3f(
const Vec3f& axis,
KyFloat32 angleRad)
104 KY_INLINE Matrix3x3f Matrix3x3f::Identity()
112 KY_INLINE
void Matrix3x3f::Set(
117 m[xx] = v_xx; m[xy] = v_xy; m[xz] = v_xz;
118 m[yx] = v_yx; m[yy] = v_yy; m[yz] = v_yz;
119 m[zx] = v_zx; m[zy] = v_zy; m[zz] = v_zz;
122 KY_INLINE
void Matrix3x3f::Set(
const Vec3f& v_x,
const Vec3f& v_y,
const Vec3f& v_z)
124 Set(v_x.x, v_x.y, v_x.z,
126 v_z.x, v_z.y, v_z.z);
129 KY_INLINE
void Matrix3x3f::SetIdentity()
131 Set(1.0f, 0.0f, 0.0f,
136 KY_INLINE
const Vec3f& Matrix3x3f::GetRow(
KyUInt32 index)
const
138 KY_ASSERT(index < 3);
139 return *(Vec3f*)(&m[xx] + index * 3);
142 KY_INLINE Vec3f& Matrix3x3f::GetRow(
KyUInt32 index)
144 KY_ASSERT(index < 3);
145 return *(Vec3f*)(&m[xx] + index * 3);
152 m[xx] * v.x + m[yx] * v.y + m[zx] * v.z,
153 m[xy] * v.x + m[yy] * v.y + m[zy] * v.z,
154 m[xz] * v.x + m[yz] * v.y + m[zz] * v.z);
157 KY_INLINE
void Matrix3x3f::Transform(
const Vec3f& v, Vec3f& transformed)
const
159 transformed = *
this * v;
162 KY_INLINE
bool Matrix3x3f::operator==(
const Matrix3x3f& other)
const
164 for (
int i = 0; i < 9; ++i)
165 if (m[i] != other.m[i])
170 KY_INLINE
bool Matrix3x3f::operator != (
const Matrix3x3f& other)
const
172 return !operator==(other);
177 #endif // Navigation_Matrix3x3f_H
3x3 matrix.
Definition: matrix3x3f.h:21
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
void SetRotation(const Vec3f &axis, KyFloat32 angleRad)
Set as angleRad rotation matrix around axis.
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23
Vec3f operator*(const Vec3f &v) const
Returns the product of this matrix and v.
Definition: matrix3x3f.h:159