Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Is it possible to determine where on a body the collision occurs?

Author
Message
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 18th Oct 2009 15:29 Edited at: 18th Oct 2009 17:38
Hello, I was wondering if you know of a solution to this little problem I am facing.

I am currently using a raycast function to check for intersection between the player position and the floor. If there is an intersection then the game believe the player is standing on the floor and he can move.



If there isn't an intersection this means the player is in the air either by jumping or falling.

However, when climbing stairs I noticed there was a problem with this method. Because even though a part of the body is colliding with a stair step; there is no intersection. Meaning the player is stuck between two stair steps. He cannot move, but he is still on the floor.


So I was thinking that maybe it was possible to somehow check for collisions between the player body and any other body in the game; but only for the bottom part of the player body (his feet).
This way, even though there is no intersection; there is a collision and that tells me that the collision occur on his feet, and he can freely walk up the stair.


The problem here is, if it is not possible to determine exactly where on the player body the collision occur, he might as well be in the air; colliding with a wall. And the engine will think that he is on the ground.

See my illustrations for reference.

Any ideas?


Edit,

Apparently there are these commands:
phy get collision data ( )
phy get collision object a()
phy get collision object b()
phy get collision count()
phy get collision contact normal x()
phy get collision contact normal y()
phy get collision contact normal z()

Now to figure out which normals I need to check for collision with.

Edit,
Now solved. The above commands are what was needed.

A mod accidentally your signature

Login to post a reply

Server time is: 2024-11-24 14:24:06
Your offset time is: 2024-11-24 14:24:06