BSP problem

Eltran
Posts: 9
Joined: Sun Nov 25, 2007 5:50 pm

BSP problem

Post by Eltran »

-removed-
Last edited by Eltran on Sat Mar 15, 2008 7:55 pm, edited 1 time in total.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: BSP problem

Post by Erwin Coumans »

Does the .bsp file work properly when loaded in the unmodified BspDemo (shoot boxes using . or mouse) ?

If so, it would be best to do a side-by-side comparison,

Thanks,
Erwin
Eltran
Posts: 9
Joined: Sun Nov 25, 2007 5:50 pm

Re: BSP problem

Post by Eltran »

Ok, I will try that this weekend, I've never compiled an app with OpenGL, could you tell me please what will I need to try the example with my BSP map ?

Thanks.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: BSP problem

Post by Erwin Coumans »

Just compile the Bullet demos: if you using Visual Studio, just open the wksbullet.sln solution, and compile.

Then execute with one argument (easiest from a command line)
BspDemo quake3mapname.bsp

Hope this helps,
Erwin
Eltran
Posts: 9
Joined: Sun Nov 25, 2007 5:50 pm

Re: BSP problem

Post by Eltran »

Ok thanks,
The problem was the following : The game was using the RBSP format instead of IBSP. So I compiled the same map with the quake 3 compiler and loaded it in the Bullet, works perfectly !

But, when my cube doesn't have to move (when I don't shoot in it, it must be static), it moves every frame with a very little milimeter... what should I do ?

Thanks.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: BSP problem

Post by Erwin Coumans »

Can you make sure the dimensions of the objects are in meters?
I noticed gravity of 800, which is very large. Moving objects should be typically in the range of 0.3 (30 centimeter) to 5 meter, roughly.

Also, make sure you didn't disable sleeping (deactivation) of objects, so after a while, objects should settle down, unless an active object is closeby/touching.

Hope this helps,
Erwin
Eltran
Posts: 9
Joined: Sun Nov 25, 2007 5:50 pm

Re: BSP problem

Post by Eltran »

800 is the default gravity in the game... weird, I'll see that later.
And yes, that's true, when I shoot on a box that I haven't hit for like 30 seconds, it freezes. I added body->activate(true), maybe it solves the problem.

Err, this is the first time I do collisions, but... How do you calculate the damage by using the box's velocity and it's mass when you receive it in the head ? (just tell me if I have to make a new thread).

Thanks.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: BSP problem

Post by Erwin Coumans »

body->activate(true) keeps the object active/moving. Is is better not to call this, because it prevents objects to settle down/deactivate.

It would be best to apply some scaling between the game and the physics, but this might be some work. How large are the objects?

For damage you can use the applied impulse at the point of contact. A new demo will be added in Bullet 2.65 to show how to easy get access to this, it can also be useful for collision sensors and callbacks etc. There are various methods (please browse the forums a bit), but it is easier to just wait for the next release, which should happen soon (within a week or 2).

Thanks,
Erwin
Eltran
Posts: 9
Joined: Sun Nov 25, 2007 5:50 pm

Re: BSP problem

Post by Eltran »

-removed-
Last edited by Eltran on Sat Mar 15, 2008 7:55 pm, edited 1 time in total.
Eltran
Posts: 9
Joined: Sun Nov 25, 2007 5:50 pm

Re: BSP problem

Post by Eltran »

-removed-