diff options
author | Teravus Ovares | 2009-03-30 14:10:24 +0000 |
---|---|---|
committer | Teravus Ovares | 2009-03-30 14:10:24 +0000 |
commit | 6522b4f5d4167f5f92683758f7959f70a3e73dd2 (patch) | |
tree | 63710a047b66c057889a093d384ee4f738bc6b02 /OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |
parent | Add PickInfoReply packet. (diff) | |
download | opensim-SC_OLD-6522b4f5d4167f5f92683758f7959f70a3e73dd2.zip opensim-SC_OLD-6522b4f5d4167f5f92683758f7959f70a3e73dd2.tar.gz opensim-SC_OLD-6522b4f5d4167f5f92683758f7959f70a3e73dd2.tar.bz2 opensim-SC_OLD-6522b4f5d4167f5f92683758f7959f70a3e73dd2.tar.xz |
* Fixing thread safety of avatar adding and removing from the Physics Scene in the ODEPlugin
* This may help one of the symptoms or mantis 3363 , however it probably won't solve the occasional NonFinite Avatar Position detected.. issues that some people see. That is probably an entirely different issue(NaN).
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/OdePlugin.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 732d99b..e3ac668 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -1339,20 +1339,39 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1339 | OdeCharacter newAv = new OdeCharacter(avName, this, pos, ode, size, avPIDD, avPIDP, avCapRadius, avStandupTensor, avDensity, avHeightFudgeFactor, avMovementDivisorWalk, avMovementDivisorRun); | 1339 | OdeCharacter newAv = new OdeCharacter(avName, this, pos, ode, size, avPIDD, avPIDP, avCapRadius, avStandupTensor, avDensity, avHeightFudgeFactor, avMovementDivisorWalk, avMovementDivisorRun); |
1340 | newAv.Flying = isFlying; | 1340 | newAv.Flying = isFlying; |
1341 | newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset; | 1341 | newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset; |
1342 | _characters.Add(newAv); | 1342 | |
1343 | return newAv; | 1343 | return newAv; |
1344 | } | 1344 | } |
1345 | 1345 | ||
1346 | public override void RemoveAvatar(PhysicsActor actor) | 1346 | public void AddCharacter(OdeCharacter chr) |
1347 | { | 1347 | { |
1348 | lock (OdeLock) | 1348 | lock (_characters) |
1349 | { | 1349 | { |
1350 | //m_log.Debug("[PHYSICS]:ODELOCK"); | 1350 | if (!_characters.Contains(chr)) |
1351 | ((OdeCharacter) actor).Destroy(); | 1351 | { |
1352 | _characters.Remove((OdeCharacter) actor); | 1352 | _characters.Add(chr); |
1353 | } | ||
1353 | } | 1354 | } |
1354 | } | 1355 | } |
1355 | 1356 | ||
1357 | public void RemoveCharacter(OdeCharacter chr) | ||
1358 | { | ||
1359 | lock (_characters) | ||
1360 | { | ||
1361 | if (_characters.Contains(chr)) | ||
1362 | { | ||
1363 | _characters.Remove(chr); | ||
1364 | } | ||
1365 | } | ||
1366 | } | ||
1367 | |||
1368 | public override void RemoveAvatar(PhysicsActor actor) | ||
1369 | { | ||
1370 | //m_log.Debug("[PHYSICS]:ODELOCK"); | ||
1371 | ((OdeCharacter) actor).Destroy(); | ||
1372 | |||
1373 | } | ||
1374 | |||
1356 | private PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, Quaternion rotation, | 1375 | private PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, Quaternion rotation, |
1357 | IMesh mesh, PrimitiveBaseShape pbs, bool isphysical) | 1376 | IMesh mesh, PrimitiveBaseShape pbs, bool isphysical) |
1358 | { | 1377 | { |