Collision with high speed object (ccd)
2 posters
Collision with high speed object (ccd)
I create small rigid body object with cylinder collision shape and big box static object with box collision shape. I apply impulse to my small object:
With 90% probability it collision with big box and bounce.
With 10% probability my small object move through big box.
My physic render code:
I think that i do not enable continuous collision detection (ccd) and call that function for my small object:
but that not help me.
What code i must edit or paste for 100% chance to collision and bounce?
I looked http://www.bulletphysics.com/Bullet/phpBB3/ but not found easy solution, but all wrote that bullet support ccd.
I am confusion
- Code:
//direciton - unit vector
//power - value between 60 and 80
obj->applyImpulse(direction*power, btVector3(0,0,0));
With 90% probability it collision with big box and bounce.
With 10% probability my small object move through big box.
My physic render code:
- Code:
btSoftRigidDynamicsWorld->stepSimulation( 1.0f / 60.0f, 0 )
I think that i do not enable continuous collision detection (ccd) and call that function for my small object:
- Code:
obj->setCcdMotionThreshold( 0.5f );
obj->setCcdSweptSphereRadius( 0.2*0.5f );
but that not help me.
What code i must edit or paste for 100% chance to collision and bounce?
I looked http://www.bulletphysics.com/Bullet/phpBB3/ but not found easy solution, but all wrote that bullet support ccd.
I am confusion
soniccat- Posts : 10
Join date : 2009-07-15
Re: Collision with high speed object (ccd)
Increase the simulation step to a level that you feel is acceptable...
Re: Collision with high speed object (ccd)
If i write:
On device ( and simulator ) game run slowly. I want that player see high object speed.
And if i increase implulse power to 200 i will have same miss effect.
- Code:
sio2PhysicRender( sio2->_SIO2physic, 1.0f / 200.0f, 1 );
On device ( and simulator ) game run slowly. I want that player see high object speed.
And if i increase implulse power to 200 i will have same miss effect.
soniccat- Posts : 10
Join date : 2009-07-15
Re: Collision with high speed object (ccd)
More like:
sio2PhysicRender( sio2->_SIO2physic, 1.0f / 60.0f, 4 or 8 or something between that );
sio2PhysicRender( sio2->_SIO2physic, 1.0f / 60.0f, 4 or 8 or something between that );
Re: Collision with high speed object (ccd)
Thanks
That really better. I set _pass = 4 in sio2PhysicRender because with _pass=6 i have slower game speed.
But sometimes this decision miss collision check cylinder shape with triangle shape. I bound my static triangle mesh with ghost static boxes in blender and now i check collision only with bound boxes. That give me good collision detect and bounce.
That really better. I set _pass = 4 in sio2PhysicRender because with _pass=6 i have slower game speed.
But sometimes this decision miss collision check cylinder shape with triangle shape. I bound my static triangle mesh with ghost static boxes in blender and now i check collision only with bound boxes. That give me good collision detect and bounce.
soniccat- Posts : 10
Join date : 2009-07-15
Similar topics
» Use object only for collision
» Collision for animate object
» iPhone 3D CPU & Bus Speed
» Collision system
» physics object inside another physics object
» Collision for animate object
» iPhone 3D CPU & Bus Speed
» Collision system
» physics object inside another physics object
Permissions in this forum:
You cannot reply to topics in this forum