NikiTo said:
A small example how messy is FP - The dot(for sake of example i will use a dot) is the player and the red arrow is his direction of movement -
If you would not have written this post, i would have done for you. Because you just confirmed my assumptions why you had issues to implement 2d collision detection.
It is not because of precision, it is because of an ill posed problem, and it is your failure to have missed that. Your conclusion, precision prevents things from working was wrong.
So i will try to fix this for you. Because, yeah, i always know everything better, i know. But i'm old. And i can't help i have implemented simple 3d collision detection successfully while you failed on the 2d case. I can't help i know it better than you do.
So listen…
Your example is a point colliding with a line in 2d. But this can never work, because if the point is exactly at the line, there is no way to tell where did it came from? Even with infinite precision, it would not work as intended.
To make it work, you need a definition of solid and empty space. E.g. A Polygon, or having a tangent for the line that identifies which side is solid, or having a BSP tree, whatever.
Then you can just make sure the point keeps outside solid space, and do corrections if necessary.
Ask yourself: If stuff has no area, no volume, so no mass either - how should it collide with other such non existing stuff properly at all?
Think about it. And think how using a ball instead a point already removes the problems you mention, and how exactness is not necessary to be infinite.
But using a ball also introduces more complexity because face, edge and vertex collisions cause different collision response.
NikiTo said:
But if your circle/sphere is close to various linesSegments/planes at once, it could happen that the same algorithm, once detects the closest intersection to be with lineSegment/plane A, and other time it detects that the closest intersection is with lineSegment/plane B. And this could create jittering.
If you have multiple contact and you resolve contact A than B, A bay be violated again so we gent jitter. But again it is our own fault, not caused by precision.
To resolve this properly, e.g. ball intersecting 2 walls at a corner, we can displace wall planes by ball radius, calculate their line of intersection and put the ball at this line to resolve both collisions at once.
Same works for 3 planes where intersection becomes a point.
With more than 3 we could calculate Minkovski sum (which i have no experience with), and put the ball center to the closest point on the new surface.
NikiTo said:
Yeah, no need to bring that either, because it is a little bit off topic.
Agree, sorry for that. Got triggered because multiple people start to attack me out of nowhere on the wrong place.
Please notice that i did not say you would not be helpful, or your assumptions about FP precision would be pointless BS. I did not address any of your posts with my response at all, i only added what i think is the real reason for the problems.
It was you who interpreted all those things in my simple saying:
It seems you have jitter because instead doing that, you alternate both adjacent lines (or faces in 3D). It's clearly a mistake but no floating point precision issue.
… which is in no way rude or personally addressed to you, and it's not even sarcastic. Read it once more.
But still, again you got triggered, and the old paranoia comes back telling you everybody is against you, everybody wants to proof you wrong, it is something personal… and you make the thread explode again… But as said, your mind fools you, and you do not get the real intent.
I admit, i did indeed think things like: ‘Why does he reply on 3D collisions if he even did not get the 2D case working? How does he think he could be helpful?’. But i did not say that. Now i do, but it is a consequence of your own actions. You cause exact those things that you do not want to happen, entirely on your own. So there is a reaction, yes, but you are wrong about the cause. The cause is you, not me, or all the others.
If only you would realize… i think you could just control yourself, follow logic and reasoning instead intuition - i think you could make things much more easy for you.