Daniele Bartolini пре 11 година
родитељ
комит
280cbc61fc
3 измењених фајлова са 12 додато и 12 уклоњено
  1. 9 9
      engine/core/math/matrix4x4.h
  2. 1 1
      engine/renderers/gui.cpp
  3. 2 2
      engine/world/camera.cpp

+ 9 - 9
engine/core/math/matrix4x4.h

@@ -66,14 +66,14 @@ namespace matrix4x4
 {
 	const Matrix4x4 IDENTITY = Matrix4x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
 
-	/// Sets the matrix @a m to perspective. (Right-Handed coordinate systems)
-	void set_perspective_rh(Matrix4x4& m, float fovy, float aspect, float near, float far);
+	/// Sets the matrix @a m to perspective.
+	void set_perspective(Matrix4x4& m, float fovy, float aspect, float near, float far);
 
-	/// Sets the matrix @a m to orthographic. (Right-Handed coordinate systems)
-	void set_orthographic_rh(Matrix4x4& m, float left, float right, float bottom, float top, float near, float far);
+	/// Sets the matrix @a m to orthographic.
+	void set_orthographic(Matrix4x4& m, float left, float right, float bottom, float top, float near, float far);
 
-	/// Sets the matrix @a m to look. (Right-Handed coordinate systems)
-	void set_look_rh(Matrix4x4& m, const Vector3& pos, const Vector3& target, const Vector3& up);
+	/// Sets the matrix @a m to look.
+	void set_look(Matrix4x4& m, const Vector3& pos, const Vector3& target, const Vector3& up);
 
 	/// Transposes the matrix @a m and returns the result.
 	Matrix4x4& transpose(Matrix4x4& m);
@@ -193,7 +193,7 @@ inline Matrix4x4 operator*(Matrix4x4 a, const Matrix4x4& b)
 
 namespace matrix4x4
 {
-	inline void set_perspective_rh(Matrix4x4& m, float fovy, float aspect, float near, float far)
+	inline void set_perspective(Matrix4x4& m, float fovy, float aspect, float near, float far)
 	{
 		const float height = 1.0f / math::tan(fovy * ((float) math::PI / 180.0f) * 0.5f);
 		const float width = height * 1.0f / aspect;
@@ -206,7 +206,7 @@ namespace matrix4x4
 		m.t = Vector4(0, 0, bb, 0);
 	}
 
-	inline void set_orthographic_rh(Matrix4x4& m, float left, float right, float bottom, float top, float near, float far)
+	inline void set_orthographic(Matrix4x4& m, float left, float right, float bottom, float top, float near, float far)
 	{
 		m.x = Vector4(2.0f / (right - left), 0, 0, 0);
 		m.y = Vector4(0, 2.0f / (top - bottom), 0, 0);
@@ -251,7 +251,7 @@ namespace matrix4x4
 		return m;
 	}
 
-	inline void set_look_rh(Matrix4x4& m, const Vector3& pos, const Vector3& target, const Vector3& up)
+	inline void set_look(Matrix4x4& m, const Vector3& pos, const Vector3& target, const Vector3& up)
 	{
 		Vector3 zAxis = pos - target;
 		vector3::normalize(zAxis);

+ 1 - 1
engine/renderers/gui.cpp

@@ -112,7 +112,7 @@ Gui::Gui(uint16_t width, uint16_t height, const char* material)
 	, m_height(height)
 	, m_pose(matrix4x4::IDENTITY)
 {
-	set_orthographic_rh(m_projection, 0, width, 0, height, -0.01f, 100.0f);
+	set_orthographic(m_projection, 0, width, 0, height, -0.01f, 100.0f);
 
 	ResourceId id("material", material);
 	m_material = material_manager::get()->create_material(id.name);

+ 2 - 2
engine/world/camera.cpp

@@ -209,12 +209,12 @@ void Camera::update_projection_matrix()
 	{
 		case ProjectionType::ORTHOGRAPHIC:
 		{
-			matrix4x4::set_orthographic_rh(m_projection, m_left, m_right, m_bottom, m_top, m_near, m_far);
+			matrix4x4::set_orthographic(m_projection, m_left, m_right, m_bottom, m_top, m_near, m_far);
 			break;
 		}
 		case ProjectionType::PERSPECTIVE:
 		{
-			matrix4x4::set_perspective_rh(m_projection, m_FOV, m_aspect, m_near, m_far);
+			matrix4x4::set_perspective(m_projection, m_FOV, m_aspect, m_near, m_far);
 			break;
 		}
 		default: