TDME2 1.9.121
RotationOrder.cpp
Go to the documentation of this file.
2
3#include <tdme/tdme.h>
4#include <tdme/math/Vector3.h>
6
10
11RotationOrder::RotationOrder(const string& name, int ordinal, const Vector3& axis0, const Vector3& axis1, const Vector3& axis2, int32_t axis0VectorIndex, int32_t axis1VectorIndex, int32_t axis2VectorIndex, int32_t axisXIndex, int32_t axisYIndex, int32_t axisZIndex) : Enum(name, ordinal)
12{
13 this->axis0 = axis0;
14 this->axis1 = axis1;
15 this->axis2 = axis2;
16 this->axis0VectorIndex = axis0VectorIndex;
17 this->axis1VectorIndex = axis1VectorIndex;
18 this->axis2VectorIndex = axis2VectorIndex;
19 this->axisXIndex = axisXIndex;
20 this->axisYIndex = axisYIndex;
21 this->axisZIndex = axisZIndex;
22}
23
24RotationOrder* tdme::engine::model::RotationOrder::XYZ = new RotationOrder("XYZ", 0, Vector3(1.0f, 0.0f, 0.0f), Vector3(0.0f, 1.0f, 0.0f), Vector3(0.0f, 0.0f, 1.0f), 0, 1, 2, 0, 1, 2);
25RotationOrder* tdme::engine::model::RotationOrder::YZX = new RotationOrder("YZX", 1, Vector3(0.0f, 1.0f, 0.0f), Vector3(0.0f, 0.0f, 1.0f), Vector3(1.0f, 0.0f, 0.0f), 1, 2, 0, 2, 0, 1);
26RotationOrder* tdme::engine::model::RotationOrder::ZYX = new RotationOrder("ZYX", 2, Vector3(0.0f, 0.0f, 1.0f), Vector3(0.0f, 1.0f, 0.0f), Vector3(1.0f, 0.0f, 0.0f), 2, 1, 0, 2, 1, 0);
27
29{
30 if (XYZ->getName() == a0) return XYZ;
31 if (YZX->getName() == a0) return YZX;
32 if (ZYX->getName() == a0) return ZYX;
33 // TODO: throw exception here maybe
34 return nullptr;
35}
Represents rotation orders of a model.
Definition: RotationOrder.h:23
static STATIC_DLL_IMPEXT RotationOrder * XYZ
Definition: RotationOrder.h:25
static STATIC_DLL_IMPEXT RotationOrder * YZX
Definition: RotationOrder.h:26
static RotationOrder * valueOf(const string &a0)
static STATIC_DLL_IMPEXT RotationOrder * ZYX
Definition: RotationOrder.h:27
3D vector 3 class
Definition: Vector3.h:22
Enum base class.
Definition: Enum.h:14
const string & getName() const
Definition: Enum.h:30