diff options
author | Melanie | 2013-06-05 23:44:26 +0100 |
---|---|---|
committer | Melanie | 2013-06-05 23:44:26 +0100 |
commit | e53b62304f557a26aa928b72e0961e135292146b (patch) | |
tree | 2fe588d969832c2de96dcf17880155dc552f7470 /OpenSim/Region/Physics | |
parent | Port Avination's inventory send throttling (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-e53b62304f557a26aa928b72e0961e135292146b.zip opensim-SC-e53b62304f557a26aa928b72e0961e135292146b.tar.gz opensim-SC-e53b62304f557a26aa928b72e0961e135292146b.tar.bz2 opensim-SC-e53b62304f557a26aa928b72e0961e135292146b.tar.xz |
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Physics')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 2 | ||||
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs | 57 |
2 files changed, 47 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index afd547a..aad1108 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | |||
@@ -360,7 +360,7 @@ public static class BSParam | |||
360 | new ParameterDefn<bool>("UseSeparatePhysicsThread", "If 'true', the physics engine runs independent from the simulator heartbeat", | 360 | new ParameterDefn<bool>("UseSeparatePhysicsThread", "If 'true', the physics engine runs independent from the simulator heartbeat", |
361 | false ), | 361 | false ), |
362 | new ParameterDefn<float>("PhysicsTimeStep", "If separate thread, seconds to simulate each interval", | 362 | new ParameterDefn<float>("PhysicsTimeStep", "If separate thread, seconds to simulate each interval", |
363 | 0.1f ), | 363 | 0.089f ), |
364 | 364 | ||
365 | new ParameterDefn<bool>("MeshSculptedPrim", "Whether to create meshes for sculpties", | 365 | new ParameterDefn<bool>("MeshSculptedPrim", "Whether to create meshes for sculpties", |
366 | true, | 366 | true, |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs index 81edc12..867d2ab 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs | |||
@@ -389,9 +389,21 @@ public class BSShapeMesh : BSShape | |||
389 | } | 389 | } |
390 | public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) | 390 | public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) |
391 | { | 391 | { |
392 | // Another reference to this shape is just counted. | 392 | BSShape ret = null; |
393 | IncrementReference(); | 393 | // If the underlying shape is native, the actual shape has not been build (waiting for asset) |
394 | return this; | 394 | // and we must create a copy of the native shape since they are never shared. |
395 | if (physShapeInfo.HasPhysicalShape && physShapeInfo.isNativeShape) | ||
396 | { | ||
397 | // TODO: decide when the native shapes should be freed. Check in Dereference? | ||
398 | ret = BSShapeNative.GetReference(pPhysicsScene, pPrim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX); | ||
399 | } | ||
400 | else | ||
401 | { | ||
402 | // Another reference to this shape is just counted. | ||
403 | IncrementReference(); | ||
404 | ret = this; | ||
405 | } | ||
406 | return ret; | ||
395 | } | 407 | } |
396 | public override void Dereference(BSScene physicsScene) | 408 | public override void Dereference(BSScene physicsScene) |
397 | { | 409 | { |
@@ -560,9 +572,21 @@ public class BSShapeHull : BSShape | |||
560 | } | 572 | } |
561 | public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) | 573 | public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) |
562 | { | 574 | { |
563 | // Another reference to this shape is just counted. | 575 | BSShape ret = null; |
564 | IncrementReference(); | 576 | // If the underlying shape is native, the actual shape has not been build (waiting for asset) |
565 | return this; | 577 | // and we must create a copy of the native shape since they are never shared. |
578 | if (physShapeInfo.HasPhysicalShape && physShapeInfo.isNativeShape) | ||
579 | { | ||
580 | // TODO: decide when the native shapes should be freed. Check in Dereference? | ||
581 | ret = BSShapeNative.GetReference(pPhysicsScene, pPrim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX); | ||
582 | } | ||
583 | else | ||
584 | { | ||
585 | // Another reference to this shape is just counted. | ||
586 | IncrementReference(); | ||
587 | ret = this; | ||
588 | } | ||
589 | return ret; | ||
566 | } | 590 | } |
567 | public override void Dereference(BSScene physicsScene) | 591 | public override void Dereference(BSScene physicsScene) |
568 | { | 592 | { |
@@ -1075,12 +1099,23 @@ public class BSShapeGImpact : BSShape | |||
1075 | (w, iC, i, vC, v) => physicsScene.PE.CreateGImpactShape(w, iC, i, vC, v) ); | 1099 | (w, iC, i, vC, v) => physicsScene.PE.CreateGImpactShape(w, iC, i, vC, v) ); |
1076 | } | 1100 | } |
1077 | 1101 | ||
1078 | public override BSShape GetReference(BSScene physicsScene, BSPhysObject prim) | 1102 | public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) |
1079 | { | 1103 | { |
1080 | // Calling this reference means we want another handle to an existing shape | 1104 | BSShape ret = null; |
1081 | // (usually linksets) so return this copy. | 1105 | // If the underlying shape is native, the actual shape has not been build (waiting for asset) |
1082 | IncrementReference(); | 1106 | // and we must create a copy of the native shape since they are never shared. |
1083 | return this; | 1107 | if (physShapeInfo.HasPhysicalShape && physShapeInfo.isNativeShape) |
1108 | { | ||
1109 | // TODO: decide when the native shapes should be freed. Check in Dereference? | ||
1110 | ret = BSShapeNative.GetReference(pPhysicsScene, pPrim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX); | ||
1111 | } | ||
1112 | else | ||
1113 | { | ||
1114 | // Another reference to this shape is just counted. | ||
1115 | IncrementReference(); | ||
1116 | ret = this; | ||
1117 | } | ||
1118 | return ret; | ||
1084 | } | 1119 | } |
1085 | // Dereferencing a compound shape releases the hold on all the child shapes. | 1120 | // Dereferencing a compound shape releases the hold on all the child shapes. |
1086 | public override void Dereference(BSScene physicsScene) | 1121 | public override void Dereference(BSScene physicsScene) |