29 Vector3 position = Vector3(0.0);
33 Quaternion rotation = Quaternion(Vector3(0.0));
37 Vector3 scale = Vector3(1.0);
42 template<typename Processor> static constexpr
void reflect(Processor&& RTTI) {
57 void setPosition(const Vector3& position) noexcept;
60 [[nodiscard]] const Quaternion& getRotation() const noexcept;
63 void setRotation(const Quaternion& rotation) noexcept;
66 [[nodiscard]] const Vector3& getScale() const noexcept;
69 void setScale(const Vector3& scale) noexcept;
73 [[nodiscard]] Transform getTransform() const noexcept;
77 void setTransform(const Transform& transform) noexcept;
81 [[nodiscard]] Transform getInverseTransform() const noexcept;
87 [[nodiscard]] Vector3 getDirection() const noexcept {
88 const Matrix3 rotationMatrix = transpose(Matrix3(getRotation()));
89 return normalize(rotationMatrix[2]);
97 void setWorldPosition(const Vector3& position) noexcept;
100 [[nodiscard]] Quaternion getWorldRotation() const noexcept;
103 void setWorldRotation(const Quaternion& rotation) noexcept;
106 [[nodiscard]] Vector3 getWorldScale() const noexcept;
109 void setWorldScale(const Vector3& scale) noexcept;
113 [[nodiscard]] Transform getWorldTransform() const noexcept;
117 void setWorldTransform(const Transform& transform) noexcept;
121 [[nodiscard]] Transform getInverseWorldTransform() const noexcept;
127 [[nodiscard]] Vector3 getWorldDirection() const noexcept {
return getWorldTransform().getDirection(); }
131 void move(
const Vector3& distance);
134 void move(
const Vector3& direction,
double distance);
137 void rotate(
const Quaternion& quaternion);
140 void rotate(
const Vector3& axis,
const Radian& angle);
143 void roll(
const Radian& angle);
146 void yaw(
const Radian& angle);
152 void turn(
const Radian& angle);
167 void lookAt(const Vector3& point) noexcept;
178 Radian getLocalPitch() const noexcept;
182 void setLocalPitch(const Radian& pitch) noexcept;
186 Radian getLocalYaw() const noexcept;
190 void setLocalYaw(const Radian& yaw) noexcept;
194 Radian getLocalRoll() const noexcept;
198 void setLocalRoll(const Radian& roll) noexcept;
202 Radian getWorldPitch() const noexcept;
206 void setWorldPitch(const Radian& pitch) noexcept;
210 Radian getWorldYaw() const noexcept;
214 void setWorldYaw(const Radian& yaw) noexcept;
218 Radian getWorldRoll() const noexcept;
222 void setWorldRoll(const Radian& roll) noexcept;
229 [[nodiscard]] Vector3 toWorld(const Vector3& localVector) const noexcept;
236 Vector3 toLocal(const Vector3& worldVector) const noexcept;
240 [[nodiscard]] Facing getFacing() const noexcept;
244 Vector3 getFront() const noexcept;
248 Vector3 getBack() const noexcept;
252 Vector3 getUp() const noexcept;
256 Vector3 getDown() const noexcept;
260 Vector3 getRight() const noexcept;
264 Vector3 getLeft() const noexcept;
267 [[nodiscard]] Facing getWorldFacing() const noexcept;
271 Vector3 getWorldFront() const noexcept;
275 Vector3 getWorldBack() const noexcept;
279 Vector3 getWorldUp() const noexcept;
283 Vector3 getWorldDown() const noexcept;
287 Vector3 getWorldRight() const noexcept;
291 Vector3 getWorldLeft() const noexcept;
296 template<typename Processor> static constexpr
void reflect(Processor&& RTTI) {
#define CE_EXTERN_COMPONENT(T)
Definition Component.hpp:600
#define CE_ENTITY_OBJECT_HASH(T)
Definition Entity.hpp:784
#define CE_REFLECT_HASH(T)
Definition Hash.hpp:89
#define CE_REFLECTABLE_STRUCT
Definition IReflectable.hpp:47
#define CE_REFL_DATA_GETSET(N, G, S)
Definition Macros.hpp:549
#define CE_REFL_DATA(N)
Definition Macros.hpp:541
#define CE_REFL_DATA_GET(N, G)
Definition Macros.hpp:548
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
A type-safe entity type.
Definition Entity.hpp:538
EntityObject()=default
Creates a new entity object.
static constexpr Facing facingConvention
Definition SceneObject.hpp:329
Definition Application.hpp:19
auto scale(Vector3 scale)
Applies a scale to the entity.
Definition Helpers.hpp:32
auto transform(Container &container, Transform &&transform)
Returns an iterable object that iterates over the values of the container and applies transform to ev...
Definition Iterator.hpp:436
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Components serve as the base for data storage for an entity.
Definition Component.hpp:68