Daniele Bartolini 10 tahun lalu
induk
melakukan
3f7f35c818
3 mengubah file dengan 6 tambahan dan 6 penghapusan
  1. 3 3
      src/core/math/matrix4x4.h
  2. 1 1
      src/renderers/gui.cpp
  3. 2 2
      src/world/camera.cpp

+ 3 - 3
src/core/math/matrix4x4.h

@@ -261,7 +261,7 @@ inline Matrix4x4 operator*(Matrix4x4 a, const Matrix4x4& b)
 }
 
 /// Sets the matrix @a m to perspective.
-inline void set_perspective(Matrix4x4& m, float fovy, float aspect, float near, float far)
+inline void perspective(Matrix4x4& m, float fovy, float aspect, float near, float far)
 {
 	const float height = 1.0f / tanf(to_rad(fovy) * 0.5f);
 	const float width = height * 1.0f / aspect;
@@ -290,7 +290,7 @@ inline void set_perspective(Matrix4x4& m, float fovy, float aspect, float near,
 }
 
 /// Sets the matrix @a m to orthographic.
-inline void set_orthographic(Matrix4x4& m, float left, float right, float bottom, float top, float near, float far)
+inline void orthographic(Matrix4x4& m, float left, float right, float bottom, float top, float near, float far)
 {
 	m.x.x = 2.0f / (right - left);
 	m.x.y = 0.0f;
@@ -353,7 +353,7 @@ inline Matrix4x4 get_transposed(Matrix4x4 m)
 }
 
 /// Sets the matrix @a m to look.
-inline void set_look(Matrix4x4& m, const Vector3& pos, const Vector3& target, const Vector3& up)
+inline void look(Matrix4x4& m, const Vector3& pos, const Vector3& target, const Vector3& up)
 {
 	Vector3 zaxis = pos - target;
 	normalize(zaxis);

+ 1 - 1
src/renderers/gui.cpp

@@ -89,7 +89,7 @@ Gui::Gui(uint16_t width, uint16_t height, const char* material)
 	, m_height(height)
 	, m_pose(MATRIX4X4_IDENTITY)
 {
-	set_orthographic(m_projection, 0, width, 0, height, -0.01f, 100.0f);
+	orthographic(m_projection, 0, width, 0, height, -0.01f, 100.0f);
 
 	m_material = material_manager::get()->create_material(ResourceId(material));
 }

+ 2 - 2
src/world/camera.cpp

@@ -141,12 +141,12 @@ void Camera::update_projection_matrix()
 	{
 		case ProjectionType::ORTHOGRAPHIC:
 		{
-			set_orthographic(_projection, _left, _right, _bottom, _top, _near, _far);
+			orthographic(_projection, _left, _right, _bottom, _top, _near, _far);
 			break;
 		}
 		case ProjectionType::PERSPECTIVE:
 		{
-			set_perspective(_projection, _FOV, _aspect, _near, _far);
+			perspective(_projection, _FOV, _aspect, _near, _far);
 			break;
 		}
 		default: