Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Mar 12, 2012 8:21 pm 
Offline

Joined: Mon Feb 13, 2012 2:45 pm
Posts: 7
Hello. I am a new game developer, I started developing a few months ago, and I decided to try and make a racing game. I am using bullet for my vehicle physics, but I have a small problem. I want to make a button which will allow you to select a new vehicle, but I want the current vehicle to be destroyed. I am using RaycastVehicle, and I have bullet physics engine integrated with another engine. So far I tried this:

Code:
Model *player = GetTargetNode();

   BulletScene *rootScene = static_cast<BulletScene *>(TheBulletExtrasPlugin->GetRootScene(GetTargetNode()->GetWorld()->GetRootNode()));
   btDiscreteDynamicsWorld *dynamicsWorld = rootScene->GetDiscreteDynamicsWorld();

   if(player->FindNode("Chassis"))
   {
      body->setActivationState(WANTS_DEACTIVATION);
      dynamicsWorld->removeRigidBody(body);
      dynamicsWorld->removeVehicle(vehicle);
   }


Some of the functions might be from C4 though, but I hope you might get an idea what I have done so far. With this code, when I run it the car stops moving, I cant move at all, although the game does not crash, it doesn't do anything, but my model(car) is still there... what else can I try to do?


Top
 Profile  
 
PostPosted: Sat Mar 17, 2012 4:23 pm 
Offline

Joined: Tue Feb 28, 2012 7:34 pm
Posts: 8
I don't see any of code corresponding to removal of model itself. So, it is not the Bullet question, I think.


Top
 Profile  
 
PostPosted: Sun Mar 18, 2012 8:43 pm 
Offline

Joined: Mon Feb 13, 2012 2:45 pm
Posts: 7
I fixed it, thanks anyway


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 1 guest


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