diff options
author | Melanie | 2013-06-06 03:04:47 +0100 |
---|---|---|
committer | Melanie | 2013-06-06 03:04:47 +0100 |
commit | ea9e1d1a1e0da0bab23d899b29672a0e7c7d8ad0 (patch) | |
tree | 876269c05bbc4be96ee8bdff2970cdfea0db61bc /OpenSim/Region/Physics | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Prevent processing for Npc (diff) | |
download | opensim-SC-ea9e1d1a1e0da0bab23d899b29672a0e7c7d8ad0.zip opensim-SC-ea9e1d1a1e0da0bab23d899b29672a0e7c7d8ad0.tar.gz opensim-SC-ea9e1d1a1e0da0bab23d899b29672a0e7c7d8ad0.tar.bz2 opensim-SC-ea9e1d1a1e0da0bab23d899b29672a0e7c7d8ad0.tar.xz |
Merge commit 'e449950030decf7e65e7d9b334ddaed25c1bd629' into careminster
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 395dbe3..326fc9e 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 | { |
@@ -562,9 +574,21 @@ public class BSShapeHull : BSShape | |||
562 | } | 574 | } |
563 | public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) | 575 | public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) |
564 | { | 576 | { |
565 | // Another reference to this shape is just counted. | 577 | BSShape ret = null; |
566 | IncrementReference(); | 578 | // If the underlying shape is native, the actual shape has not been build (waiting for asset) |
567 | return this; | 579 | // and we must create a copy of the native shape since they are never shared. |
580 | if (physShapeInfo.HasPhysicalShape && physShapeInfo.isNativeShape) | ||
581 | { | ||
582 | // TODO: decide when the native shapes should be freed. Check in Dereference? | ||
583 | ret = BSShapeNative.GetReference(pPhysicsScene, pPrim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX); | ||
584 | } | ||
585 | else | ||
586 | { | ||
587 | // Another reference to this shape is just counted. | ||
588 | IncrementReference(); | ||
589 | ret = this; | ||
590 | } | ||
591 | return ret; | ||
568 | } | 592 | } |
569 | public override void Dereference(BSScene physicsScene) | 593 | public override void Dereference(BSScene physicsScene) |
570 | { | 594 | { |
@@ -1077,12 +1101,23 @@ public class BSShapeGImpact : BSShape | |||
1077 | (w, iC, i, vC, v) => physicsScene.PE.CreateGImpactShape(w, iC, i, vC, v) ); | 1101 | (w, iC, i, vC, v) => physicsScene.PE.CreateGImpactShape(w, iC, i, vC, v) ); |
1078 | } | 1102 | } |
1079 | 1103 | ||
1080 | public override BSShape GetReference(BSScene physicsScene, BSPhysObject prim) | 1104 | public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) |
1081 | { | 1105 | { |
1082 | // Calling this reference means we want another handle to an existing shape | 1106 | BSShape ret = null; |
1083 | // (usually linksets) so return this copy. | 1107 | // If the underlying shape is native, the actual shape has not been build (waiting for asset) |
1084 | IncrementReference(); | 1108 | // and we must create a copy of the native shape since they are never shared. |
1085 | return this; | 1109 | if (physShapeInfo.HasPhysicalShape && physShapeInfo.isNativeShape) |
1110 | { | ||
1111 | // TODO: decide when the native shapes should be freed. Check in Dereference? | ||
1112 | ret = BSShapeNative.GetReference(pPhysicsScene, pPrim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX); | ||
1113 | } | ||
1114 | else | ||
1115 | { | ||
1116 | // Another reference to this shape is just counted. | ||
1117 | IncrementReference(); | ||
1118 | ret = this; | ||
1119 | } | ||
1120 | return ret; | ||
1086 | } | 1121 | } |
1087 | // Dereferencing a compound shape releases the hold on all the child shapes. | 1122 | // Dereferencing a compound shape releases the hold on all the child shapes. |
1088 | public override void Dereference(BSScene physicsScene) | 1123 | public override void Dereference(BSScene physicsScene) |