Retrait d'instances de mc"clone"
This commit is contained in:
		
							
								
								
									
										63
									
								
								SQCSim2021/transformation.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								SQCSim2021/transformation.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,63 @@ | ||||
| #include "transformation.h" | ||||
|  | ||||
| Transformation::Transformation() | ||||
| { | ||||
|     m_stack.push(Matrix4f::IDENTITY); | ||||
| } | ||||
|  | ||||
| void Transformation::SetIdentity() | ||||
| { | ||||
|     m_stack.top().SetIdentity(); | ||||
| } | ||||
|  | ||||
| void Transformation::Push() | ||||
| { | ||||
|     m_stack.push(m_stack.top()); | ||||
| } | ||||
|  | ||||
| void Transformation::Pop() | ||||
| { | ||||
|     m_stack.pop(); | ||||
| } | ||||
|  | ||||
| void Transformation::ApplyTranslation(float x, float y, float z) | ||||
| { | ||||
|     m_stack.top().ApplyTranslation(x, y, z); | ||||
| } | ||||
|  | ||||
| void Transformation::ApplyTranslation(const Vector3f& v) | ||||
| { | ||||
|     ApplyTranslation(v.x, v.y, v.z); | ||||
| } | ||||
|  | ||||
|  | ||||
| void Transformation::ApplyRotation(float angle, float x, float y, float z) | ||||
| { | ||||
|     m_stack.top().ApplyRotation(angle, x, y, z); | ||||
| } | ||||
|  | ||||
| void Transformation::ApplyRotation(float angle, const Vector3f& v) | ||||
| { | ||||
|     ApplyRotation(angle, v.x, v.y, v.z); | ||||
| } | ||||
|  | ||||
| void Transformation::ApplyScale(float x, float y, float z) | ||||
| { | ||||
|     m_stack.top().ApplyScale(x, y, z); | ||||
| } | ||||
|  | ||||
| void Transformation::ApplyScale(const Vector3f& v) | ||||
| { | ||||
|     ApplyScale(v.x, v.y, v.z); | ||||
| } | ||||
|  | ||||
| void Transformation::Use() const | ||||
| { | ||||
|     glLoadMatrixf(m_stack.top().GetInternalValues()); | ||||
| } | ||||
|  | ||||
| const Matrix4f& Transformation::GetMatrix() const | ||||
| { | ||||
|     return m_stack.top(); | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user