Hi,
i tried to implement vehicle demo in my rendering engine and its working fine.
Now i am using btbvhtrianglemesh for walls, my vehicle is colliding with wall and behave perfectly like original practical vehicle but at the same time at very high speed its unstable (as after colliding its roll over). so i need to make vehicle stable.
But i don't know what physics should i need to update on collision detection and how?
and how can i get callback function with that particular wall objects?
Please help.
Collision Response
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: Collision Response
you may try collision callbacks, once you detect the collision between the vehicle and wall, a callback is triggered, then you decide whether or not to take some actions to stablize your car.
http://bulletphysics.org/mediawiki-1.5. ... d_Triggers
But actually, the cars will roll over if it is too fast...so why do you want to correct it? Just start over from a default position, that's what most racing games do!
http://bulletphysics.org/mediawiki-1.5. ... d_Triggers
But actually, the cars will roll over if it is too fast...so why do you want to correct it? Just start over from a default position, that's what most racing games do!
-
- Posts: 28
- Joined: Mon Aug 29, 2011 11:02 am
Re: Collision Response
Thanks for reply,Dr.Shepherd wrote:you may try collision callbacks, once you detect the collision between the vehicle and wall, a callback is triggered, then you decide whether or not to take some actions to stablize your car.
the car's tyres will always collided with the ground which is made up of bvhtrianglemesh and the vehicle's body will collide with the walls ( that are also made of bvhtrianglemesh). Then i don't think btpersistentmanifold will useful for my case, i think btghost object will be useful for me but its not that clear in explanation.
Do you have any documentation link for btghost object collision callback? OR is there any method to check collision callbacks using btpersistentmanifold?
Please help.
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: Collision Response
http://bulletphysics.org/mediawiki-1.5. ... d_Triggers
This is the tutorial link for ghostobject, but many people complained that it is out of date, because there is no "getOverlappingPairCache()" in the btGhostObject class.
But you can define the ghostObject as "btPairCachingGhostObject ", rather than "btGhostObject", the previous one is inherited from the latter one and has the function: "getOverlappingPairCache()".
By this replacement, you can use the code in the tutorial example.
Actually I am writing a little tutorial on how to use GhostObject, it seems that we really need to make the documentation better.
This is the tutorial link for ghostobject, but many people complained that it is out of date, because there is no "getOverlappingPairCache()" in the btGhostObject class.
But you can define the ghostObject as "btPairCachingGhostObject ", rather than "btGhostObject", the previous one is inherited from the latter one and has the function: "getOverlappingPairCache()".
Code: Select all
btManifoldArray manifoldArray;
btBroadphasePairArray& pairArray = ghostObject->getOverlappingPairCache()->getOverlappingPairArray();
int numPairs = pairArray.size()
Actually I am writing a little tutorial on how to use GhostObject, it seems that we really need to make the documentation better.
-
- Posts: 28
- Joined: Mon Aug 29, 2011 11:02 am
Re: Collision Response
Thanks for your quick reply.
Well i read some old posts on ghostobject and now i am more confused than earlier.
i have a car which is implemented by ray cast method.
As given in the linkhttp://bulletphysics.org/mediawiki-1.5. ... d_Triggers, i tried contact manifold method and i am getting no collision detection for the tyres on ground. So if i want to know whether my car is on the road or on the grass, then how can i do that?
Secondly manifold method is giving me the contact point with walls, Do you have any link for iteration over the contact manifolds techniques because in my game there are different types of wall objects?
FYI: road and walls are of bvhtrianglemesh objects.
OR should i have to use ghostobjects?
Well i read some old posts on ghostobject and now i am more confused than earlier.
i have a car which is implemented by ray cast method.
As given in the linkhttp://bulletphysics.org/mediawiki-1.5. ... d_Triggers, i tried contact manifold method and i am getting no collision detection for the tyres on ground. So if i want to know whether my car is on the road or on the grass, then how can i do that?
Secondly manifold method is giving me the contact point with walls, Do you have any link for iteration over the contact manifolds techniques because in my game there are different types of wall objects?
FYI: road and walls are of bvhtrianglemesh objects.
OR should i have to use ghostobjects?