#Make a colliding 3d map of a single 3d object

16 messages · Page 1 of 1 (latest)

north dagger
#

I have a 3d model of a map, I have made sure the player doesn't escape the map from boundaries, but How do I make sure that the player doesn't go inside buildings itself which is the part of the map. Is there a way to make it so that the player stops bumping into the map?

charred isle
#

Using a single model as a map is a bad idea, because of this reason

#

mesh collisions are not great for this, and are slow

#

most games would break the map into smaller objects that you can do collisions on sperately

charred isle
#

you may want to look into a scenegraph system, like an Octree or a Spaitial Hash

north dagger
#

but still, if I have a single building, how should I make it so that my player doesn't go through the wall?

charred isle
#

you don't want to have to check every object in the world every time.

#

most games would put a collision volume around that

#

using the mesh for collision is not great

#

but if you wanted to use the mesh, you'd have to write some collision code that does something like a cylinder vs mesh test

#

that is an example of FPS-like collisions against bounding box volumes.

north dagger
#

ok, thanks a lot

charred isle
#

your other option would be to use a full blown physics lib

#

but again, testing against render meshes will be slow