[ODE] BSP And ODE?

Mohammad Bilal prettyh8machine at mail.com
Mon May 5 09:27:01 2003


OK I was the one who posted the mail Nearaz is talking about and this is how I went about implementing it:-

- Instead of making my own BSP-collider to plug in the ODE system, I used OPCODE (which is being used in the Tri-collider contribution for ODE -- which Nearaz also suggested). OPCODE is a collision detection library which makes optimized collision tree using Bounding Volumes so you just have to provide all the vertices of the Quake3 BSP (using Face->start and 
Face->count attributes you'll read in from the bsp file) and ofcourse you'll have to triangulize them (since most of the faces in the bsp arent just triangles) because this is how OPCODE asks you to do. In the end it returns you a list of primitives (triangles) that you have collided. You can do Mesh<>Mesh, Sphere<>Mesh etc. collisions. Im doing Sphere<>Mesh collision (Sphere being the player) with the whole BSP (BSP world being the mesh). It is workin fine for me and hardly has some overhead atleast in term of performance. It takes a bit of a setting up time + memory which doesnt matter.

So if you just wanna do the collision detection, you can use OPCODE easily but if you have time, I would also recommend you checking my post in the archive where someone has posted some good links which can help you detecting the collisions between a sphere/ray etc. directly with BSP (BSP being the optimized collision tree here). Apart from this, I suppose if you simple get the visible faces list (which you eventually get just before rendering), you can also apply simple sphere<>plane collision to all the faces or somethin like that..I guess it wont have much overhead either.

Now when it comes to Collision Response, I'm having some problems (due to my weak maths) which im gonna question in a seperate post. So if you know anything, read that and please answer.

Thanks,
Bilal

----- Original Message -----
From: "Aras Pranckevicius" <nearaz@interamotion.com>
Date: Mon, 5 May 2003 14:05:49 +0200 
To: <ode@q12.org>
Subject: Re: [ODE] BSP And ODE?

> > Im using Quake 3 BSP maps in my Engine, but Im trying to use ODE with it..
> > What is the best way to use ODE with BSP files? I want objects to bounce
> > round my map.
> > BSP files are made up of lots of static faces that I would want ODE to
> class
> > as solid unmovable walls.
> > Please take time answering in as much detail as possible.
> 
> There was a thead on this subject not long ago "BSP and ODE's collision
> system" - around April 21st...
> 
> In short: in it's current implementation, ODE's collision system has no
> native support for BSP. You can try to do several things:
> 1. use some other collision detection library and skip ODE's collision part
> (and still use ODE's physics sim part)
> 2. implement and plug BSP collider into ODE's collision system :)
> 3. approximate your walls and other geometry by bunch of native ODE
> collision primitives (boxes, etc.).
> 4. build a triangle mesh (or, better, several meshes) from your level
> geometry and use TriCollider contribution for collision.
> 
> 
> Aras Pranckevicius aka NeARAZ
> http://www.gim.ktu.lt/nesnausk/nearaz/
> 
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode

-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup