Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a 3D scene, and a player that can move about in it.

In a time-step the player can move from point A to point B. The player should follow the terrain height but slow going up cliffs and then fall back, or stop when jumping and hitting a wall and so on.

In my first prototype I determine the Y at the player's centre's X,Z by intersecting a ray with every triangle in the scene. I am not checking their path, but rather just sampling their end-point for each tick. Despite this being Javascript, it works acceptably performance-wise.

a bad collision; player shouldn't be half-out of the room

However, because I am modeling the player as a single point, the player can position themselves so that they are half-in a cliff face and so on. I need to model them as as a solid e.g. some cluster of spheres or a even their fuller mesh. I am also concerned that if they were moving faster they might miss the test altogether.

How should I solve this?

share|improve this question
add comment

1 Answer 1

Have a collision mesh that you don't render and is smaller than the room by the maximum diameter of the player. In this case the collision mesh could be much less detailed than then visible model helping performance.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.