diff options
author | vimene <vincent.menegaux@gmail.com> | 2023-11-26 08:43:14 +0100 |
---|---|---|
committer | vimene <vincent.menegaux@gmail.com> | 2023-11-26 08:43:14 +0100 |
commit | 5a1d67d1797a3db874e44500e13237d676843185 (patch) | |
tree | 17d0f1c2db6cc32fe40fdde4a081b96e8ad0ae13 /src/o3d/tri_vertex.cpp | |
parent | f63febed2a769d0c55192e192a20b8e39f162932 (diff) | |
download | engine-5a1d67d1797a3db874e44500e13237d676843185.tar.gz |
added namespaces, made every function in engine.cpp static and added warnings' flags
Diffstat (limited to 'src/o3d/tri_vertex.cpp')
-rw-r--r-- | src/o3d/tri_vertex.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
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<TriangleVertex3>& 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<TriangleVertex3>& 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<TriangleVertex3>& 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<TriangleVertex3>& 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<TriangleVertex4>& 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<TriangleVertex4>& 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{ { |