Cleaning up maths: part 3.

Demangled methods, vectors args by ref, added comments, more accurate ray_intersect_line.
This commit is contained in:
Muzychenko Andrey committed 2022-05-13 11:15:30 +03:00
1 parent 2d0da712e3
commit fdf1f6c9f1
21 files changed
+296 -356

No files matched your search

+3 -3
View File
@@ -50,7 +50,7 @@ TEdgeSegment* TEdgeSegment::install_wall(float* floatArr, TCollisionComponent* c
start.Y = floatArr[2];
end.X = floatArr[3];
end.Y = floatArr[4];
auto line = new TLine(collComp, activeFlagPtr, collisionGroup, &start, &end);
auto line = new TLine(collComp, activeFlagPtr, collisionGroup, start, end);
edge = line;
if (line)
@@ -93,7 +93,7 @@ TEdgeSegment* TEdgeSegment::install_wall(float* floatArr, TCollisionComponent* c
vec1.Y = center.Y - prevCenter.Y;
vec2.X = centerX2 - centerX1;
vec2.Y = centerY2 - center.Y;
maths::cross(&vec1, &vec2, &dstVec);
maths::cross(vec1, vec2, dstVec);
if ((dstVec.Z > 0.0f && offset > 0.0f) ||
(dstVec.Z < 0.0f && offset < 0.0f))
{
@@ -113,7 +113,7 @@ TEdgeSegment* TEdgeSegment::install_wall(float* floatArr, TCollisionComponent* c
start.Y = floatArrPtr[1];
end.X = floatArrPtr[2];
end.Y = floatArrPtr[3];
auto line = new TLine(collComp, activeFlagPtr, collisionGroup, &start, &end);
auto line = new TLine(collComp, activeFlagPtr, collisionGroup, start, end);
edge = line;
if (line)