Sign in to follow this  

Collision response is to slow.

This topic is 3338 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

Hi folks! In my FPS Game i have this tactic for my Collision Response (sliding walls). 1 Find the closest Point on any of my wall. 2 If any of these points is closer than 2 (Radius of my sphere) 3 Push the player out as far as the sphere "overpenetrates" the max distance allowed( in this case 2 as radius) Example: Min Distance to wall is 2. if DistanceToWall < 2 PushPlayer out formula: VPushout = (2-ActualDistanceToWall) * NormalizedNormalVector Of That wall S THIS RIGHT? BECAUSE THE PLAYER CAN COME TO CLOSE THE WALL ANYWAY. My MoveVector that has the speeds and direction that the player is traveling with is added with the Correction Move_v+=(2-ActualDistanceToWall * NormalizedNormalVector Of That wall). It feels like i am missing a step, i have to do some more checks and push the player out sooner. Because when the player slides with full speed i have a distance of 1.2 to the wall. When i Press "W" key the speeds are increasing and when letting go the speed decreases. The formula for my move vector is like this, the only thing i control is the speeds. vector vForward = camera.mview-camera.mpos * forwardspeed The Move_v = vForward + vBackward + vLeft + vRight (and so on) i can´t figure out why this isn´t enought to push the player out to the exact distance of 2 (radius) This formula is just doing the work like 70% or so depending on the speeds. (2-ActualDistanceToWall * NormalizedNormalVector Of That wall) If i just push the player slowly against the wall i endup 1.8 away from wall, but with full speed i end up 1.1f to the wall, so there must be something with the speeds i am missing. Anyone have a formula for pushing the player out with the Wall Normal and the penetrated distance?

Share this post


Link to post
Share on other sites
Problem solved!

I forgot to update length to wall after pushing player out of the wall.

No the player ALWAYS has exactly the distance of my radius to any walls, obtuse or not obtuse!

Share this post


Link to post
Share on other sites

This topic is 3338 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