Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sun Apr 29, 2012 4:02 pm 
Offline

Joined: Sun Apr 29, 2012 3:22 pm
Posts: 10
Hi!

I have a path with a concave triangle mesh collision shape (btBvhTriangleMeshShape), and a sphere (btSphereShape) on it. I call addForce on the rigid body of the sphere, in every tick, with a force vector paralell to the surface of the path. Now the path has a simple rectangular shape with many triangles of its top surface. In the future it will have concave shape. So now, the triangles of the surface of the path are coplanar, and are along the XZ plane. So I use addForce to my sphere, my sphere accelerates along the XZ plane (on the ground), and above a specific speed the sphere starts to bounce on the surface, along the vertical (Y) axis too. Small bounces first, but growing after, till I lower the speed. If I replace the btBvhTriangleMeshShape to btConvexHullShape temporarily then the bouncing disappear. If I change steptime from 1/60 to 1/200 the bouncing is less, but not disappear. The combined Friction and combined Restitution are zero both.

Can somebody say what I can do reaching not to start bouncing the sphere above a specific speed ?


Top
 Profile  
 
PostPosted: Sun Apr 29, 2012 9:36 pm 
Offline

Joined: Sun Apr 29, 2012 3:22 pm
Posts: 10
I tried another test:

I created a compound shape of many convex hull shapes from my concave path mesh. And the bouncing was there.

It seems, the only stable version of rolling a ball is when I use one convex shape for the path.

Probably the sphere gets vertical speed rolling at the triangle edges of coplanar triangles,
or the "edges" (borders) of convex hulls in the case of the compound shape of many convex hull shapes.

In both cases the parts of the surface are coplanar, and the adjacent vertex positions are the same. The only problem can be the precision of floats in the vertices, making triangles (or convex hull sides) of the surface of the path not exactly coplanar.

Can it be the problem ? And how can I eliminate it ?


Last edited by openeye on Tue May 01, 2012 12:41 pm, edited 2 times in total.

Top
 Profile  
 
PostPosted: Mon Apr 30, 2012 6:25 pm 
Offline

Joined: Sun Apr 29, 2012 3:22 pm
Posts: 10
I tried another test too:

I made my path with a btBvhTriangleMeshShape again, but I created it from a btTriangleIndexVertexArray istead of the former btTriangleMesh.

After this I call

btGenerateInternalEdgeInfo(pShape,pTriangleInfoMap);

with the btBvhTriangleMeshShape and a newly allocated btTriangleInfoMap.

After this I use

btAdjustInternalEdgeContacts(p_MP,p_pCollObj1,p_pCollObj0,p_PartID1,p_Idx1);

in my custom BtContactAddedCallBack.

I found this method in the InternalEdgeDemo sample application.

But unfortunately, the bouncing is the same. What can I do to eliminate that bouncing of my sphere ?

I would like my sphere to roll smoothly along the top surface of my path object without the bouncing in the vertical direction.


Top
 Profile  
 
PostPosted: Tue May 01, 2012 6:36 pm 
Offline

Joined: Sun Apr 29, 2012 3:22 pm
Posts: 10
I think that I found the "solution".

I hope there will be somebody who understand this and can explain why this is the situation:

So, the source of the bouncing is the internal edges of my concave mesh collision shape.

There is already a utility solution for this kind of problem in bullet, called "InternalEdgeUtility", and a demo sample called "InternalEdgeDemo".

I used this solution to my program, but this did not solve the bouncing in my situation.

This was because of the friction.

I use a big friction in my program, but the InternalEdgeDemo uses zero friction.

I configure the InternalEdgeDemo to a similar setup like my program. This setup is a bigger an longer, more dense grid, and a sphere collision shape on it, instead of those ones in the original InternalEdgeDemo.

If you download the modified InternalEdgeDemo from the attachment and compile and run it, press space to restart animation, press O for side view, and watch, that if you set zero friction in calculateCombinedFriction, then the sphere rolling smooth on the floor, and when you set for example .5 friction, then the sphere starts bouncing.

If you turn off "contact filtering" with key N, then the bouncing happens at zero friction, too. So the "internal-edge-anti-bouncing" solution works in bullet, but it seems, that it is accurate only at little friction values.

You can fire boxes with mouse, and with those bodies the situation is the same.

Now, the question is, that what is the connection between friction and "contact filtering", and why do I have to use small friction values ?


Last edited by openeye on Wed May 02, 2012 12:40 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue May 01, 2012 6:42 pm 
Offline

Joined: Sun Apr 29, 2012 3:22 pm
Posts: 10
It is the modified version of InternalEdgeDemo in the attachment.


Attachments:
File comment: It is the modified version of InternalEdgeDemo in the attachment.
InternalEdgeDemo.zip [9.23 KiB]
Downloaded 74 times
Top
 Profile  
 
PostPosted: Tue Jul 10, 2012 10:41 pm 
Offline

Joined: Tue Jul 10, 2012 10:38 pm
Posts: 4
I'm also seeing this problem with both the surface (btConvexHullShape) and the sphere (btSphereShape) created with m_restitution = 0.5 and m_friction = 1.0

Is the only solution to turn down the friction? The friction needs to be high in order for the ball to roll well. I'll try playing with the ball's mass to see if that helps.


Top
 Profile  
 
PostPosted: Thu Jul 12, 2012 4:06 pm 
Offline

Joined: Tue Jul 10, 2012 10:38 pm
Posts: 4
Perhaps Laurent Coulon's code improvements help this stability issue we are seeing?

viewtopic.php?f=9&t=8146

I'll have to give them a try.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 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