diff options
author | Justin Clark-Casey (justincc) | 2013-04-02 23:48:55 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-04-02 23:48:55 +0100 |
commit | a3c723ee30db61e4c2c5375fa3c8c677336ca113 (patch) | |
tree | 055cd6899090b8b5cac68fc340dc687a717b8f93 /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |
parent | BulletSim: create axis lock constraint with proper orientation and (diff) | |
download | opensim-SC_OLD-a3c723ee30db61e4c2c5375fa3c8c677336ca113.zip opensim-SC_OLD-a3c723ee30db61e4c2c5375fa3c8c677336ca113.tar.gz opensim-SC_OLD-a3c723ee30db61e4c2c5375fa3c8c677336ca113.tar.bz2 opensim-SC_OLD-a3c723ee30db61e4c2c5375fa3c8c677336ca113.tar.xz |
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.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ec9e87e..2fcb199 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2136,9 +2136,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2136 | PhysicsActor pa = PhysActor; | 2136 | PhysicsActor pa = PhysActor; |
2137 | 2137 | ||
2138 | if (pa != null) | 2138 | if (pa != null) |
2139 | return new Vector3(pa.GeometricCenter.X, pa.GeometricCenter.Y, pa.GeometricCenter.Z); | 2139 | return pa.GeometricCenter; |
2140 | else | 2140 | else |
2141 | return new Vector3(0, 0, 0); | 2141 | return Vector3.Zero; |
2142 | } | 2142 | } |
2143 | 2143 | ||
2144 | public Vector3 GetCenterOfMass() | 2144 | public Vector3 GetCenterOfMass() |
@@ -2146,9 +2146,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2146 | PhysicsActor pa = PhysActor; | 2146 | PhysicsActor pa = PhysActor; |
2147 | 2147 | ||
2148 | if (pa != null) | 2148 | if (pa != null) |
2149 | return new Vector3(pa.CenterOfMass.X, pa.CenterOfMass.Y, pa.CenterOfMass.Z); | 2149 | return pa.CenterOfMass; |
2150 | else | 2150 | else |
2151 | return new Vector3(0, 0, 0); | 2151 | return Vector3.Zero; |
2152 | } | 2152 | } |
2153 | 2153 | ||
2154 | public float GetMass() | 2154 | public float GetMass() |