Loading...
Searching...
No Matches
hellfire::Transform3D Class Reference

#include <Transform3D.h>

Collaboration diagram for hellfire::Transform3D:

Public Member Functions

 Transform3D ()
 
glm::vec3 & get_position ()
 
const glm::vec3 & get_position () const
 
void set_position (const glm::vec3 &new_position)
 
void set_position (const float x, const float y, const float z)
 
void set_scale (const glm::vec3 &new_scale)
 
void look_at (const glm::vec3 &target, const glm::vec3 &up=glm::vec3(0.0f, 1.0f, 0.0f))
 
void match_orientation (const Transform3D &other)
 
glm::vec3 get_scale () const
 
glm::vec3 & get_scale ()
 
void set_rotation (const glm::vec3 &angles)
 
void set_rotation_quaternion (const glm::quat &q)
 
float get_rotation_angle () const
 
const glm::vec3 & get_rotation_axis () const
 
void set_rotation_matrix (const glm::mat4 &rotation_matrix)
 
glm::mat4 get_rotation_matrix () const
 
void set_translation_matrix (const glm::mat4 &translation_matrix)
 
glm::mat4 get_translation_matrix () const
 
glm::mat4 get_scale_matrix () const
 
void set_scale_matrix (const glm::mat4 &scale_matrix)
 
const glm::mat4 & get_local_matrix () const
 
const glm::mat4 & get_world_matrix () const
 
void update_local_matrix ()
 
void update_world_matrix (const glm::mat4 &parent_world_matrix)
 
void reset_to_identity ()
 
const glm::vec3 & get_rotation () const
 

Private Member Functions

void extract_euler_angles_ (const glm::mat4 &rotation_matrix, float &x, float &y, float &z)
 

Private Attributes

glm::vec3 position_
 
glm::vec3 scale_
 
glm::vec3 rotation_axis_
 
float rotation_angle_
 
glm::mat4 local_matrix_
 
glm::mat4 world_matrix_
 
glm::mat4 rotation_matrix_
 
glm::mat4 translation_matrix_
 
glm::mat4 scale_matrix_
 
bool use_rotation_matrix_
 
bool use_translation_matrix_
 
bool use_scale_matrix_
 
float rotation_x_ = 0.0f
 
float rotation_y_ = 0.0f
 
float rotation_z_ = 0.0f
 
glm::vec3 rotation_in_degrees_ = glm::vec3(0.0f)
 
bool use_euler_angles_ = false
 

Detailed Description

Definition at line 10 of file Transform3D.h.

Constructor & Destructor Documentation

◆ Transform3D()

hellfire::Transform3D::Transform3D ( )
inline

Definition at line 12 of file Transform3D.h.

Member Function Documentation

◆ extract_euler_angles_()

void hellfire::Transform3D::extract_euler_angles_ ( const glm::mat4 &  rotation_matrix,
float &  x,
float &  y,
float &  z 
)
private

Definition at line 53 of file Transform3D.cpp.

◆ get_local_matrix()

const glm::mat4 & hellfire::Transform3D::get_local_matrix ( ) const
inline

Definition at line 93 of file Transform3D.h.

◆ get_position() [1/2]

glm::vec3 & hellfire::Transform3D::get_position ( )
inline

Definition at line 28 of file Transform3D.h.

◆ get_position() [2/2]

const glm::vec3 & hellfire::Transform3D::get_position ( ) const
inline

Definition at line 29 of file Transform3D.h.

◆ get_rotation()

const glm::vec3 & hellfire::Transform3D::get_rotation ( ) const

Definition at line 48 of file Transform3D.cpp.

◆ get_rotation_angle()

float hellfire::Transform3D::get_rotation_angle ( ) const
inline

Definition at line 59 of file Transform3D.h.

◆ get_rotation_axis()

const glm::vec3 & hellfire::Transform3D::get_rotation_axis ( ) const
inline

Definition at line 60 of file Transform3D.h.

◆ get_rotation_matrix()

glm::mat4 hellfire::Transform3D::get_rotation_matrix ( ) const
inline

Definition at line 69 of file Transform3D.h.

◆ get_scale() [1/2]

glm::vec3 & hellfire::Transform3D::get_scale ( )
inline

Definition at line 53 of file Transform3D.h.

◆ get_scale() [2/2]

glm::vec3 hellfire::Transform3D::get_scale ( ) const
inline

Definition at line 52 of file Transform3D.h.

◆ get_scale_matrix()

glm::mat4 hellfire::Transform3D::get_scale_matrix ( ) const
inline

Definition at line 83 of file Transform3D.h.

◆ get_translation_matrix()

glm::mat4 hellfire::Transform3D::get_translation_matrix ( ) const
inline

Definition at line 79 of file Transform3D.h.

◆ get_world_matrix()

const glm::mat4 & hellfire::Transform3D::get_world_matrix ( ) const
inline

