|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Unified transform component. More...
#include <Transform.hpp>
Public Member Functions | |
| void | ensureDecomposed () |
| bool | auditSame (const Transform &kept) const |
What the change audit takes as unchanged since kept (Registry::auditChanges). | |
| Transform ()=default | |
| Transform (const glm::vec3 &pos) | |
| Transform (const glm::vec3 &pos, const glm::quat &rot) | |
| Transform (const glm::vec3 &pos, const glm::quat &rot, const glm::vec3 &scl) | |
Public Attributes | |
| glm::vec3 | position {0.0f, 0.0f, 0.0f} |
| glm::quat | rotation {1.0f, 0.0f, 0.0f, 0.0f} |
| glm::vec3 | scale {1.0f, 1.0f, 1.0f} |
| glm::vec3 | worldPosition {0.0f, 0.0f, 0.0f} |
| glm::quat | worldRotation {1.0f, 0.0f, 0.0f, 0.0f} |
| glm::vec3 | worldScale {1.0f, 1.0f, 1.0f} |
| bool | decomposed_ = true |
| glm::mat4 | cachedMatrix_ {std::numeric_limits<f32>::quiet_NaN()} |
Unified transform component.
Contains both local (relative to parent) and world-space transforms. Local fields (position, rotation, scale) are user-controlled. World fields (worldPosition, worldRotation, worldScale) are computed by TransformSystem each frame.
Definition at line 45 of file Transform.hpp.
|
default |
Referenced by auditSame().
|
inlineexplicit |
Definition at line 95 of file Transform.hpp.
References position.
|
inline |
Definition at line 97 of file Transform.hpp.
|
inline |
Definition at line 100 of file Transform.hpp.
|
inline |
What the change audit takes as unchanged since kept (Registry::auditChanges).
The local fields and the world matrix, bit for bit. The world fields too, except where they were filled in since: ensureDecomposed() reads them out of a matrix that did not change, which is a read made lazily, not a write. Fields that differ under the same matrix, both already filled, were written.
Definition at line 82 of file Transform.hpp.
References Transform(), cachedMatrix_, decomposed_, position, rotation, scale, worldPosition, worldRotation, and worldScale.
|
inline |
Definition at line 69 of file Transform.hpp.
References cachedMatrix_, esengine::math::decompose(), decomposed_, worldPosition, worldRotation, and worldScale.
Referenced by esengine::ParticlePlugin::collect(), esengine::TrailPlugin::collect(), esengine::UIElementPlugin::collect(), EMSCRIPTEN_BINDINGS(), esengine::ecs::hasFlatGeometryArea(), esengine::ecs::UISystem::hitTestUpdate(), esengine::lightForward(), esengine::parallaxedWorldPosition(), esengine::ecs::UISystem::pickAll(), esengine::registry_readWorldPoses2D(), esengine::renderer_entityVisibleToCamera(), esengine::renderer_submitSkeletalBatchByEntityEx(), esengine::particle::ParticleSystem::update(), esengine::springbone::SpringBoneSystem::update(), and esengine::trail::TrailSystem::update().
| glm::mat4 esengine::ecs::Transform::cachedMatrix_ {std::numeric_limits<f32>::quiet_NaN()} |
Definition at line 67 of file Transform.hpp.
Referenced by auditSame(), ensureDecomposed(), esengine::ecs::hasFlatGeometryArea(), and esengine::ecs::pointInTransformedBox().
| bool esengine::ecs::Transform::decomposed_ = true |
Definition at line 66 of file Transform.hpp.
Referenced by auditSame(), and ensureDecomposed().
| glm::vec3 esengine::ecs::Transform::position {0.0f, 0.0f, 0.0f} |
Definition at line 47 of file Transform.hpp.
Referenced by Transform(), Transform(), Transform(), auditSame(), EMSCRIPTEN_BINDINGS(), and esengine::renderer_renderMeshPreview().
| glm::quat esengine::ecs::Transform::rotation {1.0f, 0.0f, 0.0f, 0.0f} |
Definition at line 50 of file Transform.hpp.
Referenced by Transform(), Transform(), auditSame(), and EMSCRIPTEN_BINDINGS().
| glm::vec3 esengine::ecs::Transform::scale {1.0f, 1.0f, 1.0f} |
Definition at line 53 of file Transform.hpp.
Referenced by Transform(), auditSame(), and EMSCRIPTEN_BINDINGS().
| glm::vec3 esengine::ecs::Transform::worldPosition {0.0f, 0.0f, 0.0f} |
Definition at line 56 of file Transform.hpp.
Referenced by auditSame(), EMSCRIPTEN_BINDINGS(), ensureDecomposed(), esengine::parallaxedWorldPosition(), and esengine::ecs::pointInTransformedBox().
| glm::quat esengine::ecs::Transform::worldRotation {1.0f, 0.0f, 0.0f, 0.0f} |
Definition at line 59 of file Transform.hpp.
Referenced by auditSame(), esengine::particle::ParticleSystem::emitAt(), EMSCRIPTEN_BINDINGS(), ensureDecomposed(), esengine::lightForward(), and esengine::ecs::pointInTransformedBox().
| glm::vec3 esengine::ecs::Transform::worldScale {1.0f, 1.0f, 1.0f} |
Definition at line 62 of file Transform.hpp.
Referenced by auditSame(), EMSCRIPTEN_BINDINGS(), ensureDecomposed(), esengine::ecs::hasFlatGeometryArea(), and esengine::ecs::pointInTransformedBox().