Brenta Engine 1.2
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 (int window_width, int window_height, 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.
 
bool 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 26 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 10 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 17 of file translation.cpp.

Member Function Documentation

◆ rotate()

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

Rotate the object.

Parameters
rotationThe rotation vector

Definition at line 53 of file translation.cpp.

◆ scale()

void translation::scale ( float scale)

Scale the object.

Parameters
scaleThe scale factor

Definition at line 63 of file translation.cpp.

◆ set_model()

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

Set the model matrix.

Parameters
modelThe model matrix

Definition at line 42 of file translation.cpp.

◆ set_projection() [1/2]

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

Set the projection matrix.

Parameters
projectionThe projection matrix

Definition at line 37 of file translation.cpp.

◆ set_projection() [2/2]

void translation::set_projection ( int window_width,
int window_height,
float fov,
float near,
float far )

Set the model matrix.

Parameters
modelThe model matrix

Definition at line 29 of file translation.cpp.

◆ set_shader()

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

Set the shader.

Parameters
shader_nameThe shader name

Definition at line 68 of file translation.cpp.

◆ set_view()

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

Set the view matrix.

Parameters
viewThe view matrix

Definition at line 24 of file translation.cpp.

◆ translate()

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

Translate the object.

Parameters
translationThe translation vector

Definition at line 47 of file translation.cpp.

Field Documentation

◆ model

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

Object position matrix.

Definition at line 40 of file translation.hpp.

◆ projection

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

Camera projection matrix.

Definition at line 36 of file translation.hpp.

◆ view

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

Camera view matrix.

Definition at line 32 of file translation.hpp.


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