Collision without a bsp level?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

Collision without a bsp level?

Post by powerpop »

All the player and level examples assume a quake-like bsp mesh to test against (or create the selector with) - for my app the level is created out of many block objects - so instead of one mesh i have a hundred or more - if i want to do player collision against the static parts of my level how would you suggest i do that? - can i set up the selector and make followon calls to add more mesh data to it for testing?

and i imagine for those objects that can move or be replaced in my levels that i need to write a separate object-player collision routine to check for these on the fly - or make a new selector and add the movable meshes to it each frame (or some number of frames)
Homer
Posts: 58
Joined: Tue Nov 18, 2003 7:11 pm
Location: Germany

Post by Homer »

have a look at the IMetaTriangleSelector. this should help you
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

Post by powerpop »

hmmm, it looks like is does a for loop through the list of selectors every time it wants to get the full list of triangles or those within a bounding box - that seems like it would be dead slow when using it for per frame collision detection on the player character - especially with hundreds of objects

maybe a better thing for me to do is create a new mesh and pack it with all the object meshes that will not move (after i load all my objects) - it will be more memory intensive for a big level but much faster on the collision side of things

are there other options i am missing?
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

No you're not missing anything.. Irrlicht does not have great collision detection for anything outside the 'level'. I don't know if anything is planned for the future. For now you basically have to make your own method of determining which objects are close enough to put into a metaTriangleSelector (eg brute force: loop through all your blocks, check their distance from the player, if close enough add to list to check more thoroughly).
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

are you sure you really want triangle-level collision detail if your levels are created by box shaped objects all snapped to a grid? you can simply test grid coordinates!
a screen cap is worth 0x100000 DWORDS
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

Post by powerpop »

that's true - although the majority of blocks are not... umm ... block shaped - i could though grab the 12 or so blocks right near the player and just test on them - but later i have to do object-object and object-level testing - that is going to be nasty
Post Reply