Fix minor race condition where SOP.GetGeometricCenter() and GetCenterOfMass() could return results which were never the case if these values were changed whilst the method was running
No need to create new Vector3s since these are structs.0.7.4-extended
parent
d71b097396
commit
86bdc4eca4
|
@ -1950,9 +1950,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
PhysicsActor pa = PhysActor;
|
PhysicsActor pa = PhysActor;
|
||||||
|
|
||||||
if (pa != null)
|
if (pa != null)
|
||||||
return new Vector3(pa.GeometricCenter.X, pa.GeometricCenter.Y, pa.GeometricCenter.Z);
|
return pa.GeometricCenter;
|
||||||
else
|
else
|
||||||
return new Vector3(0, 0, 0);
|
return Vector3.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 GetCenterOfMass()
|
public Vector3 GetCenterOfMass()
|
||||||
|
@ -1960,9 +1960,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
PhysicsActor pa = PhysActor;
|
PhysicsActor pa = PhysActor;
|
||||||
|
|
||||||
if (pa != null)
|
if (pa != null)
|
||||||
return new Vector3(pa.CenterOfMass.X, pa.CenterOfMass.Y, pa.CenterOfMass.Z);
|
return pa.CenterOfMass;
|
||||||
else
|
else
|
||||||
return new Vector3(0, 0, 0);
|
return Vector3.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float GetMass()
|
public float GetMass()
|
||||||
|
|
Loading…
Reference in New Issue