Vesper 0.5.1
Vesper is short form for the Latin word for "Bat", as Vesper is designed to be small, lightweight, and easily handle things like particles and flocking behaviors in accordance with the nature of bats. \n It is meant to be a particle simulation, VFX editor, and CAN be used secondarily as a small game engine.
GitHub | Vesper Updates | Creator
Loading...
Searching...
No Matches
Vesper::TransformComponent Struct Reference

Component that holds the transform of an entity. More...

#include <Components.h>

Public Member Functions

 TransformComponent ()=default
 TransformComponent (const TransformComponent &)=default
 TransformComponent (const glm::vec3 &translation)
 Constructor that initializes the translation with a 3D vector.
glm::mat4 GetTransform () const
 Calculates and returns the transformation matrix.

Public Attributes

glm::vec3 Translation = { 0.0f, 0.0f, 0.0f }
 Translation (position) vector.
glm::vec3 Rotation = { 0.0f, 0.0f, 0.0f }
 Rotation vector (in radians).
glm::vec3 Scale = { 1.0f, 1.0f, 1.0f }
 Scale vector.

Detailed Description

Component that holds the transform of an entity.

Constructor & Destructor Documentation

◆ TransformComponent() [1/3]

Vesper::TransformComponent::TransformComponent ( )
default

◆ TransformComponent() [2/3]

Vesper::TransformComponent::TransformComponent ( const TransformComponent & )
default

◆ TransformComponent() [3/3]

Vesper::TransformComponent::TransformComponent ( const glm::vec3 & translation)
inline

Constructor that initializes the translation with a 3D vector.

74 : Translation(translation) {
75 }
glm::vec3 Translation
Translation (position) vector.
Definition Components.h:64

Member Function Documentation

◆ GetTransform()

glm::mat4 Vesper::TransformComponent::GetTransform ( ) const
inline

Calculates and returns the transformation matrix.

79 {
80 glm::mat4 rotation = glm::toMat4(glm::quat(Rotation));
81
82 return glm::translate(glm::mat4(1.0f), Translation)
83 * rotation
84 * glm::scale(glm::mat4(1.0f), Scale);
85 }
glm::vec3 Scale
Scale vector.
Definition Components.h:68
glm::vec3 Rotation
Rotation vector (in radians).
Definition Components.h:66

Member Data Documentation

◆ Rotation

glm::vec3 Vesper::TransformComponent::Rotation = { 0.0f, 0.0f, 0.0f }

Rotation vector (in radians).

66{ 0.0f, 0.0f, 0.0f };

◆ Scale

glm::vec3 Vesper::TransformComponent::Scale = { 1.0f, 1.0f, 1.0f }

Scale vector.

68{ 1.0f, 1.0f, 1.0f };

◆ Translation

glm::vec3 Vesper::TransformComponent::Translation = { 0.0f, 0.0f, 0.0f }

Translation (position) vector.

64{ 0.0f, 0.0f, 0.0f };

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