Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Proper collision response in a 3D engine?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 hegrec   Members   -  Reputation: 100

Like
0Likes
Like

Posted 19 February 2012 - 07:41 PM

Hello all, I am working on making a simple 3D Physics engine for rigid bodies, and have been wondering about the proper way to implement collision response, if there even is a proper way. As of right now, I have been simply doing the Hyperplane Axis Seperation test, and getting a "push" vector, and setting the position of entities to not penetrate the world or other entities. This has been working pretty well, but I was wondering if using impulse based responses would yield any better results, as some things seem to act funny. I guess my real question is, with full force integration applying gravity and all that stuff, is it possible to say, once you hit the floor in a map, apply an impulse to cancel out gravity without bobbing the player up and down, or is setting the position of the player the only real way to ensure a steady response without jittering?

Would using explicit position setting for entity-world collisions, and impulse based response for dynamic entity-entity collisions yield any better results?

Sponsor:

#2 Krohm   Crossbones+   -  Reputation: 3167

Like
0Likes
Like

Posted 20 February 2012 - 02:33 AM

You're embarking on a seriously difficult project. For sure, you need to somehow track some permanent informations about "almost there collisions": Bullet calls them manifolds and they're somehow used for stability improvements as well as performance AFAIK.
As far as I've understood, Bullet will use this information (together with impulse thresholds) to figure out when to just rest/sleep a certain object. I also suggest to look into damping.

As for your specific question, I'm afraid I cannot directly answer that but I find extremely scary the fact your physics would end up presenting different behavior for world and entities. Whatever this would be "better" or not I cannot tell but by sure it might end up giving diverging simulations; coherency is king. Think if you can allow that. I spent like 1 month in making this problem go away.

Edited by Krohm, 20 February 2012 - 02:34 AM.


#3 maxgpgpu   Crossbones+   -  Reputation: 280

Like
0Likes
Like

Posted 03 March 2012 - 11:15 AM

I'll mention just one dirty but accurate trick to consider to avoid jittering. Do not perform collision detection or collision response for any object that did not move or rotate since last frame. Jitter == gone. If your problem is that physics computations always end up with objects moving microscopically, and therefore always entering into collision detection and response computations, select a threshhold below which you simply set the object position (more or less "in contact") and set the object velocities and accelerations to zero [relative to the contact object], and then implement my first trick.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS