Up and down cliffs

Started by
2 comments, last by TheMac 14 years, 2 months ago
Is it typical to have the bottom sphere attached to a character and have it move along the terrain? I am trying to add the ability for my character to fall off a cliff, or not allow it to walk up a mountain. I am doing this in Ode, so I am building my NPC code from scratch. Is this the common way, are there more efficient ways of restricting the player from walking straight up a mountain?
Advertisement
A common method is to check the slope (normal) of the ground. If it's too steep (normal.Z is less than a particular threshold), then the NPC can't walk there and needs to slide down to flatter ground.
Just thinking this through, I am picturing a ray say 1 foot in front of the character going down, and if it hits a threshold then it is too steep? I can see problems in that, what if the terrain is not an even slope.
Do I just pick one location on the ground like the center of the models bounding box and get the normalized vector?

This topic is closed to new replies.

Advertisement