SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::core::components::Transform Class Referencefinal

A component that stores the position of a game object. More...

#include <Transform.h>

Inheritance diagram for spark::core::components::Transform:
spark::core::Component spark::rtti::HasRtti

Public Member Functions

 Transform (GameObject *parent)
 
glm::mat4 matrix () const
 Gets the transformation matrix of the transform.
 
- Public Member Functions inherited from spark::core::Component
 Component (GameObject *parent)
 Instantiates a new Component.
 
 Component (const Component &other)=delete
 
 Component (Component &&other) noexcept=default
 
Componentoperator= (const Component &other)=delete
 
Componentoperator= (Component &&other) noexcept=default
 
const lib::Uuiduuid () const
 Gets the UUID of the component.
 
GameObjectgameObject ()
 Gets the GameObject that the component is attached to.
 
const GameObjectgameObject () const
 Gets the GameObject that the component is attached to.
 
virtual void render () const
 Renders the component.
 
virtual void onAttach ()
 Method called when the component is attached to a GameObject.
 
virtual void onUpdate (float dt)
 Method called on every frame.
 
virtual void onDetach ()
 Method called when the component is detached from a GameObject.
 
- Public Member Functions inherited from spark::rtti::HasRtti
 HasRtti (const HasRtti &other)=default
 
 HasRtti (HasRtti &&other) noexcept=default
 
HasRttioperator= (const HasRtti &other)=default
 
HasRttioperator= (HasRtti &&other) noexcept=default
 
virtual RttiBaserttiInstance () const =0
 

Public Attributes

math::Vector2< float > position = {0.f, 0.f}
 
float rotation = 0
 
math::Vector2< float > scale = {1.f, 1.f}
 

Friends

bool operator== (const Transform &lhs, const Transform &rhs)
 
bool operator!= (const Transform &lhs, const Transform &rhs)
 

Detailed Description

A component that stores the position of a game object.

Member Function Documentation

◆ matrix()

glm::mat4 spark::core::components::Transform::matrix ( ) const
inline

Gets the transformation matrix of the transform.

Returns
A glm::mat4 representing the transformation matrix.