# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 4 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Rigid body not able to stand stillPosted: Sat Jul 07, 2012 1:09 am

Joined: Mon Jun 04, 2012 11:40 pm
Posts: 14
Hello all.

Again, I have a problem that must be trivial to fix, but I was not able to do so on my own...

I have an upright (limited angular factor) rigid body that can be moved around. I have a camera which is moved by around by following this body. However, sometimes, the rigid body is not able to stand still, it does a very minimal bounce along the Y axis, as it would try to penetrate the ground. And since the camera follows this body, it shakes vertically as well because of this...

The shape of the rigid body doesn't seems to matter, I've tried all the diferent shapes, and this happened with all of them. Neither it seems to depend on the situation: sometimes it's absolutely fine after falling or when on a slope, and sometimes it shakes when it has been moved minimally on a completely flat, even surface.

When I enable deactivation, it stands still (of course), but then after it fallen asleep, I'm not able to move it any more (of course). I'm sure it can be stopped somehow since it happens randomly, sometimes it's resting absolutely fine.

Top

 Post subject: Re: Rigid body not able to stand stillPosted: Sun Jul 08, 2012 11:52 am

Joined: Sun Jul 08, 2012 11:32 am
Posts: 59
How are you making it sleep, are you updating sleep state after updating the position? Perhaps you can play around with the sleep epsilon value if the body keeps moving with low kinetic energy.

Top

 Post subject: Re: Rigid body not able to stand stillPosted: Sun Jul 08, 2012 12:36 pm

Joined: Mon Jun 04, 2012 11:40 pm
Posts: 14
Since it's an interactive object, it never sleeps (otherwise I would loose control over it). To make it stop when there's no input, I reset it's position to Vector3(0, getY, 0) in each frame before the input processing takes place. getY is getGravity().getY(), and I think the issue could be there. However, as I said, sometimes it stands in place perfectly, and this behavior seems to happen completely randomly, regardless of the physics situation.

Top

 Post subject: Re: Rigid body not able to stand stillPosted: Sun Jul 08, 2012 1:13 pm

Joined: Sun Jul 08, 2012 11:32 am
Posts: 59
Ah yes, my bad, gravity will always act on it since its player controlled. However, if you do put it to sleep and wake it up when you manually apply player forces (with a manual call to a setAwake function), thats 1 idea. Or apply impulses over several iterations if you're using those to resolve collisions. Box2D lite has a technique of warmstarting that seems to stabilize objects with resting contact. Get box2D lite from Erin Catto's 2009 presentation.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 4 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: fractile, xexuxjy and 5 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