mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
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.
This commit is contained in:
@@ -2136,9 +2136,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
PhysicsActor pa = PhysActor;
|
||||
|
||||
if (pa != null)
|
||||
return new Vector3(pa.GeometricCenter.X, pa.GeometricCenter.Y, pa.GeometricCenter.Z);
|
||||
return pa.GeometricCenter;
|
||||
else
|
||||
return new Vector3(0, 0, 0);
|
||||
return Vector3.Zero;
|
||||
}
|
||||
|
||||
public Vector3 GetCenterOfMass()
|
||||
@@ -2146,9 +2146,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
PhysicsActor pa = PhysActor;
|
||||
|
||||
if (pa != null)
|
||||
return new Vector3(pa.CenterOfMass.X, pa.CenterOfMass.Y, pa.CenterOfMass.Z);
|
||||
return pa.CenterOfMass;
|
||||
else
|
||||
return new Vector3(0, 0, 0);
|
||||
return Vector3.Zero;
|
||||
}
|
||||
|
||||
public float GetMass()
|
||||
|
||||
Reference in New Issue
Block a user