From 5a1d67d1797a3db874e44500e13237d676843185 Mon Sep 17 00:00:00 2001 From: vimene Date: Sun, 26 Nov 2023 08:43:14 +0100 Subject: added namespaces, made every function in engine.cpp static and added warnings' flags --- src/o3d/tri_vertex.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/o3d/tri_vertex.cpp') diff --git a/src/o3d/tri_vertex.cpp b/src/o3d/tri_vertex.cpp index 7b6b379..07185f6 100644 --- a/src/o3d/tri_vertex.cpp +++ b/src/o3d/tri_vertex.cpp @@ -5,6 +5,8 @@ #include "o3d/vertex.h" #include "o3d/tri_vertex.h" +using namespace engine::o3d; + TriangleVertex3::TriangleVertex3(Vertex3 vertex1, Vertex3 vertex2, Vertex3 vertex3) : vertex1{vertex1}, vertex2{vertex2}, vertex3{vertex3} { } @@ -46,7 +48,7 @@ static void _crop_x(std::vector& tris, TriangleVertex3 t, int n q3 = &t.vertex1; break; } - MathVector3 dq2 = q1->point - q2->point; + engine::math::MathVector3 dq2 = q1->point - q2->point; float fac2 = (x - q2->point.x) / dq2.x; Vertex3 r2{ { @@ -56,7 +58,7 @@ static void _crop_x(std::vector& tris, TriangleVertex3 t, int n }, VertexData::lerp(q2->data, q1->data, fac2) }; - MathVector3 dq3 = q1->point - q3->point; + engine::math::MathVector3 dq3 = q1->point - q3->point; float fac3 = (x - q3->point.x) / dq3.x; Vertex3 r3{ { @@ -131,7 +133,7 @@ static void _crop_y(std::vector& tris, TriangleVertex3 t, int n q3 = &t.vertex1; break; } - MathVector3 dq2 = q1->point - q2->point; + engine::math::MathVector3 dq2 = q1->point - q2->point; float fac2 = (y - q2->point.y) / dq2.y; Vertex3 r2{ { @@ -141,7 +143,7 @@ static void _crop_y(std::vector& tris, TriangleVertex3 t, int n }, VertexData::lerp(q2->data, q1->data, fac2) }; - MathVector3 dq3 = q1->point - q3->point; + engine::math::MathVector3 dq3 = q1->point - q3->point; float fac3 = (y - q3->point.y) / dq3.y; Vertex3 r3{ { @@ -245,7 +247,7 @@ static void _crop_z(std::vector& tris, TriangleVertex4 t, int n q3 = &t.vertex1; break; } - MathVector4 dq2 = q1->point - q2->point; + engine::math::MathVector4 dq2 = q1->point - q2->point; float fac2 = (z - q2->point.z) / dq2.z; Vertex4 r2{ { @@ -256,7 +258,7 @@ static void _crop_z(std::vector& tris, TriangleVertex4 t, int n }, VertexData::lerp(q2->data, q1->data, fac2) }; - MathVector4 dq3 = q1->point - q3->point; + engine::math::MathVector4 dq3 = q1->point - q3->point; float fac3 = (z - q3->point.z) / dq3.z; Vertex4 r3{ { -- cgit v1.2.3