btRigidBody and Heightfield fluid

Post Reply
RJNelson68
Posts: 73
Joined: Tue Oct 06, 2009 3:19 pm

btRigidBody and Heightfield fluid

Post by RJNelson68 »

I would just like to know how would you go about making a btRigidBody float in a heightfield fuild?
RJNelson68
Posts: 73
Joined: Tue Oct 06, 2009 3:19 pm

Re: btRigidBody and Heightfield fluid

Post by RJNelson68 »

I would like to add that I have tried the method in the demo and it failed for me. Also I am integrating this into Torque Game Engine Advanced version 1.8.1. I made the needed updates to the libries so it would render the surface and box in debug mode, so I know its present and in the right place.
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA
Contact:

Re: btRigidBody and Heightfield fluid

Post by John McCutchan »

Hi,

You need to use the btHfFluidBuoantConvexShape as well as set the "floatyness".

John
RJNelson68
Posts: 73
Joined: Tue Oct 06, 2009 3:19 pm

Re: btRigidBody and Heightfield fluid

Post by RJNelson68 »

Yeah I tried that and I get a crash here.

btScalar btConvexShape::getMarginNonVirtual () const
{
switch (m_shapeType)<<<<<<<<<<<<<<<<<< HERE

If I just use the btHfFluidBuoyantConvexShape in creating the btRigidBody, it has no collision.
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA
Contact:

Re: btRigidBody and Heightfield fluid

Post by John McCutchan »

Hi,

You should have a crash there.

Does the btHfFluid demo work properly for you?

John
RJNelson68
Posts: 73
Joined: Tue Oct 06, 2009 3:19 pm

Re: btRigidBody and Heightfield fluid

Post by RJNelson68 »

Yes it does. I assume I am missing something here?
RJNelson68
Posts: 73
Joined: Tue Oct 06, 2009 3:19 pm

Re: btRigidBody and Heightfield fluid

Post by RJNelson68 »

I looked at the demo pretty thoroughly, its only using the btHfFluidBuoantConvexShape which when I use that method I cannot use the btRigidBody for anything else.
RJNelson68
Posts: 73
Joined: Tue Oct 06, 2009 3:19 pm

Re: btRigidBody and Heightfield fluid

Post by RJNelson68 »

John, you said it should crash there. Why? Am I doing something wrong?
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA
Contact:

Re: btRigidBody and Heightfield fluid

Post by John McCutchan »

Sorry, I meant it shouldn't.

John
RJNelson68
Posts: 73
Joined: Tue Oct 06, 2009 3:19 pm

Re: btRigidBody and Heightfield fluid

Post by RJNelson68 »

Thanks John, nice demo your wrote by the way. I am curious though, why do the libraries only work for spheres? Also, is this something you guys are planning to expand upon in a future version?
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA
Contact:

Re: btRigidBody and Heightfield fluid

Post by John McCutchan »

Hi,

Buoyant objects can have any convex collision shape (not just spheres). At some point I would like to revisit this and expand on it. Performance is a major issue. Supporting non-convex shapes should be fairly easy and there was a paper at SIGGRAPH this year that talked about an algorithm for non-reflective edges on water.

John
Post Reply