Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Transform.cpp
Go to the documentation of this file.
1
2
3#include "Headers/Transform.h"
4
5namespace Divide {
6
7Transform::Transform(const Quaternion<F32>& orientation, const vec3<F32>& translation, const vec3<F32>& scale) noexcept
8{
9 _scale.set(scale);
10 _translation.set(translation);
11 _orientation.set(orientation);
12}
13
14void Transform::setTransforms(const mat4<F32>& transform) {
15 vec3<F32> tempEuler = VECTOR3_ZERO;
16 if (Util::decomposeMatrix(transform, _translation, _scale, tempEuler)) {
18 }
19}
20
21void Transform::identity() noexcept {
25}
26
27} // namespace Divide
void identity() noexcept
Definition: Quaternion.inl:657
void fromEuler(const vec3< Angle::DEGREES< T > > &v) noexcept
Definition: Quaternion.inl:316
Transform() noexcept=default
void identity() noexcept
Reset transform to identity.
Definition: Transform.cpp:21
void setTransforms(const mat4< F32 > &transform)
Definition: Transform.cpp:14
void set(const T *v) noexcept
set the 3 components of the vector manually using a source pointer to a (large enough) array
Definition: MathVectors.h:707
constexpr DEGREES< T > to_DEGREES(RADIANS< T > angle) noexcept
Definition: MathHelper.inl:380
bool decomposeMatrix(const mat4< F32 > &transform, vec3< F32 > &translationOut, vec3< F32 > &scaleOut, vec3< Angle::RADIANS< F32 > > &rotationOut, bool &isUniformScaleOut)
Definition: MathHelper.cpp:14
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
static const vec3< F32 > VECTOR3_UNIT
Definition: MathVectors.h:1437
static const vec3< F32 > VECTOR3_ZERO
Definition: MathVectors.h:1434
vec3< F32 > _translation
The object's position in the world as a 3 component vector.
Quaternion< F32 > _orientation