Skip to main content
gamedev.net
🔒 Locked

Collision question

Started by Jonathan 0 replies 750+ views
Original Post
Jonathan
Jonathan
I'm trying to figure out how to figure out where I've collided with my terrain. So far I'm thinking of just querying the mesh for the height underneath a given object, and using that as where the object would be hitting it. (Whether standing, falling, etc..) Will that be enough, or should something more complete be used, like figuring out the equation for the plane of the current part of the terrain I'm standing on? (Pretty much just the triangle I'm on) Or if not that, any other ideas? Or am I just making that harder than it needs to be? As for collision with things that aren't the terrain, for now I'm just using a quickly thrown together octree solution that works with bounding boxes for the characters. I know I can improve on that. I was wondering though, should this be part of the same code that detects collisions with the landscape itself, or should it be handled separately? Jonathan Edited by - Jonathan on 9/22/00 12:23:30 AM
Heraldin
Heraldin
First question: so long as your terrain model has no overlaps (eg. a raised platform you can walk over or under), checking the object''s base against the height should work just fine. However, if the terrain is very steep (e.g. at the base of a mountain) then you''ll need to make sure you can''t walk up close-to-vertical slopes!

As to whether your general collision detection should be combined with the terrain collision detection, well, it''s really up to you. If you''re using different methods for each (such as the terrain height vs. bounding boxes) then do them separately. You need also to think about the consequences of colliding with objects/terrain. Do they have the same result? If so, then combining the different collision-detections into the same function-call might be useful.

Dave

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.