gravitycontroller : linear and distance squared reversed?

Topics: Developer Forum, User Forum
Jul 11, 2013 at 7: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;
                            break;
                        case GravityType.Linear:
                            f = Strength / r2 * body1.Mass * body2.Mass * d;
                            break;
                    }
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.
Coordinator
Jul 16, 2013 at 2:43 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.