Definition at line 94 of file Transform3D.h.

◆ look_at()

void hellfire::Transform3D::look_at ( const glm::vec3 &  target,
const glm::vec3 &  up = glm::vec3(0.0f, 1.0f, 0.0f) 
)

Definition at line 10 of file Transform3D.cpp.

◆ match_orientation()

void hellfire::Transform3D::match_orientation ( const Transform3D other)

Definition at line 72 of file Transform3D.cpp.

◆ reset_to_identity()

void hellfire::Transform3D::reset_to_identity ( )
inline

Definition at line 137 of file Transform3D.h.

◆ set_position() [1/2]

void hellfire::Transform3D::set_position ( const float  x,
const float  y,
const float  z 
)
inline

Definition at line 36 of file Transform3D.h.

◆ set_position() [2/2]

void hellfire::Transform3D::set_position ( const glm::vec3 &  new_position)
inline

Definition at line 31 of file Transform3D.h.

◆ set_rotation()

void hellfire::Transform3D::set_rotation ( const glm::vec3 &  angles)

Definition at line 27 of file Transform3D.cpp.

◆ set_rotation_matrix()

void hellfire::Transform3D::set_rotation_matrix ( const glm::mat4 &  rotation_matrix)
inline

Definition at line 63 of file Transform3D.h.

◆ set_rotation_quaternion()

void hellfire::Transform3D::set_rotation_quaternion ( const glm::quat &  q)

Definition at line 37 of file Transform3D.cpp.

◆ set_scale()

void hellfire::Transform3D::set_scale ( const glm::vec3 &  new_scale)
inline

Definition at line 42 of file Transform3D.h.

◆ set_scale_matrix()

void hellfire::Transform3D::set_scale_matrix ( const glm::mat4 &  scale_matrix)
inline

Definition at line 87 of file Transform3D.h.

◆ set_translation_matrix()

void hellfire::Transform3D::set_translation_matrix ( const glm::mat4 &  translation_matrix)
inline

Definition at line 73 of file Transform3D.h.

◆ update_local_matrix()

void hellfire::Transform3D::update_local_matrix ( )
inline

Definition at line 97 of file Transform3D.h.

◆ update_world_matrix()

void hellfire::Transform3D::update_world_matrix ( const glm::mat4 &  parent_world_matrix)
inline

Definition at line 132 of file Transform3D.h.

Member Data Documentation

◆ local_matrix_

glm::mat4 hellfire::Transform3D::local_matrix_
private

Definition at line 163 of file Transform3D.h.

◆ position_

glm::vec3 hellfire::Transform3D::position_
private

Definition at line 158 of file Transform3D.h.

◆ rotation_angle_

float hellfire::Transform3D::rotation_angle_
private

Definition at line 161 of file Transform3D.h.

◆ rotation_axis_

glm::vec3 hellfire::Transform3D::rotation_axis_
private

Definition at line 160 of file Transform3D.h.

◆ rotation_in_degrees_

glm::vec3 hellfire::Transform3D::rotation_in_degrees_ = glm::vec3(0.0f)
private

Definition at line 177 of file Transform3D.h.

◆ rotation_matrix_

glm::mat4 hellfire::Transform3D::rotation_matrix_
private

Definition at line 167 of file Transform3D.h.

◆ rotation_x_

float hellfire::Transform3D::rotation_x_ = 0.0f
private

Definition at line 174 of file Transform3D.h.

◆ rotation_y_

float hellfire::Transform3D::rotation_y_ = 0.0f
private

Definition at line 175 of file Transform3D.h.

◆ rotation_z_

float hellfire::Transform3D::rotation_z_ = 0.0f
private

Definition at line 176 of file Transform3D.h.

◆ scale_

glm::vec3 hellfire::Transform3D::scale_
private

Definition at line 159 of file Transform3D.h.

◆ scale_matrix_

glm::mat4 hellfire::Transform3D::scale_matrix_
private

Definition at line 169 of file Transform3D.h.

◆ translation_matrix_

glm::mat4 hellfire::Transform3D::translation_matrix_
private

Definition at line 168 of file Transform3D.h.

◆ use_euler_angles_

bool hellfire::Transform3D::use_euler_angles_ = false
private

Definition at line 178 of file Transform3D.h.

◆ use_rotation_matrix_

bool hellfire::Transform3D::use_rotation_matrix_
private

Definition at line 171 of file Transform3D.h.

◆ use_scale_matrix_

bool hellfire::Transform3D::use_scale_matrix_
private

Definition at line 173 of file Transform3D.h.

◆ use_translation_matrix_

bool hellfire::Transform3D::use_translation_matrix_
private

Definition at line 172 of file Transform3D.h.

◆ world_matrix_

glm::mat4 hellfire::Transform3D::world_matrix_
private

Definition at line 164 of file Transform3D.h.


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