|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
#include <Transform.h>
Classes | |
| struct | MatrixTransformComponent |
| class | serial |
Public Member Functions | |
| Transform () | |
| Transform (glm::vec3 location) | |
| Transform (glm::vec3 location, glm::vec3 rotation) | |
| Transform (glm::vec3 location, glm::vec3 rotation, glm::vec3 scale) | |
| Transform (glm::mat4 matrix) | |
| Transform (nlohmann::json object) | |
| ~Transform () | |
| glm::mat4 | getInverse () const |
| MatrixTransformComponent | getComponents () const |
| glm::vec3 | getLocation () const |
| void | setLocation (const glm::vec3 &newLocation) |
| glm::vec3 | getRotation () const |
| void | setRotation (const glm::vec3 &newRotationEuler) |
| void | setRotationQuat (glm::quat newQuaternion) |
| glm::quat | getRotationQuat () const |
| glm::vec3 | getScale () const |
| void | setScale (const glm::vec3 &newScale) |
| Transform | matrixToTransform (glm::mat4 matrix) const |
| void | overrideMatrix (glm::mat4 matrix) |
| Transform | combine (const Transform &parent) const |
| glm::mat4 | toMatrix () const |
| std::string | toString () const |
| void | Serialize (nlohmann::json &archive) override |
| void | Deserialize (nlohmann::json &archive) override |
| std::string | getClassName () const override |
| bool | isTransformDirty () const |
| Transform | operator* (const Transform &other) const |
| void | markDirty () const |
| void | markClean () const |
| Public Member Functions inherited from EngineCore::Serializable | |
| virtual | ~Serializable ()=default |
Private Member Functions | |
| MatrixTransformComponent | generateTransformComponentsFromMatrix (const glm::mat4 &matrix) const |
| void | regenerateTransformComponents () const |
Private Attributes | |
| Transform::MatrixTransformComponent | transform_components = {} |
| bool | needsComponentRebuild = true |
| bool | isDirty = true |
| bool | inverseNeedsUpdate = true |
| glm::mat4 | cachedInverse = glm::mat4(1.0f) |
| glm::mat4 | transform = glm::mat4(1.0f) |
Static Private Attributes | |
| static EngineCore::Registrar< Transform > | registrar_Transform |
Friends | |
| class | SceneGraph |
Additional Inherited Members | |
| Static Public Member Functions inherited from EngineCore::Serializable | |
| static std::unique_ptr< Serializable > | create (const std::string &typeName) |
| static nlohmann::json | createDefaultJson (const std::string &typeName) |
| static const std::vector< std::string > & | getRegisteredClasses () |
| Static Public Attributes inherited from EngineCore::Serializable | |
| static const std::string | classNameKey = "ClassName" |
Definition at line 42 of file Transform.h.
|
default |
Referenced by combine(), matrixToTransform(), and operator*().
|
explicit |
Definition at line 19 of file Transform.cpp.
References setLocation().
| EngineCore::Transform::Transform | ( | glm::vec3 | location, |
| glm::vec3 | rotation ) |
Definition at line 24 of file Transform.cpp.
References setLocation(), and setRotation().
| EngineCore::Transform::Transform | ( | glm::vec3 | location, |
| glm::vec3 | rotation, | ||
| glm::vec3 | scale ) |
Definition at line 29 of file Transform.cpp.
References setLocation(), setRotation(), and setScale().
|
explicit |
Definition at line 36 of file Transform.cpp.
References markDirty(), and overrideMatrix().
|
explicit |
Definition at line 42 of file Transform.cpp.
References Deserialize().
|
default |
Definition at line 197 of file Transform.cpp.
References matrixToTransform(), toMatrix(), and Transform().
|
overridevirtual |
Implements EngineCore::Serializable.
Definition at line 237 of file Transform.cpp.
References EngineCore::GlmSerialize::deserialize(), EngineCore::Transform::serial::LOCATION, regenerateTransformComponents(), EngineCore::Transform::serial::ROTATION, EngineCore::Transform::serial::SCALE, setLocation(), setRotationQuat(), and setScale().
Referenced by Transform().
|
private |
Definition at line 65 of file Transform.cpp.
References EngineCore::Transform::MatrixTransformComponent::perspective, EngineCore::Transform::MatrixTransformComponent::rotation, EngineCore::Transform::MatrixTransformComponent::scale, EngineCore::Transform::MatrixTransformComponent::skew, and EngineCore::Transform::MatrixTransformComponent::translation.
Referenced by matrixToTransform(), and regenerateTransformComponents().
|
nodiscardoverridevirtual |
Reimplemented from EngineCore::Serializable.
Definition at line 254 of file Transform.cpp.
| Transform::MatrixTransformComponent EngineCore::Transform::getComponents | ( | ) | const |
Definition at line 93 of file Transform.cpp.
References needsComponentRebuild, regenerateTransformComponents(), and transform_components.
Referenced by getLocation(), getRotation(), getRotationQuat(), getScale(), Serialize(), setRotation(), setRotationQuat(), and setScale().
| glm::mat4 EngineCore::Transform::getInverse | ( | ) | const |
Definition at line 85 of file Transform.cpp.
References cachedInverse, inverseNeedsUpdate, and transform.
|
nodiscard |
Definition at line 104 of file Transform.cpp.
References getComponents(), and EngineCore::Transform::MatrixTransformComponent::translation.
Referenced by toString().
|
nodiscard |
Definition at line 115 of file Transform.cpp.
References getComponents().
Referenced by toString().
| glm::quat EngineCore::Transform::getRotationQuat | ( | ) | const |
Definition at line 138 of file Transform.cpp.
References getComponents(), and EngineCore::Transform::MatrixTransformComponent::rotation.
|
nodiscard |
Definition at line 164 of file Transform.cpp.
References getComponents(), and EngineCore::Transform::MatrixTransformComponent::scale.
Referenced by toString().
| bool EngineCore::Transform::isTransformDirty | ( | ) | const |
Definition at line 258 of file Transform.cpp.
References isDirty.
Referenced by toMatrix().
| void EngineCore::Transform::markClean | ( | ) | const |
Definition at line 274 of file Transform.cpp.
References isDirty.
| void EngineCore::Transform::markDirty | ( | ) | const |
Definition at line 268 of file Transform.cpp.
References inverseNeedsUpdate, isDirty, and needsComponentRebuild.
Referenced by setLocation(), setRotation(), setRotationQuat(), setScale(), and Transform().
| Transform EngineCore::Transform::matrixToTransform | ( | glm::mat4 | matrix | ) | const |
Definition at line 209 of file Transform.cpp.
References generateTransformComponentsFromMatrix(), EngineCore::Transform::MatrixTransformComponent::rotation, EngineCore::Transform::MatrixTransformComponent::scale, Transform(), transform, and EngineCore::Transform::MatrixTransformComponent::translation.
Referenced by combine().
Definition at line 263 of file Transform.cpp.
References toMatrix(), and Transform().
| void EngineCore::Transform::overrideMatrix | ( | glm::mat4 | matrix | ) |
Definition at line 220 of file Transform.cpp.
References transform.
Referenced by Transform().
|
private |
Definition at line 80 of file Transform.cpp.
References generateTransformComponentsFromMatrix(), needsComponentRebuild, transform, and transform_components.
Referenced by Deserialize(), getComponents(), and toMatrix().
|
overridevirtual |
Reimplemented from EngineCore::Serializable.
Definition at line 230 of file Transform.cpp.
References getComponents(), EngineCore::Transform::serial::LOCATION, EngineCore::Transform::serial::ROTATION, EngineCore::Transform::serial::SCALE, EngineCore::GlmSerialize::Serialize(), and EngineCore::Serializable::Serialize().
| void EngineCore::Transform::setLocation | ( | const glm::vec3 & | newLocation | ) |
Definition at line 109 of file Transform.cpp.
References markDirty(), and transform.
Referenced by Deserialize(), Transform(), Transform(), and Transform().
| void EngineCore::Transform::setRotation | ( | const glm::vec3 & | newRotationEuler | ) |
Definition at line 143 of file Transform.cpp.
References getComponents(), markDirty(), EngineCore::Transform::MatrixTransformComponent::scale, transform, and EngineCore::Transform::MatrixTransformComponent::translation.
Referenced by Transform(), and Transform().
| void EngineCore::Transform::setRotationQuat | ( | glm::quat | newQuaternion | ) |
Definition at line 120 of file Transform.cpp.
References getComponents(), markDirty(), EngineCore::Transform::MatrixTransformComponent::scale, transform, and EngineCore::Transform::MatrixTransformComponent::translation.
Referenced by Deserialize().
| void EngineCore::Transform::setScale | ( | const glm::vec3 & | newScale | ) |
Definition at line 169 of file Transform.cpp.
References getComponents(), markDirty(), EngineCore::Transform::MatrixTransformComponent::rotation, transform, and EngineCore::Transform::MatrixTransformComponent::translation.
Referenced by Deserialize(), and Transform().
|
nodiscard |
Definition at line 187 of file Transform.cpp.
References isTransformDirty(), regenerateTransformComponents(), TRACY_ZONE_SCOPED_FUNCTION, and transform.
Referenced by combine(), and operator*().
|
nodiscard |
Definition at line 224 of file Transform.cpp.
References getLocation(), getRotation(), and getScale().
|
friend |
|
mutableprivate |
Definition at line 74 of file Transform.h.
Referenced by getInverse().
|
mutableprivate |
Definition at line 69 of file Transform.h.
Referenced by getInverse(), and markDirty().
|
mutableprivate |
Definition at line 68 of file Transform.h.
Referenced by isTransformDirty(), markClean(), and markDirty().
|
mutableprivate |
Definition at line 67 of file Transform.h.
Referenced by getComponents(), markDirty(), and regenerateTransformComponents().
|
inlinestaticprivate |
Definition at line 121 of file Transform.h.
|
private |
Definition at line 119 of file Transform.h.
Referenced by getInverse(), matrixToTransform(), overrideMatrix(), regenerateTransformComponents(), setLocation(), setRotation(), setRotationQuat(), setScale(), and toMatrix().
|
mutableprivate |
Definition at line 66 of file Transform.h.
Referenced by getComponents(), and regenerateTransformComponents().