CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::TransformComponent::Accessor Struct Reference

#include <CeresEngine/Scene/SceneObject.hpp>

Inheritance diagram for CeresEngine::TransformComponent::Accessor:
CeresEngine::Component< T >::Accessor

Public Member Functions

const Vector3getPosition () const noexcept
 The entity position. Relative to its parent.
 
void setPosition (const Vector3 &position) noexcept
 The entity position. Relative to its parent.
 
const Quaternion & getRotation () const noexcept
 The entity rotation. Relative to its parent.
 
void setRotation (const Quaternion &rotation) noexcept
 Generates a hash for the provided type.
 
const Vector3getScale () const noexcept
 The entity scale. Relative to its parent.
 
void setScale (const Vector3 &scale) noexcept
 The entity scale. Relative to its parent.
 
Transform getTransform () const noexcept
 Computes the entity local transform.
 
void setTransform (const Transform &transform) noexcept
 Sets the object local transform.
 
Transform getInverseTransform () const noexcept
 Computes the entity inverse local transform.
 
Vector3 getDirection () const noexcept
 Computes the direction vector by applying the rotation to the base forward-facing vector.
 
Vector3 getWorldPosition () const noexcept
 The entity position. Relative to its parent.
 
void setWorldPosition (const Vector3 &position) noexcept
 The entity position. Relative to its parent.
 
Quaternion getWorldRotation () const noexcept
 The entity rotation. Relative to its parent.
 
void setWorldRotation (const Quaternion &rotation) noexcept
 Generates a hash for the provided type.
 
Vector3 getWorldScale () const noexcept
 The entity scale. Relative to its parent.
 
void setWorldScale (const Vector3 &scale) noexcept
 The entity scale. Relative to its parent.
 
Transform getWorldTransform () const noexcept
 Computes the entity world transform.
 
void setWorldTransform (const Transform &transform) noexcept
 Sets the object world transform.
 
Transform getInverseWorldTransform () const noexcept
 Computes the entity inverse world transform.
 
Vector3 getWorldDirection () const noexcept
 Computes the direction vector by applying the rotation to the base forward-facing vector.
 
void move (const Vector3 &distance)
 Moves the object by the given distance.
 
void move (const Vector3 &direction, double distance)
 Moves the object by distance in the given direction.
 
void rotate (const Quaternion &quaternion)
 Rotates the object by the given quaternion.
 
void rotate (const Vector3 &axis, const Radian &angle)
 Rotates the object angle radians on the given axis.
 
void roll (const Radian &angle)
 Rolls the object by angle radians.
 
void yaw (const Radian &angle)
 Yaws the object by angle radians.
 
void pitch (const Radian &angle)
 Pitches the object by angle radians.
 
void turn (const Radian &angle)
 Turns the object by angle radians.
 
void scale (const Vector3 &factor)
 Scales the object by the given factor.
 
void scale (double factor)
 Scales the object on all axes by the given factor.
 
void transform (const Transform &transform)
 Applies the given transform to the object transform.
 
void lookAt (const Vector3 &point) noexcept
 Points the object front facing vector towards the given point.
 
void lookAt (const SceneObject &entity) noexcept
 Points the object front facing vector towards the given entity position.
 
Radian getLocalPitch () const noexcept
 
void setLocalPitch (const Radian &pitch) noexcept
 
Radian getLocalYaw () const noexcept
 
void setLocalYaw (const Radian &yaw) noexcept
 
Radian getLocalRoll () const noexcept
 
void setLocalRoll (const Radian &roll) noexcept
 
Radian getWorldPitch () const noexcept
 
void setWorldPitch (const Radian &pitch) noexcept
 
Radian getWorldYaw () const noexcept
 
void setWorldYaw (const Radian &yaw) noexcept
 
Radian getWorldRoll () const noexcept
 
void setWorldRoll (const Radian &roll) noexcept
 
