# Physics Simulation Forum

 All times are UTC

 Page 1 of 2 [ 19 posts ] Go to page 1, 2  Next
 Print view Previous topic | Next topic
Author Message
 Post subject: Contact point changes depending on heightPosted: Mon Jan 16, 2012 5:17 pm

Joined: Thu Mar 24, 2011 3:50 pm
Posts: 39
Hi,

I have a demo of an object falling, and colliding with a static cube (which represents the floor).

I am trying to extract information about the first contact (force and contact point). The problem is that, depending on the height from which I drop the object, the contact point changes.

I changed the simulation step to be:

Code:
m_dynamicsWorld->stepSimulation(ms / 1000000.f, 1 , btScalar(1.)/btScalar(300.));

I've also added this initial code:

Code:
m_dynamicsWorld->getDispatchInfo().m_useContinuous=true;
body->setCcdMotionThreshold(0.01);

I need the contact point to be the same (or very similar) in each example. ¿Any ideas?

Top

 Post subject: Re: Contact point changes depending on heightPosted: Tue Jan 17, 2012 9:26 am

Joined: Thu Mar 24, 2011 3:50 pm
Posts: 39

Top

 Post subject: Re: Contact point changes depending on heightPosted: Tue Jan 17, 2012 11:33 am

Joined: Wed Jan 07, 2009 11:43 am
Posts: 98
Location: London
What sort of variation are you getting (and what height values are you using) ? if you're dropping from a different height it's possible that it will have higher velocity and may penetrate further before being pushed back out again.

Top

 Post subject: Re: Contact point changes depending on heightPosted: Tue Jan 17, 2012 12:00 pm

Joined: Thu Mar 24, 2011 3:50 pm
Posts: 39

I'm dropping the ball from 1 meter, and from 3 meters.

I am getting difference of contact points of about 0.5 meters. I know its not much, but I want to know what can I do to improve this.

The objects I am using are always convex, so the continuous collision detection should be working. I don't care if the simulation is slower...

Top

 Post subject: Re: Contact point changes depending on heightPosted: Tue Jan 17, 2012 1:38 pm

Joined: Wed Jan 07, 2009 11:43 am
Posts: 98
Location: London
Sorry I'm at work so can't actually run this stuff through and see what happens, but do you get consistent results if you use the standard discrete collision detection? Also what size are your objects? could you post your demo code to make it easier to re-create?

Thanks.

Top

 Post subject: Re: Contact point changes depending on heightPosted: Tue Jan 17, 2012 6:11 pm

Joined: Thu Mar 24, 2011 3:50 pm
Posts: 39
Ok, here it is. Thanks again for your help.

This is the BasicDemo file I'm using. I had to delete some information that did not affect the demo, because it took too much space.

Anyway, I use a very large sphere (18 meter diameter), and throw it from 1 meter and 3 meters high.

I am pretty sure this is about continuous collision detection, because I want to know the first contact point. So I did not make any discrete collision detection tests.

Top

 Post subject: Re: Contact point changes depending on heightPosted: Tue Jan 17, 2012 8:23 pm

Joined: Wed Jan 07, 2009 11:43 am
Posts: 98
Location: London
Can't see anything particularly wrong with what you've got. Though as there are external dependenices I can't run your example. You said you're using a sphere to test, have you tried using a sphere shape to simplify things first?
replace btBvhTriangleMeshShape* triMeshShape = new btBvhTriangleMeshShape(mTriMesh,true,true) with btSphereShape* meshShape = new btSphereShape(9.0f) .

Just to confirm , are you on the latest bullet version (2.79 ) ?

Top

 Post subject: Re: Contact point changes depending on heightPosted: Wed Jan 18, 2012 9:52 am

Joined: Thu Mar 24, 2011 3:50 pm
Posts: 39

To test I use a sphere, but later I will use other non-sphere objects, so I prefer no to change the bounding volume shape.

