This project has moved and is read-only. For the latest updates, please go here.

gravitycontroller : linear and distance squared reversed?

Topics: Developer Forum, User Forum
Jul 11, 2013 at 8:38 AM
I was looking at the GravityController and noticed that the two types of forces are switched
                    switch (GravityType)
                        case GravityType.DistanceSquared:
                            f = Strength / r2 / (float)Math.Sqrt(r2) * body1.Mass * body2.Mass * d;
                        case GravityType.Linear:
                            f = Strength / r2 * body1.Mass * body2.Mass * d;
Also linear may as well be written:
                            f = Strength / r * body1.Mass * body2.Mass * d;
(r was previously declared)
Nitpicky, I know, but may as well keep it simple.
Jul 16, 2013 at 3:43 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.