# Physics Simulation Forum

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Force Computation Without VelocityPosted: Wed Apr 04, 2012 4:05 pm

Joined: Sun Jan 15, 2012 11:19 pm
Posts: 2
I have two mesh shapes. When their positions collide with each other, how can I compute their forces due to the collision. In my scenario, I have not any velocity, I can just give their positions. And I should not use glutStuff or OpenGL functions.

int numManifolds = m_dynamicsWorld->getDispatcher()->getNumManifolds();
for (int i=0;i<numManifolds;i++)
btPersistentManifold* manifold = m_dynamicsWorld->getDispatcher()->getManifoldByIndexInternal(i);
for (int p=0;p<manifold->getNumContacts();p++)
totalImpact += manifold->getContactPoint(p).m_appliedImpulse;

This code is working after I call glutMainLoop() but I want to ignore glut functions. I do not want to draw anything, I just want to compute the forces.

Thank you.

Top

 Post subject: Re: Force Computation Without VelocityPosted: Thu Apr 05, 2012 1:14 pm

Joined: Tue Feb 20, 2007 4:56 pm
Posts: 190
If there's no velocity, those impulses are presumably going to be zero. Most game physics engines depend on solving contact impulses to resist penetration by clipping the penetration velocity to zero.

I don't know what your application is, but it sort of sounds like you want to estimate the force based on the depth and normals of the contact points, plus some 'spring rate' that you provide. It's going to be highly imperfect, since you'll only be getting the 4 "best" contact points from Bullet. But if that's the way you need to go, then the force vector would equal spring_rate*depth*normal, and you'd apply it at the point of contact.

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 ]

#### Who is online

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