Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
rune::Transform Class Reference

A data structure that contains position, size, and rotation. More...

#include <transform.h>

Inheritance diagram for rune::Transform:
Collaboration diagram for rune::Transform:

Public Member Functions

 Transform (rune::Vec3 newPosition=rune::Vec3(0, 0, 0), rune::Vec3 newScale=rune::Vec3(1, 1, 1), rune::Vec3 newRotation=rune::Vec3(0, 0, 0))
 Default constructor. More...
 
virtual void update () override
 Override of the update component function to update the position of the transform if there is a parent Transform.
 
void setScale (rune::Vec3)
 Set the scale vector. More...
 
void setScaleX (double)
 Set the X scale. More...
 
void setScaleY (double)
 Set the Y scale. More...
 
void setScaleZ (double)
 Set the Z scale. More...
 
void setPosition (rune::Vec3)
 Set the position vector. More...
 
void setPositionX (double)
 Set the X position. More...
 
void setPositionY (double)
 Set the Y position. More...
 
void setPositionZ (double)
 Set the Z position. More...
 
void setRotation (rune::Vec3)
 Set the rotation vector. More...
 
void setRotationX (double)
 Set the X rotation. More...
 
void setRotationY (double)
 Set the Y rotation. More...
 
void setRotationZ (double)
 Set the Z rotation. More...
 
void setLocalPosition (rune::Vec3 newLocalPosition)
 Set the position of the transform relative to the transform parent. More...
 
rune::Vec3 getPosition (void)
 Get the position of the transform in world coordinates. More...
 
rune::Vec3 getScale (void)
 Get the scale factor of the transform. More...
 
rune::Vec3 getRotation (void)
 Get the rotation vector of the transform. More...
 
rune::Vec3 getLocalPosition (void)
 Get the position of the transform with respect to the parent object. More...
 
void setBounds (rune::Vec2 newBounds)
 Set the boundaries of the current renderer. More...
 
rune::Vec2 getBounds (void)
 Get the boundaries of the current renderer. More...
 
- Public Member Functions inherited from rune::Component
 Component ()=default
 Default constructor to set up.
 
virtual void awake ()
 A function that will be called before all other start functions but after the component has been assigned to a GameObject.
 
virtual void start ()
 A function for each component that is called once at the beginning of the components lifetime.
 
virtual void fixedUpdate ()
 A function for each component that is called once every physics update.
 
void setParent (GameObject *newParent)
 A function to set the pointer to the parent rune::GameObject for each component. More...
 
void setEnable (bool newEnable)
 Enable or disable the component. More...
 
bool isComponentEnabled (void)
 Gets whether or not the current component is enabled.
 
void onNotify (Signal const &signal) override
 A virtual method to be overridden by a concrete implementation of the observer class.
 

Public Attributes

TransformparentTransform = nullptr
 Pointer to parent object.
 

Additional Inherited Members

- Protected Attributes inherited from rune::Component
GameObjectparentObject = nullptr
 The rune::GameObject that this component is attached to. If not attached to a rune::GameObject this will equal nullptr.
 
bool isEnabled = true
 Whether or not the component is currently enabled. If not enabled, update function will not be called.
 

Detailed Description

A data structure that contains position, size, and rotation.

Author
Thomas Montano
Date
June 9 2020

Constructor & Destructor Documentation

◆ Transform()

rune::Transform::Transform ( rune::Vec3  newPosition = rune::Vec3(0,0,0),
rune::Vec3  newScale = rune::Vec3(1,1,1),
rune::Vec3  newRotation = rune::Vec3(0,0,0) 
)

Default constructor.

Parameters
newPositionThe position of the Transform.
newScaleThe scale of the Transform.
newRotationthe rotation of the Transform.

Member Function Documentation

◆ getBounds()

rune::Vec2 rune::Transform::getBounds ( void  )

Get the boundaries of the current renderer.

Returns
The boundary of the Transform in pixel coordinates.

◆ getLocalPosition()

rune::Vec3 rune::Transform::getLocalPosition ( void  )

Get the position of the transform with respect to the parent object.

Returns
The position of the Transform with respect to the parent Transform.

◆ getPosition()

rune::Vec3 rune::Transform::getPosition ( void  )

Get the position of the transform in world coordinates.

Returns
The position vector of the Transform.

◆ getRotation()

rune::Vec3 rune::Transform::getRotation ( void  )

Get the rotation vector of the transform.

Returns
The rotation of the Transform.

◆ getScale()

rune::Vec3 rune::Transform::getScale ( void  )

Get the scale factor of the transform.

Returns
The scale of the Transform.

◆ setBounds()

void rune::Transform::setBounds ( rune::Vec2  newBounds)

Set the boundaries of the current renderer.

Parameters
newBoundsThe new boundary of the Transform.

◆ setLocalPosition()

void rune::Transform::setLocalPosition ( rune::Vec3  newLocalPosition)

Set the position of the transform relative to the transform parent.

Parameters
newLocalPositionThe new position of the Transform with respect to the parent Transform.

◆ setPosition()

void rune::Transform::setPosition ( rune::Vec3  newPosition)

Set the position vector.

Parameters
newPositionThe new position vector of the Transform.

◆ setPositionX()

void rune::Transform::setPositionX ( double  newX)

Set the X position.

Parameters
newXThe new X position of the Transform.

◆ setPositionY()

void rune::Transform::setPositionY ( double  newY)

Set the Y position.

Parameters
newYThe new Y position of the Transform.

◆ setPositionZ()

void rune::Transform::setPositionZ ( double  newZ)

Set the Z position.

Parameters
newZThe new Z position of the Transform.

◆ setRotation()

void rune::Transform::setRotation ( rune::Vec3  newRotation)

Set the rotation vector.

Parameters
newRotationThe new rotation vector of the Transform.

◆ setRotationX()

void rune::Transform::setRotationX ( double  newX)

Set the X rotation.

Parameters
newXThe new X rotation of the Transform.

◆ setRotationY()

void rune::Transform::setRotationY ( double  newY)

Set the Y rotation.

Parameters
newYThe new Y rotation of the Transform.

◆ setRotationZ()

void rune::Transform::setRotationZ ( double  newZ)

Set the Z rotation.

Parameters
newZThe new Z rotation of the Transform.

◆ setScale()

void rune::Transform::setScale ( rune::Vec3  newScale)

Set the scale vector.

Parameters
newScaleThe new scale of the Transform.

◆ setScaleX()

void rune::Transform::setScaleX ( double  newX)

Set the X scale.

Parameters
newXThe new X scale of the Transform.

◆ setScaleY()

void rune::Transform::setScaleY ( double  newY)

Set the Y scale.

Parameters
newYThe new Y scale of the Transform.

◆ setScaleZ()

void rune::Transform::setScaleZ ( double  newZ)

Set the Z scale.

Parameters
newZThe new Z scale of the Transform.

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