Physics Simulation Forum


All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue May 22, 2012 8:48 am 

Joined: Tue Nov 29, 2011 11:16 am
Posts: 1

I am solving collisions with static/kinematic objects that afterwards need to be dynamic in a way that is giving me some problems.

I was wondering if I am doing something wrong or there are better alternatives.
Here is an example of the problem:

* I am simulating vehicle traffic using animated entities with a Kinematic box attached to them.
Once the box detects a collision with certain objects which are dynamic rigid bodies, I transform the traffic vehicle's attached kinematic box into a dynamic one in order to react properly to the collision.

The transition between kinematic and dynamic is triggered by the gContactAddedCallback.
When the traffic vehicle receives this callback I set a flag that in the next update will remove the kinematic box and create a dynamic one in its place.

This works... but not too well.

Since I have to wait to the next update to swap kinematic box for a dynamic one (during the call back I cannot add/remove objects to the simulation... am I correct?) the vehicles have moved a bit and their rigid bodies are inside each other.
This results in a very unrealistic collision where the vehicles jump up (looks like an explosion) in order separate their collision boxes.

I was wondering if there is a better way of doing this.
Can I change the nature of a rigid body (e.g. from static/kinematic to dynamic) before the next update?

Please bear in mind that I need at this stage the traffic vehicles to be animated, so to change this right now is not an option.

Thanks in advance


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: Google [Bot] and 11 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