Nymph Game Engine
Chaiscript based Game Engine
|
Class for transform. More...
#include <transform.h>
Public Member Functions | |
Transform () | |
Transform Constructor. More... | |
~Transform () | |
Destroys the object. More... | |
bool | operator== (const Transform &other) |
operator == More... | |
bool | operator!= (const Transform &other) |
operator != More... | |
Transform | operator* (const Transform &other) const |
Essentially a matrix multiplication, combines translations, rotations, and scales. More... | |
void | addChild (std::shared_ptr< Transform > transform) |
Adds a child. More... | |
void | removeChild (std::shared_ptr< Transform > transform) |
Removes a child. More... | |
std::list< std::shared_ptr < Transform > > | getChildren () const |
Gets the children. More... | |
std::shared_ptr< Transform > | getParent () const |
Gets the parent. More... | |
unsigned int | getTreeSize () const |
Gets the tree size. More... | |
void | translate (const float x, const float y) noexcept |
Adds 2d translation to Transform. More... | |
void | translate (const float x, const float y, const float z) noexcept |
Adds 3d translation to Transform. More... | |
void | translate (const glm::vec3 &vec) noexcept |
Adds 3d translation. More... | |
void | translate (const glm::vec2 &vec) noexcept |
Adds 2d translation. More... | |
glm::vec3 | getAbsoluteTranslation () const noexcept |
Gets the absolute translation. More... | |
glm::vec3 | getLocalTranslation () const noexcept |
Gets the local translation. More... | |
void | rotate (const float angle_x, const float angle_y, const float angle_z) noexcept |
Rotates this transform using yaw roll pitch/euler angles. More... | |
void | rotate (const glm::vec3 &euler_angles) noexcept |
Rotates using euler angles. More... | |
void | rotate (const glm::quat &quat) noexcept |
Rotates using a quaternion. More... | |
void | rotate (const float angle, const glm::vec3 &axis) noexcept |
Rotates using angle axis. More... | |
glm::quat | getAbsoluteRotation () const noexcept |
Gets the absolute rotation. More... | |
float | getAbsoluteRotationAngle () const noexcept |
Gets the absolute rotation angle. More... | |
glm::vec3 | getAbsoluteRotationAxis () const noexcept |
Gets the absolute rotation axis. More... | |
glm::vec3 | getAbsoluteEulerAngles () const noexcept |
Gets the absolute euler angles. More... | |
glm::quat | getLocalRotation () const noexcept |
Gets the local rotation. More... | |
float | getLocalRotationAngle () const noexcept |
Gets the local rotation angle. More... | |
glm::vec3 | getLocalRotationAxis () const noexcept |
Gets the local rotation axis. More... | |
glm::vec3 | getLocalEulerAngles () const noexcept |
Gets the local euler angles. More... | |
void | scale (const float x) noexcept |
Scales transform in all 3 directions by x. More... | |
void | scale (const float x, const float y) noexcept |
Scales transform in 2d. More... | |
void | scale (const float x, const float y, const float z) noexcept |
Scales transform in 3d. More... | |
void | scale (const glm::vec2 &vec) noexcept |
Scales transform in 2d. More... | |
void | scale (const glm::vec3 &vec) noexcept |
Scales transform in 3d. More... | |
glm::vec3 | getAbsoluteScale () const noexcept |
Gets the absolute scale. More... | |
glm::vec3 | getLocalScale () const noexcept |
Gets the local scale. More... | |
glm::mat4 | getAbsoluteTransformationMatrix () const noexcept |
Gets the absolute transformation matrix. More... | |
glm::mat4 | getLocalTransformationMatrix () const noexcept |
Gets the local transformation matrix. More... | |
std::string | to_string () const noexcept |
Returns a string representation of the object. More... | |
Class for transform.
Transform::Transform | ( | ) |
Transform Constructor.
Referenced by ~Transform().
Transform::~Transform | ( | ) |
Destroys the object.
References Transform().
void Transform::addChild | ( | std::shared_ptr< Transform > | transform | ) |
|
noexcept |
Gets the absolute euler angles.
References getAbsoluteRotation().
Referenced by generated::getTransformModule().
|
noexcept |
Gets the absolute rotation.
Referenced by getAbsoluteEulerAngles(), getAbsoluteRotationAngle(), getAbsoluteRotationAxis(), and generated::getTransformModule().
|
noexcept |
Gets the absolute rotation angle.
References getAbsoluteRotation().
Referenced by generated::getTransformModule(), and to_string().
|
noexcept |
Gets the absolute rotation axis.
References getAbsoluteRotation().
Referenced by generated::getTransformModule(), and to_string().
|
noexcept |
Gets the absolute scale.
Referenced by generated::getTransformModule(), and to_string().
|
noexcept |
Gets the absolute transformation matrix.
References getLocalTransformationMatrix().
Referenced by generated::getTransformModule(), Graphics::Camera::onStart(), Graphics::Camera::onUpdate(), and Graphics::UI::Text::renderCharacter().
|
noexcept |
Gets the absolute translation.
Referenced by generated::getTransformModule(), Graphics::UI::WrappableText::setText(), and to_string().
std::list< std::shared_ptr< Transform > > Transform::getChildren | ( | ) | const |
|
noexcept |
Gets the local euler angles.
Referenced by generated::getTransformModule().
|
noexcept |
|
noexcept |
Gets the local rotation angle.
Referenced by generated::getTransformModule().
|
noexcept |
Gets the local rotation axis.
Referenced by generated::getTransformModule().
|
noexcept |
|
noexcept |
Gets the local transformation matrix.
Referenced by getAbsoluteTransformationMatrix(), and generated::getTransformModule().
|
noexcept |
Gets the local translation.
Referenced by generated::getTransformModule().
std::shared_ptr< Transform > Transform::getParent | ( | ) | const |
unsigned int Transform::getTreeSize | ( | ) | const |
bool Transform::operator!= | ( | const Transform & | other | ) |
operator !=
[in] | other | The other |
Does not take tree properties into account
Essentially a matrix multiplication, combines translations, rotations, and scales.
[in] | other | The other |
bool Transform::operator== | ( | const Transform & | other | ) |
operator ==
[in] | other | The other |
Does not take tree properties into account
void Transform::removeChild | ( | std::shared_ptr< Transform > | transform | ) |
Removes a child.
[in] | transform | The transform |
Referenced by generated::getTransformModule().
|
noexcept |
Rotates this transform using yaw roll pitch/euler angles.
[in] | angle_x | The angle x |
[in] | angle_y | The angle y |
[in] | angle_z | The angle z |
Referenced by generated::getTransformModule().
|
noexcept |
Rotates using euler angles.
[in] | euler_angles | The euler angles |
|
noexcept |
Rotates using a quaternion.
[in] | quat | The quaternion |
|
noexcept |
Rotates using angle axis.
[in] | angle | The angle |
[in] | axis | The axis |
|
noexcept |
Scales transform in all 3 directions by x.
[in] | x |
Referenced by generated::getTransformModule().
|
noexcept |
Scales transform in 2d.
[in] | x | |
[in] | y |
|
noexcept |
Scales transform in 3d.
[in] | x | |
[in] | y | |
[in] | z |
|
noexcept |
Scales transform in 2d.
[in] | vec | The vector |
|
noexcept |
Scales transform in 3d.
[in] | vec | The vector |
|
noexcept |
Returns a string representation of the object.
References getAbsoluteRotationAngle(), getAbsoluteRotationAxis(), getAbsoluteScale(), and getAbsoluteTranslation().
Referenced by generated::getTransformModule().
|
noexcept |
Adds 2d translation to Transform.
[in] | x | |
[in] | y |
Referenced by generated::getTransformModule(), and Graphics::UI::WrappableText::setText().
|
noexcept |
Adds 3d translation to Transform.
[in] | x | |
[in] | y | |
[in] | z |
|
noexcept |
Adds 3d translation.
[in] | vec | The vector |
|
noexcept |
Adds 2d translation.
[in] | vec | The vector |