28 #ifndef BERSERK_TRANSFORMF_H
29 #define BERSERK_TRANSFORMF_H
75 mRotation = mRotation *
Quatf(axis, angleRad);
80 mScale[INDEX_X] *= scale;
85 mScale[INDEX_Y] *= scale;
90 mScale[INDEX_Z] *= scale;
110 auto rotated = mRotation.
Rotate(v);
111 auto scaled = rotated * mScale;
112 auto translated = scaled + mOffset;
117 auto rotated = mRotation.
Rotate(v);
118 auto scaled = rotated * (
Vec3f(1.0f, 1.0f, 1.0f) / mScale);
124 auto rotation = mRotation.
AsMatrix();
127 return translation * scale * rotation;
138 return rotation * scale * translation;
143 auto rotation = mRotation.
AsMatrix();
145 return scale * rotation;
175 auto Z = (-dir).Normalized();
180 X[INDEX_X],
X[INDEX_Y],
X[INDEX_Z], 0.0f,
181 Y[INDEX_X],
Y[INDEX_Y],
Y[INDEX_Z], 0.0f,
182 Z[INDEX_X],
Z[INDEX_Y],
Z[INDEX_Z], 0.0f,
183 0.0f, 0.0f, 0.0f, 1.0f);
185 t.mRotation =
Quatf(rotation);
191 static const uint32 INDEX_X = 0;
192 static const uint32 INDEX_Y = 1;
193 static const uint32 INDEX_Z = 2;
#define BRK_NS_END
Definition: Config.hpp:48
std::uint32_t uint32
Definition: Typedefs.hpp:44
static Mat4x4f Scale(const Vec3f &scale)
Definition: MathUtils3d.hpp:71
static Mat4x4f Translate(const Vec3f &t)
Translation in the direction of vec t.
Definition: MathUtils3d.hpp:86
Mat AsMatrix() const
Definition: TQuat.hpp:240
Vec Rotate(const Vec &v) const
Definition: TQuat.hpp:212
TQuat Conjugate() const
Definition: TQuat.hpp:208
static TVecN Cross(const TVecN &a, const TVecN &b)
Definition: TVecN.hpp:375
static TVecN AxisZ()
Definition: TVecN.hpp:590
static TVecN AxisX()
Definition: TVecN.hpp:582
static TVecN AxisY()
Definition: TVecN.hpp:586
TVecN Normalized() const
Definition: TVecN.hpp:520
TQuat< float > Quatf
Definition: TQuat.hpp:423
TVecN< float, 3 > Vec3f
Definition: TVecN.hpp:599
Definition: GLDevice.cpp:46