As I said, the contact points are similar, but I want to know a way to reduce the distance between these points. I tried reducing the timestep, but that did not work.

Top

 Post subject: Re: Contact point changes depending on heightPosted: Wed Jan 18, 2012 10:43 am

Joined: Thu Mar 24, 2011 3:50 pm
Posts: 39
I tried the new version of bullet, and still got the same result. Different contact points.

Top

 Post subject: Re: Contact point changes depending on heightPosted: Wed Jan 18, 2012 12:01 pm

Joined: Fri Aug 01, 2008 6:36 am
Posts: 144
Location: Bonn, Germany
Code:
body->setCcdMotionThreshold(0.00001);

Not sure ccd motion clamp will help here, more likely it will harm, specially with the above values (microscopic squared velocity threshold and embedded sphere radius of 1/100000 m for 18 m sphere).
Try increase internal simulation frequency to 120 Hz, but without ccd, it might help a little..
Look about motion clamping here http://bulletphysics.org/mediawiki-1.5.8/index.php/Anti_tunneling_by_Motion_Clamping.

P.S. I couldn't complile and test your code, but it may have memory leaks, i mean "new" btVector3s in ObtainForces().

Top

 Post subject: Re: Contact point changes depending on heightPosted: Wed Jan 18, 2012 12:16 pm

Joined: Thu Mar 24, 2011 3:50 pm
Posts: 39
> Try increase internal simulation frequency to 120 Hz, but without ccd, it might help a little..

I do that by doing:

Code:
m_dynamicsWorld->stepSimulation(1.0/120.0);

or
Code:
m_dynamicsWorld->stepSimulation(ms / 1000000.f,1,1./120.);

??

Anyway, if a disable ccd, I probably would always get different collision points. Right? I'll try it anyway.

Top

 Post subject: Re: Contact point changes depending on heightPosted: Wed Jan 18, 2012 12:56 pm

Joined: Fri Aug 01, 2008 6:36 am
Posts: 144
Location: Bonn, Germany
i mean m_dynamicsWorld->stepSimulation(ms / 1000000.f,1,1./120.);
(not necessary 1 max substep)

Top

 Post subject: Re: Contact point changes depending on heightPosted: Wed Jan 18, 2012 1:30 pm

Joined: Thu Mar 24, 2011 3:50 pm
Posts: 39
Ok, I tried with and without ccd. I also change the timestep and I still get different contact points.

I need information about the first contact for my algorithm. The first contact should always be the same, or at least very similar, regardless of the height from which I drop the object. I am getting these results:

Height 1.0: Contact point -0.215801 -0.00808716 -0.500025
Height 1.5: Contact point -0.192411 1.23978e-005 -0.0634562
Height 2.0: Contact point -0.192411 -0.000154495 -0.0634562
Height 2.5: Contact point -0.168497 -0.00191689 -0.297103
Height 3.0: Contact point -0.168497 -8.13802e-005 -0.297103
Height 3.5: Contact point -0.567699 -0.00394678 -0.509197
Height 4.0: Contact point -0.602119 -0.00505352 -0.5731

As you can see, heights 1.5 and 2 are very similar, but height 1.0 is almost 0.5 meters away.

By the way, to calculate the contact point, I am calculating the mean of the contact points the contactManifold returns.

Top

 Post subject: Re: Contact point changes depending on heightPosted: Fri Jan 20, 2012 10:01 am

Joined: Thu Mar 24, 2011 3:50 pm
Posts: 39
How can I make ccd work properly?

Top

 Post subject: Re: Contact point changes depending on heightPosted: Tue Jan 24, 2012 9:34 am

Joined: Thu Mar 24, 2011 3:50 pm
Posts: 39
I still have this problem. So if anyone knows how I can fix it, please let me know.

Thank you!

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 2 [ 19 posts ] Go to page 1, 2  Next

 All times are UTC

#### Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], TheIvanHouse and 3 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities