Level H Engine
Public Member Functions | Private Attributes | List of all members
TransformComponent Class Reference

A class that handles the transform component. More...

#include <TransformComponent.h>

Inheritance diagram for TransformComponent:
Inheritance graph
Collaboration diagram for TransformComponent:
Collaboration graph

Public Member Functions

virtual ~TransformComponent ()
 A virtual destructor. More...
 
Vec3 getPos ()
 A function to get the position. More...
 
Vec3 getRotation ()
 A function to get the rotation. More...
 
Vec3 getScale ()
 A function to get the scale. More...
 
void setPos (Vec3 inPos)
 A function to set the position. More...
 
void setRotation (Vec3 inRotation)
 A function to set the rotation. More...
 
void setScale (Vec3 inScaleSize)
 A function to set the scale. More...
 
Mat4 getTransformMat4 ()
 A function to get the transform matrix. More...
 
void rotate (Vec3 angles)
 A function to rotate the component. More...
 
void translate (Vec3 translation)
 A function to translate the component. More...
 
void lookAt (Vec3 worldPosition)
 A function to look at a specific world position. More...
 
void rotateAround (Vec3 center, Vec3 axis, float amount)
 A function to rotate around a specific world point. More...
 
virtual void onAwake ()
 A virtual function for the componets awake. More...
 
virtual void onDestroy ()
 A virtual function for the componets destroy. More...
 
- Public Member Functions inherited from Component
virtual ~Component ()
 A virtual destructor. More...
 
std::weak_ptr< GameObjectgetGameObject ()
 A function to get the game object linked with the component. More...
 
virtual void onUpdate ()
 A virtual function for the componets update. More...
 
virtual void onRender ()
 A virtual function for the componets render. More...
 
void setDestroyed (bool inDestroyed)
 A function to set the componets destroyed boolean. More...
 
bool getDestroyed ()
 A function to get the componets destroyed boolean. More...
 
std::string getID ()
 A function to set the components type ID. More...
 

Private Attributes

Vec3 pos
 The vector transform variables. More...
 
Vec3 rotation
 
Vec3 scaleSize
 

Additional Inherited Members

- Protected Attributes inherited from Component
std::string id
 The ID of the component type. More...
 

Detailed Description

A class that handles the transform component.

Constructor & Destructor Documentation

◆ ~TransformComponent()

TransformComponent::~TransformComponent ( )
virtual

A virtual destructor.

Member Function Documentation

◆ getPos()

Vec3 TransformComponent::getPos ( )
inline

A function to get the position.

Returns
The position of the component.
Here is the caller graph for this function:

◆ getRotation()

Vec3 TransformComponent::getRotation ( )
inline

A function to get the rotation.

Returns
The rotation of the component.
Here is the caller graph for this function:

◆ getScale()

Vec3 TransformComponent::getScale ( )
inline

A function to get the scale.

Returns
The scale of the component.
Here is the caller graph for this function:

◆ getTransformMat4()

Mat4 TransformComponent::getTransformMat4 ( )

A function to get the transform matrix.

Returns
The transform matrix.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookAt()

void TransformComponent::lookAt ( Vec3  worldPosition)

A function to look at a specific world position.

Parameters
worldPositionThe position to look at.
Here is the caller graph for this function:

◆ onAwake()

void TransformComponent::onAwake ( )
virtual

A virtual function for the componets awake.

Reimplemented from Component.

Here is the caller graph for this function:

◆ onDestroy()

void TransformComponent::onDestroy ( )
virtual

A virtual function for the componets destroy.

Reimplemented from Component.

Here is the caller graph for this function:

◆ rotate()

void TransformComponent::rotate ( Vec3  angles)

A function to rotate the component.

Parameters
anglesThe angles of rotation (radians).
Here is the caller graph for this function:

◆ rotateAround()

void TransformComponent::rotateAround ( Vec3  center,
Vec3  axis,
float  amount 
)

A function to rotate around a specific world point.

Parameters
centerThe position to roate around
axisThe axis to roate around.
amountThe amount to roate around.
Here is the caller graph for this function:

◆ setPos()

void TransformComponent::setPos ( Vec3  inPos)
inline

A function to set the position.

Parameters
inPosThe position of the component.
Here is the caller graph for this function:

◆ setRotation()

void TransformComponent::setRotation ( Vec3  inRotation)
inline

A function to set the rotation.

Parameters
inRotationThe rotation of the component.
Here is the caller graph for this function:

◆ setScale()

void TransformComponent::setScale ( Vec3  inScaleSize)
inline

A function to set the scale.

Parameters
inScaleSizeThe scale of the component.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ translate()

void TransformComponent::translate ( Vec3  translation)

A function to translate the component.

Parameters
translationThe amount to translate by.
Here is the caller graph for this function:

Member Data Documentation

◆ pos

Vec3 TransformComponent::pos
private

The vector transform variables.

◆ rotation

Vec3 TransformComponent::rotation
private

◆ scaleSize

Vec3 TransformComponent::scaleSize
private

The documentation for this class was generated from the following files: