Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Mar 14, 2012 10:16 am 
Offline

Joined: Wed Mar 14, 2012 9:58 am
Posts: 3
Hi,
I'm doing a sort of marble game using bullet physics. Everything works fine, but I have just one small issue.
There are some platform in the game that are key frame animated. They are kinematic object and the animation and collision detection works. One of these platform is a a sort of "disc" spinning constantly along its up vector. When my sphere collide with this object it start to rotate in the opposite direction of the spinning disc and the the sphere position didn't change. What I want to achieve is that the ball feels more "heavy" and follow the disc spinning trajectory.
I tried to increase mass and gravity and it behave the same, I also tried to change the friction of the two object but doesn't seem to change at all. The only thing that seems to work is to set the angular damping to 1 but in this case the sphere stop to rotate at all even when I'm going to move trough user input (even if I apply torque or modify the linear velocity). It doesn't seem to be something related to the fact that the object is animated by keyframes, I tried to achieve the same animation applying a angular velocity along Z axis and I have the same issue.

Maybe I miss something, what do you suggest to solve the issue?
Thanks.


Top
 Profile  
 
PostPosted: Thu Mar 15, 2012 1:18 pm 
Offline

Joined: Sun Jan 29, 2012 10:01 pm
Posts: 49
Try increasing the local inertia.


Top
 Profile  
 
PostPosted: Thu Mar 15, 2012 4:29 pm 
Offline

Joined: Wed Mar 14, 2012 9:58 am
Posts: 3
It seems that the only way to change the local inertia is to use calculateLocalInertia on a collision shape using a mass parameter.
The disc doesn't have any mass because I don't want it move by the gravity, but just by the animation.


Top
 Profile  
 
PostPosted: Thu Mar 15, 2012 6:36 pm 
Offline

Joined: Sun Jan 29, 2012 10:01 pm
Posts: 49
The local inertia is just a vector that you can set to btVector3(0.7f, 0.7f, 0.7f) when creating your rigid body.


Top
 Profile  
 
PostPosted: Fri Mar 16, 2012 9:51 am 
Offline

Joined: Wed Mar 14, 2012 9:58 am
Posts: 3
Hi,

I've tried to set up a local inertia that is greater by the one calculated using the collision shape. The only difference is that the sphere now tend to stop or change direction with delay when there is user input. When It goes trough the disc , it has the same behaviour as the previous version.


Top
 Profile  
 
PostPosted: Sun Mar 18, 2012 8:39 am 
Offline

Joined: Tue Dec 25, 2007 1:06 pm
Posts: 315
anakabeth wrote:
Maybe I miss something, what do you suggest to solve the issue?
No, I don't think you're missing anything. I think it's an interesting problem: according to your post it seems that kinematic objects have a bigger influence on the inertia than on the mass of a btSphereShape.
I don't have any solution, but I think I'd try one of the following:
1) replace the btSphereShape with a btMultiSphereShape with a single sphere inside and see if the problem persists.
2) use a very high custom friction (e.g. 10-50) through a custom material callback and see if something changes (I'm not sure, but maybe without a custom material callback the friction is clamped to 1).
3) try to modify the split impulse property of the simulation (turn it on if it's disabled).

Hope some of these ideas might be helpful :idea:


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 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