Vector3 toWorld (const Vector3 &localVector) const noexcept
 Transforms a local coordinates vector localVector into world coordinates.
 
Vector3 toLocal (const Vector3 &worldVector) const noexcept
 Transforms a world coordinates vector worldVector into local coordinates.
 
Facing getFacing () const noexcept
 Returns the scene object facing direction vectors in local space.
 
Vector3 getFront () const noexcept
 The object front facing direction vector in local space.
 
Vector3 getBack () const noexcept
 The object back facing direction vector in local space.
 
Vector3 getUp () const noexcept
 The object up facing direction vector in local space.
 
Vector3 getDown () const noexcept
 The object down facing direction vector in local space.
 
Vector3 getRight () const noexcept
 The object right facing direction vector in local space.
 
Vector3 getLeft () const noexcept
 The object left facing direction vector in local space.
 
Facing getWorldFacing () const noexcept
 Returns the scene object facing direction vectors in world space.
 
Vector3 getWorldFront () const noexcept
 The object front facing direction vector in world space.
 
Vector3 getWorldBack () const noexcept
 The object back facing direction vector in world space.
 
Vector3 getWorldUp () const noexcept
 The object up facing direction vector in world space.
 
Vector3 getWorldDown () const noexcept
 The object down facing direction vector in world space.
 
Vector3 getWorldRight () const noexcept
 The object right facing direction vector in world space.
 
Vector3 getWorldLeft () const noexcept
 The object left facing direction vector in world space.
 
- Public Member Functions inherited from CeresEngine::Component< T >::Accessor
 Accessor (const Entity &entity)
 

Static Public Member Functions

template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 

Additional Inherited Members

- Public Attributes inherited from CeresEngine::Component< T >::Accessor
const Entityentity
 
- Protected Types inherited from CeresEngine::Component< T >::Accessor
using C = TC
 
- Protected Member Functions inherited from CeresEngine::Component< T >::Accessor
template<typename T >
auto mutate (T C::*ptr)
 Accesses an element from an existing Component.
 
