Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Erratic Collision Response


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 YOLO   Members   -  Reputation: 151

Like
0Likes
Like

Posted 19 March 2014 - 06:55 PM

First off I'm using the physics engine "Jitter Physics"  (http://code.google.com/p/jitterphysics/)

 

Two boxes colliding sometimes ends in both of them flying off in random directions. I have done quite a few modifications to the engine to support what I'm trying to do with it. Is there a common cause of this that I can look for?



Sponsor:

#2 LorenzoGatti   Crossbones+   -  Reputation: 2737

Like
0Likes
Like

Posted 20 March 2014 - 04:27 AM


I have done quite a few modifications to the engine to support what I'm trying to do with it. Is there a common cause of this that I can look for?

Bugs in your engine modifications, unless the original Jitter engine has the same problems.

 

How can you expect help without giving any detail of what you are doing? Common immediate causes of "flying off in random directions" include forces proportional to interpenetration depth (of unexpectedly large magnitude) and naive choices for the direction of such forces, but your problem might be less common.

In any case, your choices of accuracy tradeoffs (e.g. allowing interpenetration in order to limit forces), collision response rules (e.g. constraining bounce directions) and physically meaningful hacks (e.g. inelastic collisions) depend on your game's needs.


Edited by LorenzoGatti, 20 March 2014 - 11:26 AM.

Produci, consuma, crepa

#3 Buckeye   Crossbones+   -  Reputation: 5698

Like
0Likes
Like

Posted 20 March 2014 - 07:35 AM

As in most debugging efforts, a better approach than guessing/hacking is to find out what the problem is.

 

- create a reproducible example

- go to a part in your code where the problem manifests itself

- examine the data coming into that code, and the data going out of that code.

- the problem then is IN the code you're looking at, before that section, or after that section.

 

Follow the data and values. IF your starting values/data are good, find a place where it's bad. The problem is in-between.

 

Just FYI, the chances of posting a general description of a problem and someone posting "I had exactly the same problem. Change x=5 to x=6," are extremely unlikely.


Edited by Buckeye, 20 March 2014 - 07:39 AM.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.





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