There I fixed it.

master
q3k 2013-02-25 13:48:32 +01:00
parent a547bf8cd1
commit 863117a795
1 changed files with 3 additions and 5 deletions

View File

@ -96,10 +96,8 @@ var Mass = function(X, Y, Weight)
if (this.MouseTouched)
{
this.MouseTouched = false;
this.PX = this.X;
this.PY = this.Y;
this.X = this.MX;
this.Y = this.MY;
this.PX = this.X = this.MX;
this.PY = this.Y = this.MY;
}
else
{
@ -119,7 +117,7 @@ var Constraint = function(Mass1, Mass2)
this.Update = function(TimeDelta)
{
var d1 = Math.sqrt(Math.pow(this.Mass1.X - this.Mass2.X, 2) + Math.pow(this.Mass1.Y - this.Mass2.Y, 2));
var d1 = Math.sqrt(Math.pow(this.Mass1.NX - this.Mass2.NX, 2) + Math.pow(this.Mass1.NY - this.Mass2.NY, 2));
var d2 = (d1 - this.Distance) / d1;
var coefm1;