sculpto
transform_component.h
Go to the documentation of this file.
1/*!****************************************************************//*!*
2 * \file transform_component.h
3 * \brief Application scene system objects transform component class implementation module.
4 *
5 * \author Sabitov Kirill
6 * \date 02 July 2022
7 *********************************************************************/
8
9#pragma once
10
11#include "base.h"
12
13namespace scl
14{
17 {
18 vec3 Scale { 1 };
25
31 ScaleMatr(matr4::Scale(Scale)), AnglesMatr(matr4::RotateX(Angles.X) * matr4::RotateY(Angles.Y) * matr4::RotateZ(Angles.Z)),
32 PositionMatr(matr4::Translate(Position)),
35
36 void SetScale(const vec3 &Scale)
37 {
38 this->Scale = Scale;
40 }
41 void SetAngles(const vec3 &Angles)
42 {
43 this->Angles = Angles;
45 }
47 {
48 this->Position = Position;
50 }
51
53 {
56 }
58 {
61 }
63 {
66 }
68 {
73 }
74
75 operator const matr4 &() const { return Transform; }
76 operator matr4 &() { return Transform; }
77 };
78}
Topology object basis class for mesh creating implementation module.
static matr4 RotateY(degrees< float > Angle)
Definition: matr4.h:323
static matr4 Scale(vec3< float > S)
Definition: matr4.h:272
static matr4 RotateZ(degrees< float > Angle)
Definition: matr4.h:340
static matr4 RotateX(degrees< float > Angle)
Definition: matr4.h:306
static matr4 Translate(const vec3< float > &Transform)
Definition: matr4.h:257
Definition: base.h:33
transform_component(const vec3 &Scale, const vec3 &Angles, const vec3 &Position)
transform_component(const transform_component &Other)=default
void SetPosition(const vec3 &Position)
transform_component(const matr4 &Tranform)
void SetAngles(const vec3 &Angles)
void SetScale(const vec3 &Scale)