Struct containing transform data and methods. More...
#include <BasicComponents.hpp>
Public Member Functions | |
| TransformComponent (const TransformComponent &other) | |
| Copy Constructor. Copies all data members and maintains the reference to the same registry. | |
| TransformComponent & | operator= (const TransformComponent &other) |
| Copy Assignment Operator. Copies all data members and maintains the reference to the same registry. | |
| TransformComponent (vex::Registry ®istry) | |
| Constructor 1: Registry only. | |
| TransformComponent (vex::Registry ®istry, glm::vec3 pos, vex::Entity p=vex::NULL_ENTITY) | |
| Constructor 2: Registry, Position, (optional Parent). | |
| TransformComponent (vex::Registry ®istry, glm::vec3 pos, glm::vec3 rot, vex::Entity p=vex::NULL_ENTITY) | |
| Constructor 3: Registry, Position, Rotation (Euler degrees), (optional Parent). | |
| TransformComponent (vex::Registry ®istry, glm::vec3 pos, glm::vec3 rot, glm::vec3 s, vex::Entity p=vex::NULL_ENTITY) | |
| Constructor 4: Registry, Position, Rotation (Euler degrees), Scale, (optional Parent). | |
| TransformComponent (vex::Registry ®istry, vex::Entity p) | |
| Constructor 5: Registry, Parent only (useful for empty child objects). | |
| TransformComponent ()=default | |
| Default constructor is deleted since registry is required. | |
| bool | isDirty () |
| void | setRegistry (vex::Registry ®) |
| bool | isReady () const |
| void | setParent (vex::Entity newParent) |
| Set the parent entity. | |
| vex::Entity | getParent () const |
| Get the parent entity. | |
| glm::vec3 | getLocalPosition () const |
| Get the local position. | |
| glm::vec3 | getLocalRotation () const |
| Get the local rotation (as Euler angles in degrees). | |
| glm::vec3 | getLocalScale () const |
| Get the local scale. | |
| void | setLocalPosition (glm::vec3 newPosition) |
| Set the local position. | |
| void | setLocalRotation (glm::vec3 newRotation) |
| Set the local rotation (using Euler angles in degrees). | |
| void | setLocalScale (glm::vec3 newScale) |
| Set the local scale. | |
| glm::quat | getWorldQuaternion () const |
| Method to get the world rotation as a quaternion. | |
| void | setWorldQuaternion (glm::quat targetWorldQuat) |
| Method to set world rotation using a quaternion (for physics systems). | |
| void | setWorldQuaternionPhys (glm::quat targetWorldQuat) |
| Method to set world rotation using a quaternion (for physics systems). | |
| glm::quat | getLocalQuaternion () const |
| Get the local rotation as a quaternion directly. | |
| void | setLocalQuaternion (glm::quat newRotation) |
| Set the local rotation using a quaternion directly. | |
| void | addLocalQuaternion (glm::quat deltaRotation) |
| Multiply a delta quaternion into the current local rotation. | |
| glm::mat4 | recalculateMatrix () |
| glm::mat4 | matrix (bool forceRecalculate=false) |
| Method used by renderer to calculate the transformation matrix. | |
| glm::vec3 | getWorldPosition () |
| Method to get world position, needed when object is parented as position parameter stores local position. | |
| glm::vec3 | getWorldRotation () |
| Method to get world rotation, needed when object is parented as rotation parameter stores local rotation. | |
| glm::vec3 | getWorldScale () |
| Method to get world scale, needed when object is parented as scale parameter stores local scale. | |
| void | setWorldPosition (glm::vec3 newPosition) |
| Method to set world position, needed when object is parented as position parameter stores local position. | |
| void | setWorldPositionPhys (glm::vec3 newPosition) |
| Method to set world position by physics component. | |
| void | setWorldRotation (glm::vec3 newRotation) |
| Method to set world rotation, needed when object is parented as rotation parameter stores local rotation. | |
| void | setWorldScale (glm::vec3 newScale) |
| Method to set world scale, needed when object is parented as rotation parameter stores local rotation. | |
| void | addLocalPosition (glm::vec3 newPosition) |
| Method to add local position. | |
| void | addLocalRotation (glm::vec3 newRotation) |
| Method to add local rotation (Euler angles in degrees). | |
| void | addLocalScale (glm::vec3 newScale) |
| Method to add local scale. | |
| void | addPitch (float deltaPitch) |
| Method to add to the local pitch (rotation around X-axis). | |
| void | addYaw (float deltaYaw) |
| Method to add to the local yaw (rotation around Y-axis). | |
| void | addRoll (float deltaRoll) |
| Method to add to the local roll (rotation around Z-axis). | |
| glm::vec3 | getForwardVector () |
| glm::vec3 | getRightVector () |
| Method to get normalized right vector. | |
| glm::vec3 | getUpVector () |
| Method to get normalized up vector. | |
Private Attributes | |
| glm::vec3 | position = {0.0f, 0.0f, 0.0f} |
| glm::quat | m_rotationQuat = glm::quat(1.0f, 0.0f, 0.0f, 0.0f) |
| glm::vec3 | scale = {1.0f, 1.0f, 1.0f} |
| vex::Entity | parent = vex::NULL_ENTITY |
| bool | lastTransformed = true |
| vex::Registry * | m_registry = nullptr |
| bool | physicsAffected = false |
| glm::mat4 | cachedMatrix = glm::mat4(1.0f) |
| bool | dirty = true |
Struct containing transform data and methods.
Definition at line 33 of file BasicComponents.hpp.
|
inline |
Copy Constructor. Copies all data members and maintains the reference to the same registry.
Definition at line 58 of file BasicComponents.hpp.
|
inline |
Constructor 1: Registry only.
Definition at line 78 of file BasicComponents.hpp.
|
inline |
Constructor 2: Registry, Position, (optional Parent).
Definition at line 82 of file BasicComponents.hpp.
|
inline |
Constructor 3: Registry, Position, Rotation (Euler degrees), (optional Parent).
Definition at line 86 of file BasicComponents.hpp.
|
inline |
Constructor 4: Registry, Position, Rotation (Euler degrees), Scale, (optional Parent).
Definition at line 90 of file BasicComponents.hpp.
|
inline |
Constructor 5: Registry, Parent only (useful for empty child objects).
Definition at line 94 of file BasicComponents.hpp.
|
inline |
Method to add local position.
| newPosition | glm::vec3 |
Definition at line 328 of file BasicComponents.hpp.
|
inline |
Multiply a delta quaternion into the current local rotation.
Definition at line 223 of file BasicComponents.hpp.
|
inline |
Method to add local rotation (Euler angles in degrees).
| newRotation | glm::vec3 |
Definition at line 335 of file BasicComponents.hpp.
|
inline |
Method to add local scale.
| newScale | glm::vec3 |
Definition at line 344 of file BasicComponents.hpp.
|
inline |
Method to add to the local pitch (rotation around X-axis).
| deltaPitch | float The amount to add in degrees. |
Definition at line 351 of file BasicComponents.hpp.
|
inline |
Method to add to the local roll (rotation around Z-axis).
| deltaRoll | float The amount to add in degrees. |
Definition at line 369 of file BasicComponents.hpp.
|
inline |
Method to add to the local yaw (rotation around Y-axis).
| deltaYaw | float The amount to add in degrees. |
Definition at line 360 of file BasicComponents.hpp.
|
inline |
Definition at line 377 of file BasicComponents.hpp.
|
inline |
Get the local position.
Definition at line 141 of file BasicComponents.hpp.
|
inline |
Get the local rotation as a quaternion directly.
Definition at line 212 of file BasicComponents.hpp.
|
inline |
Get the local rotation (as Euler angles in degrees).
Definition at line 146 of file BasicComponents.hpp.
|
inline |
Get the local scale.
Definition at line 151 of file BasicComponents.hpp.
|
inline |
Get the parent entity.
Definition at line 136 of file BasicComponents.hpp.
|
inline |
Method to get normalized right vector.
Definition at line 383 of file BasicComponents.hpp.
|
inline |
Method to get normalized up vector.
Definition at line 389 of file BasicComponents.hpp.
|
inline |
Method to get world position, needed when object is parented as position parameter stores local position.
Definition at line 257 of file BasicComponents.hpp.
|
inline |
Method to get the world rotation as a quaternion.
Definition at line 176 of file BasicComponents.hpp.
|
inline |
Method to get world rotation, needed when object is parented as rotation parameter stores local rotation.
Definition at line 263 of file BasicComponents.hpp.
|
inline |
Method to get world scale, needed when object is parented as scale parameter stores local scale.
Definition at line 269 of file BasicComponents.hpp.
|
inline |
Definition at line 100 of file BasicComponents.hpp.
|
inline |
Definition at line 119 of file BasicComponents.hpp.
|
inline |
Method used by renderer to calculate the transformation matrix.
| bool | forceRecalculate if force recalculate |
Definition at line 247 of file BasicComponents.hpp.
|
inline |
Copy Assignment Operator. Copies all data members and maintains the reference to the same registry.
Definition at line 67 of file BasicComponents.hpp.
|
inline |
Definition at line 230 of file BasicComponents.hpp.
|
inline |
Set the local position.
Definition at line 156 of file BasicComponents.hpp.
|
inline |
Set the local rotation using a quaternion directly.
Definition at line 217 of file BasicComponents.hpp.
|
inline |
Set the local rotation (using Euler angles in degrees).
Definition at line 162 of file BasicComponents.hpp.
|
inline |
Set the local scale.
Definition at line 168 of file BasicComponents.hpp.
|
inline |
Set the parent entity.
Definition at line 131 of file BasicComponents.hpp.
|
inline |
Definition at line 114 of file BasicComponents.hpp.
|
inline |
Method to set world position, needed when object is parented as position parameter stores local position.
| newPosition | glm::vec3 |
Definition at line 281 of file BasicComponents.hpp.
|
inline |
Method to set world position by physics component.
| newPosition | glm::vec3 |
Definition at line 295 of file BasicComponents.hpp.
|
inline |
Method to set world rotation using a quaternion (for physics systems).
| targetWorldQuat | glm::quat The desired world rotation quaternion. |
Definition at line 185 of file BasicComponents.hpp.
|
inline |
Method to set world rotation using a quaternion (for physics systems).
| targetWorldQuat | glm::quat The desired world rotation quaternion. |
Definition at line 199 of file BasicComponents.hpp.
|
inline |
Method to set world rotation, needed when object is parented as rotation parameter stores local rotation.
| newRotation | glm::vec3 |
Definition at line 309 of file BasicComponents.hpp.
|
inline |
Method to set world scale, needed when object is parented as rotation parameter stores local rotation.
| newScale | glm::vec3 |
Definition at line 316 of file BasicComponents.hpp.
|
private |
Definition at line 53 of file BasicComponents.hpp.
|
private |
Definition at line 54 of file BasicComponents.hpp.
|
private |
Definition at line 50 of file BasicComponents.hpp.
|
private |
Definition at line 51 of file BasicComponents.hpp.
|
private |
Definition at line 47 of file BasicComponents.hpp.
|
private |
Definition at line 49 of file BasicComponents.hpp.
|
private |
Definition at line 52 of file BasicComponents.hpp.
|
private |
Definition at line 46 of file BasicComponents.hpp.
|
private |
Definition at line 48 of file BasicComponents.hpp.