1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2025-09-08 17:10:16 +02:00

Cleaning up maths: part 4.

More by ref args, cleaned up distance_to_flipper, ramp init.
This commit is contained in:
Muzychenko Andrey 2022-05-16 09:28:35 +03:00
parent fdf1f6c9f1
commit 2d2ca0ab2a
6 changed files with 153 additions and 177 deletions

View file

@ -11,7 +11,7 @@ TLine::TLine(TCollisionComponent* collCmp, char* activeFlag, unsigned int collis
Y0 = y0;
X1 = x1;
Y1 = y1;
maths::line_init(&Line, x0, y0, x1, y1);
maths::line_init(Line, x0, y0, x1, y1);
}
TLine::TLine(TCollisionComponent* collCmp, char* activeFlag, unsigned int collisionGroup, const vector2& start,
@ -21,7 +21,7 @@ TLine::TLine(TCollisionComponent* collCmp, char* activeFlag, unsigned int collis
Y0 = start.Y;
X1 = end.X;
Y1 = end.Y;
maths::line_init(&Line, X0, Y0, X1, Y1);
maths::line_init(Line, X0, Y0, X1, Y1);
}
void TLine::Offset(float offset)
@ -33,12 +33,12 @@ void TLine::Offset(float offset)
Y0 += offY;
X1 += offX;
Y1 += offY;
maths::line_init(&Line, X0, Y0, X1, Y1);
maths::line_init(Line, X0, Y0, X1, Y1);
}
float TLine::FindCollisionDistance(ray_type* ray)
{
return maths::ray_intersect_line(ray, &Line);
return maths::ray_intersect_line(*ray, Line);
}
void TLine::EdgeCollision(TBall* ball, float coef)