FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Collision with high speed object (ccd)

2 posters

Go down

Collision with high speed object (ccd) Empty Collision with high speed object (ccd)

Post  soniccat Wed Sep 02, 2009 7:22 am

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:
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 Sad

soniccat

Posts : 10
Join date : 2009-07-15

Back to top Go down

Collision with high speed object (ccd) Empty Re: Collision with high speed object (ccd)

Post  sio2interactive Wed Sep 02, 2009 3:41 pm

Increase the simulation step to a level that you feel is acceptable...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Collision with high speed object (ccd) Empty Re: Collision with high speed object (ccd)

Post  soniccat Thu Sep 03, 2009 2:52 am

If i write:
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

Back to top Go down

Collision with high speed object (ccd) Empty Re: Collision with high speed object (ccd)

Post  sio2interactive Thu Sep 03, 2009 3:00 am

More like:

sio2PhysicRender( sio2->_SIO2physic, 1.0f / 60.0f, 4 or 8 or something between that );
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Collision with high speed object (ccd) Empty Re: Collision with high speed object (ccd)

Post  soniccat Thu Sep 03, 2009 4:23 am

Thanks Smile
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

Back to top Go down

Collision with high speed object (ccd) Empty Re: Collision with high speed object (ccd)

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum