|
Engine²
Open-source game engine written in C++.
|
#include <Transform.hpp>
Public Member Functions | |
| Transform (glm::vec3 position=glm::vec3(0), glm::vec3 scale=glm::vec3(1), glm::quat rotation=glm::quat(1, 0, 0, 0)) | |
| Transform (const Transform &)=default | |
| Transform (Transform &&)=default | |
| Transform & | operator= (const Transform &)=default |
| Transform & | operator= (Transform &&)=default |
| const glm::vec3 & | GetPosition () const |
| const glm::vec3 & | GetScale () const |
| const glm::quat & | GetRotation () const |
| void | SetPosition (const glm::vec3 &newPosition) |
| void | SetPosition (float x, float y, float z) |
| void | SetScale (const glm::vec3 &newScale) |
| void | SetScale (float x, float y, float z) |
| void | SetRotation (const glm::quat &newRotation) |
| void | SetRotation (float x, float y, float z, float w) |
| glm::vec3 | GetForwardVector () const |
| glm::vec3 | GetRightVector () const |
| glm::vec3 | GetUpVector () const |
| glm::mat4 | ComputeTransformationMatrix () const |
Private Member Functions | |
| glm::mat4 | _BuildTransformationMatrix () const |
Private Attributes | |
| glm::vec3 | _position |
| glm::vec3 | _scale |
| glm::quat | _rotation |
| bool | _dirty = true |
| glm::mat4 | _transformationMatrixCache = glm::mat4(1.0f) |
Component used to represent a 3D transformation for a game object. It can be used as a 2D transformation. This transformation is represented by position, scale, and rotation.
|
inline |
| position | position of the entity. Default is (0, 0, 0). |
| scale | scale of the entity. Default is (1, 1, 1). |
| rotation | rotation of the entity. Default is identity (no rotation). |
|
default |
|
default |
|
inlineprivate |
|
inline |
Create the transformation matrix for this transform component.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
mutableprivate |
|
private |
Position of the entity
|
private |
Rotation of the entity Represents a rotation around the origin, represented as a quaternion.
|
private |
Scale of the entity
|
mutableprivate |