Brenta Engine 1.1
Loading...
Searching...
No Matches
brenta::types::translation Class Reference

Translation util class. More...

#include <translation.hpp>

Public Member Functions

 translation ()
 Translation constructor.
 
 translation (glm::mat4 view, glm::mat4 projection, glm::mat4 model)
 Translation constructor.
 
void set_view (glm::mat4 view)
 Set the view matrix.
 
void set_projection (glm::mat4 projection)
 Set the projection matrix.
 
void set_projection (float fov, float near, float far)
 Set the model matrix.
 
void set_model (glm::mat4 model)
 Set the model matrix.
 
void translate (glm::vec3 translation)
 Translate the object.
 
void rotate (glm::vec3 rotation)
 Rotate the object.
 
void scale (float scale)
 Scale the object.
 
void set_shader (types::shader_name_t shader_name)
 Set the shader.
 

Data Fields

glm::mat4 view
 Camera view matrix.
 
glm::mat4 projection
 Camera projection matrix.
 
glm::mat4 model
 Object position matrix.
 

Detailed Description

Translation util class.

This class is used to store the view, projection, and model matrices of an object. The matrices can be set using the setView, setProjection, and setModel methods.

Definition at line 48 of file translation.hpp.

Constructor & Destructor Documentation

◆ translation() [1/2]

translation::translation ( )

Translation constructor.

This constructor initializes the view, projection, and model matrices to the identity matrix.

Definition at line 31 of file translation.cpp.

◆ translation() [2/2]

translation::translation ( glm::mat4 view,
glm::mat4 projection,
glm::mat4 model )

Translation constructor.

This constructor initializes the view, projection, and model matrices to the given matrices.

Parameters
viewThe view matrix
projectionThe projection matrix
modelThe model matrix

Definition at line 38 of file translation.cpp.

Member Function Documentation

◆ rotate()

void translation::rotate ( glm::vec3 rotation)

Rotate the object.

Parameters
rotationThe rotation vector

Definition at line 73 of file translation.cpp.

◆ scale()

void translation::scale ( float scale)

Scale the object.

Parameters
scaleThe scale factor

Definition at line 83 of file translation.cpp.

◆ set_model()

void translation::set_model ( glm::mat4 model)

Set the model matrix.

Parameters
modelThe model matrix

Definition at line 62 of file translation.cpp.

◆ set_projection() [1/2]

void translation::set_projection ( float fov,
float near,
float far )

Set the model matrix.

Parameters
modelThe model matrix

Definition at line 50 of file translation.cpp.

◆ set_projection() [2/2]

void translation::set_projection ( glm::mat4 projection)

Set the projection matrix.

Parameters
projectionThe projection matrix

Definition at line 57 of file translation.cpp.

◆ set_shader()

void translation::set_shader ( types::shader_name_t shader_name)

Set the shader.

Parameters
shader_nameThe shader name

Definition at line 88 of file translation.cpp.

◆ set_view()

void translation::set_view ( glm::mat4 view)

Set the view matrix.

Parameters
viewThe view matrix

Definition at line 45 of file translation.cpp.

◆ translate()

void translation::translate ( glm::vec3 translation)

Translate the object.

Parameters
translationThe translation vector

Definition at line 67 of file translation.cpp.

Field Documentation

◆ model

glm::mat4 brenta::types::translation::model

Object position matrix.

Definition at line 62 of file translation.hpp.

◆ projection

glm::mat4 brenta::types::translation::projection

Camera projection matrix.

Definition at line 58 of file translation.hpp.

◆ view

glm::mat4 brenta::types::translation::view

Camera view matrix.

Definition at line 54 of file translation.hpp.


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