Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Fluid And Ship
PostPosted: Wed May 16, 2012 5:51 am 
Offline

Joined: Wed May 16, 2012 5:09 am
Posts: 7
Hi every one , :)
i want to use bullet physics to simulate ship behaviors on the water
-so i try to use HfFluid codes to simulate the water(fluid) and then i put a car vehicle on it !(i use AppVehicleDemo code to make my vehicle car), then i drop my vehicle on HftFluid ,

in finally buyoncy worked good and my car stay over the water , but when i add a force to ship(car) it not move to front

NOTE:
i try to use this code to make chaises body ship

btConvexShape* colShape = new btBoxShape(btVector3(5,0.5,5));
btHfFluidBuoyantConvexShape* buoyantShape = new btHfFluidBuoyantConvexShape(colShape);
buoyantShape->generateShape (btScalar(0.25f), btScalar(0.05f));

etc..

and i not use this local code :

Code:
localCreateRigidBody(80,tr,compound);//


also i use this code to add my vehicle to fluid worlds:

Code:
fluidDemo->getHfFluidDynamicsWorld()->addRigidBody(m_carChassis); //
m_vehicleRayCaster = new btDefaultVehicleRaycaster(fluidDemo->getHfFluidDynamicsWorld());// is this way to ray cast fluid surface true ?
m_vehicle = new btRaycastVehicle(m_tuning,m_carChassis,m_vehicleRayCaster);
///never deactivate the vehicle
m_carChassis->setActivationState(DISABLE_DEACTIVATION);
fluidDemo->getHfFluidDynamicsWorld()->addVehicle(m_vehicle);//


it's mean problem is here:
m_vehicleRayCaster = new btDefaultVehicleRaycaster(fluidDemo->getHfFluidDynamicsWorld());
the car will not cast the fluid surface and so not move

but i don't know how to fix that to raycast fluid surface.
it's my simple way but is there any other code or way to put ship vehicle on the HftFluid and ride it ?
can any one help me?

Thank you so much for your answers .


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Exabot [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group