Sign in to follow this  

Collision detection

This topic is 4046 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I'm trying to implement player<->world collision-detection in my application. This function tests the player (a point) against a world mesh. I want gravity, as well as movement(of course). The movement-test emits a ray in the XZ-plane in the direction of movement, emanating from the player. If a intersection is detected, the results are used to calculate a vector perpendicular to the surface normal, with maintained magnitude (velocity). Should I do seperate Intersection-tests for gravity and player-movement, or a combined 3D-vector test? Downward-slopes: Should I do a intersection-test beneath the polygon the player is standing on to detect the slope, or should it be handled by the gravity test? Thanks!

Share this post


Link to post
Share on other sites
If you're working in a true 3D environment, e.g. with different floor heights and steepnesses, then a check on the XZ plane alone is insufficient. This depends on your levels design however, if there is a clear distinction between walls and passable ground, where this ground can vary a bit in height but never block a players movement, then you can safely seperate the two and use simplified tests for both. In that case however, there is probably little need for jumping, so you might as well find out how height the ground is below the character and stick him on that height.

Just my 2 cents. :)

Share this post


Link to post
Share on other sites

This topic is 4046 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this