# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
Author Message
 Posted: Tue Oct 20, 2009 10:32 am

Joined: Mon Oct 12, 2009 2:11 pm
Posts: 4
Hi,

I've got a static world consisting of collision boxes and a moving camera that is surrounded by a collision sphere. When the camera collides with e.g. a wall in the world a callback notifies me of this collision.

Then I try manually to compute the position the camera should move to. I use the bullet physics only for detecting this collisions.

I compute the new position of the camera sphere with the following code. m_kCollisionPoint is a btManifoldPoint object. rkDesiredPosition is the position that would have been set if no collision would have been detected.

Vector kGlobalNormalOnSphere = m_kCollisionPoint.m_normalWorldOnB;
float fIndentationDepth = m_kCollisionPoint.m_distance1;

Vector kNewPosition(
rkDesiredPosition +
-kGlobalNormalOnSphere * abs( fIndentationDepth));

This works fine in most cases. At the contact edge of two collision boxes problems occure. The camera is like flickering (moving some degree to the left, right, left, right... ). There is obviously a collision detected between the collision sphere and collision box 1 and also a collision between collision sphere and collision box 2. My computation is pushing the camera from one position to another back to the first one and so on...

Does someone have an idea how to modify my computation to solve this problem?

KayJ

 Attachments: collisionboxes.jpg [ 43.11 KiB | Viewed 368 times ]
Top

 Posted: Thu Oct 22, 2009 1:18 am

Joined: Thu Oct 22, 2009 12:50 am
Posts: 12
Maybe you could try use the character controller and let it solve the collision for you, it probably a fairly good match to what you try to do.

Another approach could be to use convexSweepTest and move the sphere to where it start collide instead of first moving and then compensate which it sounds like you're doing.

Top

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

 All times are UTC

#### Who is online

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