template<typename MutatorFunc , typename T >
requires (CInvocable<MutatorFunc, T&>)
decltype(automutate (MutatorFunc &&func, T C::*ptr)
 Accesses an element from an existing Component.
 
template<typename T1 , typename T2 , typename... Ts>
Tuple< ComponentFieldMutator< T1, C >, ComponentFieldMutator< T2, C >, ComponentFieldMutator< Ts, C >... > mutate (T1 C::*ptr1, T2 C::*ptr2, Ts C::*... ptrs)
 TODO Write docs.
 
template<typename MutatorFunc , typename T1 , typename T2 , typename... Ts>
Tuple< ComponentFieldMutator< T1, C >, ComponentFieldMutator< T2, C >, ComponentFieldMutator< Ts, C >... > mutate (MutatorFunc &&func, T1 C::*ptr1, T2 C::*ptr2, Ts C::*... ptr)
 
template<typename T >
auto get (T C::*ptr)
 Accesses an element from an existing Component.
 
template<typename T1 , typename T2 , typename... Ts>
Tuple< ComponentFieldMutator< T1, C >, ComponentFieldMutator< T2, C >, ComponentFieldMutator< Ts, C >... > get (T1 C::*ptr1, T2 C::*ptr2, Ts C::*... ptrs)
 Accesses an element from an existing Component.
 
template<typename T >
const Tread (const T C::*ptr) const
 Accesses an element from an existing Component.
 
template<typename T1 , typename T2 , typename... Ts>
Tuple< const T1 &, const T2 &, const Ts &... > read (const T1 C::*ptr1, const T2 C::*ptr2, const Ts C::*... ptrs) const
 TODO Write docs.
 
template<typename T >
const Tget (const T C::*ptr) const
 Accesses an element from an existing Component.
 
template<typename T1 , typename T2 , typename... Ts>
Tuple< const T1 &, const T2 &, const Ts &... > get (const T1 C::*ptr1, const T2 C::*ptr2, const Ts C::*... ptrs) const
 Accesses an element from an existing Component.
 

Member Function Documentation

◆ getBack()

Vector3 CeresEngine::TransformComponent::Accessor::getBack ( ) const
noexcept

The object back facing direction vector in local space.

◆ getDirection()

Vector3 CeresEngine::TransformComponent::Accessor::getDirection ( ) const
inlinenoexcept

Computes the direction vector by applying the rotation to the base forward-facing vector.

Returns
A unit vector that points to the direction given by the rotation angles.

◆ getDown()

Vector3 CeresEngine::TransformComponent::Accessor::getDown ( ) const
noexcept

The object down facing direction vector in local space.

◆ getFacing()

Facing CeresEngine::TransformComponent::Accessor::getFacing ( ) const
noexcept

Returns the scene object facing direction vectors in local space.

◆ getFront()

Vector3 CeresEngine::TransformComponent::Accessor::getFront ( ) const
noexcept

The object front facing direction vector in local space.

◆ getInverseTransform()

Transform CeresEngine::TransformComponent::Accessor::getInverseTransform ( ) const
noexcept

Computes the entity inverse local transform.

Returns
The entity inverse local transformation matrix.

◆ getInverseWorldTransform()

Transform CeresEngine::TransformComponent::Accessor::getInverseWorldTransform ( ) const
noexcept

Computes the entity inverse world transform.

Returns
The entity inverse world transformation matrix.

◆ getLeft()

Vector3 CeresEngine::TransformComponent::Accessor::getLeft ( ) const
noexcept

The object left facing direction vector in local space.

◆ getLocalPitch()

Radian CeresEngine::TransformComponent::Accessor::getLocalPitch ( ) const
noexcept
Returns
The object pitch angle (rotation along the X axis)

◆ getLocalRoll()

Radian CeresEngine::TransformComponent::Accessor::getLocalRoll ( ) const
noexcept
Returns
The object roll angle (rotation along the Z axis)

◆ getLocalYaw()

Radian CeresEngine::TransformComponent::Accessor::getLocalYaw ( ) const
noexcept
Returns
The object yaw angle (rotation along the Y axis)

◆ getPosition()

const Vector3 & CeresEngine::TransformComponent::Accessor::getPosition ( ) const
noexcept

The entity position. Relative to its parent.

◆ getRight()

Vector3 CeresEngine::TransformComponent::Accessor::getRight ( ) const
noexcept

The object right facing direction vector in local space.

◆ getRotation()

const Quaternion & CeresEngine::TransformComponent::Accessor::getRotation ( ) const
noexcept

The entity rotation. Relative to its parent.

◆ getScale()

const Vector3 & CeresEngine::TransformComponent::Accessor::getScale ( ) const
noexcept

The entity scale. Relative to its parent.

◆ getTransform()

Transform CeresEngine::TransformComponent::Accessor::getTransform ( ) const
noexcept

Computes the entity local transform.

Returns
The entity local transformation matrix.

◆ getUp()

Vector3 CeresEngine::TransformComponent::Accessor::getUp ( ) const
noexcept

The object up facing direction vector in local space.

◆ getWorldBack()

Vector3 CeresEngine::TransformComponent::Accessor::getWorldBack ( ) const
noexcept

The object back facing direction vector in world space.

◆ getWorldDirection()

Vector3 CeresEngine::TransformComponent::Accessor::getWorldDirection ( ) const
inlinenoexcept

Computes the direction vector by applying the rotation to the base forward-facing vector.

Returns
A unit vector that points to the direction given by the rotation angles

◆ getWorldDown()

Vector3 CeresEngine::TransformComponent::Accessor::getWorldDown ( ) const
noexcept

The object down facing direction vector in world space.

◆ getWorldFacing()

Facing CeresEngine::TransformComponent::Accessor::getWorldFacing ( ) const
noexcept

Returns the scene object facing direction vectors in world space.

◆ getWorldFront()

Vector3 CeresEngine::TransformComponent::Accessor::getWorldFront ( ) const
noexcept

The object front facing direction vector in world space.

◆ getWorldLeft()

Vector3 CeresEngine::TransformComponent::Accessor::getWorldLeft ( ) const
noexcept

The object left facing direction vector in world space.

◆ getWorldPitch()

Radian CeresEngine::TransformComponent::Accessor::getWorldPitch ( ) const
noexcept
Returns
The object pitch angle (rotation along the X axis)

◆ getWorldPosition()

Vector3 CeresEngine::TransformComponent::Accessor::getWorldPosition ( ) const
noexcept

The entity position. Relative to its parent.

◆ getWorldRight()

Vector3 CeresEngine::TransformComponent::Accessor::getWorldRight ( ) const
noexcept

The object right facing direction vector in world space.

◆ getWorldRoll()

Radian CeresEngine::TransformComponent::Accessor::getWorldRoll ( ) const
noexcept
Returns
The object roll angle (rotation along the Z axis)

◆ getWorldRotation()

Quaternion CeresEngine::TransformComponent::Accessor::getWorldRotation ( ) const
noexcept

The entity rotation. Relative to its parent.

◆ getWorldScale()

Vector3 CeresEngine::TransformComponent::Accessor::getWorldScale ( ) const
noexcept

The entity scale. Relative to its parent.

◆ getWorldTransform()

Transform CeresEngine::TransformComponent::Accessor::getWorldTransform ( ) const
noexcept

Computes the entity world transform.

Returns
The entity world transformation matrix.

◆ getWorldUp()

Vector3 CeresEngine::TransformComponent::Accessor::getWorldUp ( ) const
noexcept

The object up facing direction vector in world space.

◆ getWorldYaw()

Radian CeresEngine::TransformComponent::Accessor::getWorldYaw ( ) const
noexcept
Returns
The object yaw angle (rotation along the Y axis)

◆ lookAt() [1/2]

void CeresEngine::TransformComponent::Accessor::lookAt ( const SceneObject entity)
noexcept

Points the object front facing vector towards the given entity position.

Parameters
entityThe entity to look at.

◆ lookAt() [2/2]

void CeresEngine::TransformComponent::Accessor::lookAt ( const Vector3 point)
noexcept

Points the object front facing vector towards the given point.

Parameters
pointThe point to look at in world space.

◆ move() [1/2]

void CeresEngine::TransformComponent::Accessor::move ( const Vector3 direction,
double  distance 
)

Moves the object by distance in the given direction.

◆ move() [2/2]

void CeresEngine::TransformComponent::Accessor::move ( const Vector3 distance)

Moves the object by the given distance.

◆ pitch()

void CeresEngine::TransformComponent::Accessor::pitch ( const Radian &  angle)

Pitches the object by angle radians.

◆ reflect()

template<typename Processor >
static constexpr void CeresEngine::TransformComponent::Accessor::reflect ( Processor &&  RTTI)
inlinestaticconstexpr

Executes the given processor for every field of the struct.

Parameters
RTTIThe processor to be ran for every field.

◆ roll()

void CeresEngine::TransformComponent::Accessor::roll ( const Radian &  angle)

Rolls the object by angle radians.

◆ rotate() [1/2]

void CeresEngine::TransformComponent::Accessor::rotate ( const Quaternion &  quaternion)

Rotates the object by the given quaternion.

◆ rotate() [2/2]

void CeresEngine::TransformComponent::Accessor::rotate ( const Vector3 axis,
const Radian &  angle 
)

Rotates the object angle radians on the given axis.

◆ scale() [1/2]

void CeresEngine::TransformComponent::Accessor::scale ( const Vector3 factor)

Scales the object by the given factor.

◆ scale() [2/2]

void CeresEngine::TransformComponent::Accessor::scale ( double  factor)

Scales the object on all axes by the given factor.

◆ setLocalPitch()

void CeresEngine::TransformComponent::Accessor::setLocalPitch ( const Radian &  pitch)
noexcept
Parameters
pitchThe object pitch angle (rotation along the X axis)

◆ setLocalRoll()

void CeresEngine::TransformComponent::Accessor::setLocalRoll ( const Radian &  roll)
noexcept
Parameters
rollThe object roll angle (rotation along the Z axis)

◆ setLocalYaw()

void CeresEngine::TransformComponent::Accessor::setLocalYaw ( const Radian &  yaw)
noexcept
Parameters
yawThe object yaw angle (rotation along the Y axis)

◆ setPosition()

void CeresEngine::TransformComponent::Accessor::setPosition ( const Vector3 position)
noexcept

The entity position. Relative to its parent.

◆ setRotation()

void CeresEngine::TransformComponent::Accessor::setRotation ( const Quaternion &  rotation)
noexcept

Generates a hash for the provided type.

Type must have a std::hash specialization.

Template Parameters
Tthe type to be hashed
Parameters
vThe value to be hashed
Returns
The hashed value

◆ setScale()

void CeresEngine::TransformComponent::Accessor::setScale ( const Vector3 scale)
noexcept

The entity scale. Relative to its parent.

◆ setTransform()

void CeresEngine::TransformComponent::Accessor::setTransform ( const Transform transform)
noexcept

Sets the object local transform.

Parameters
transformThe object's local transform.

◆ setWorldPitch()

void CeresEngine::TransformComponent::Accessor::setWorldPitch ( const Radian &  pitch)
noexcept
Parameters
pitchThe object pitch angle (rotation along the X axis)

◆ setWorldPosition()

void CeresEngine::TransformComponent::Accessor::setWorldPosition ( const Vector3 position)
noexcept

The entity position. Relative to its parent.

◆ setWorldRoll()

void CeresEngine::TransformComponent::Accessor::setWorldRoll ( const Radian &  roll)
noexcept
Parameters
rollThe object roll angle (rotation along the Z axis)

◆ setWorldRotation()

void CeresEngine::TransformComponent::Accessor::setWorldRotation ( const Quaternion &  rotation)
noexcept

Generates a hash for the provided type.

Type must have a std::hash specialization.

Template Parameters
Tthe type to be hashed
Parameters
vThe value to be hashed
Returns
The hashed value

◆ setWorldScale()

void CeresEngine::TransformComponent::Accessor::setWorldScale ( const Vector3 scale)
noexcept

The entity scale. Relative to its parent.

◆ setWorldTransform()

void CeresEngine::TransformComponent::Accessor::setWorldTransform ( const Transform transform)
noexcept

Sets the object world transform.

Parameters
transformThe object's world transform.

◆ setWorldYaw()

void CeresEngine::TransformComponent::Accessor::setWorldYaw ( const Radian &  yaw)
noexcept
Parameters
yawThe object yaw angle (rotation along the Y axis)

◆ toLocal()

Vector3 CeresEngine::TransformComponent::Accessor::toLocal ( const Vector3 worldVector) const
noexcept

Transforms a world coordinates vector worldVector into local coordinates.

Parameters
worldVectorThe world vector to be transformed
Returns
The transformed (in local coordinates) vector

◆ toWorld()

Vector3 CeresEngine::TransformComponent::Accessor::toWorld ( const Vector3 localVector) const
noexcept

Transforms a local coordinates vector localVector into world coordinates.

Parameters
localVectorThe local vector to be transformed
Returns
The transformed (in world coordinates) vector

◆ transform()

void CeresEngine::TransformComponent::Accessor::transform ( const Transform transform)

Applies the given transform to the object transform.

◆ turn()

void CeresEngine::TransformComponent::Accessor::turn ( const Radian &  angle)

Turns the object by angle radians.

◆ yaw()

void CeresEngine::TransformComponent::Accessor::yaw ( const Radian &  angle)

Yaws the object by angle radians.


The documentation for this struct was generated from the following file: