diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin')
7 files changed, 100 insertions, 29 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index 2a52e01..c23ccd5 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -332,6 +332,13 @@ public class BSCharacter : BSPhysObject | |||
332 | }); | 332 | }); |
333 | } | 333 | } |
334 | } | 334 | } |
335 | public override OMV.Vector3 ForceVelocity { | ||
336 | get { return _velocity; } | ||
337 | set { | ||
338 | _velocity = value; | ||
339 | BulletSimAPI.SetObjectVelocity(PhysicsScene.WorldID, LocalID, _velocity); | ||
340 | } | ||
341 | } | ||
335 | public override OMV.Vector3 Torque { | 342 | public override OMV.Vector3 Torque { |
336 | get { return _torque; } | 343 | get { return _torque; } |
337 | set { _torque = value; | 344 | set { _torque = value; |
@@ -432,6 +439,10 @@ public class BSCharacter : BSPhysObject | |||
432 | get { return _rotationalVelocity; } | 439 | get { return _rotationalVelocity; } |
433 | set { _rotationalVelocity = value; } | 440 | set { _rotationalVelocity = value; } |
434 | } | 441 | } |
442 | public override OMV.Vector3 ForceRotationalVelocity { | ||
443 | get { return _rotationalVelocity; } | ||
444 | set { _rotationalVelocity = value; } | ||
445 | } | ||
435 | public override bool Kinematic { | 446 | public override bool Kinematic { |
436 | get { return _kinematic; } | 447 | get { return _kinematic; } |
437 | set { _kinematic = value; } | 448 | set { _kinematic = value; } |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index 3fb2253..76230a1 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -481,7 +481,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
481 | m_lastPositionVector = Prim.ForcePosition; | 481 | m_lastPositionVector = Prim.ForcePosition; |
482 | 482 | ||
483 | VDetailLog("{0},BSDynamics.Step,done,pos={1},force={2},velocity={3},angvel={4}", | 483 | VDetailLog("{0},BSDynamics.Step,done,pos={1},force={2},velocity={3},angvel={4}", |
484 | Prim.LocalID, Prim.Position, Prim.Force, Prim.Velocity, Prim.RotationalVelocity); | 484 | Prim.LocalID, Prim.ForcePosition, Prim.Force, Prim.ForceVelocity, Prim.RotationalVelocity); |
485 | }// end Step | 485 | }// end Step |
486 | 486 | ||
487 | // Apply the effect of the linear motor. | 487 | // Apply the effect of the linear motor. |
@@ -540,7 +540,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
540 | // add Gravity and Buoyancy | 540 | // add Gravity and Buoyancy |
541 | // There is some gravity, make a gravity force vector that is applied after object velocity. | 541 | // There is some gravity, make a gravity force vector that is applied after object velocity. |
542 | // m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g; | 542 | // m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g; |
543 | Vector3 grav = Prim.PhysicsScene.DefaultGravity * (Prim.Mass * (1f - m_VehicleBuoyancy)); | 543 | Vector3 grav = Prim.PhysicsScene.DefaultGravity * (Prim.MassRaw * (1f - m_VehicleBuoyancy)); |
544 | 544 | ||
545 | /* | 545 | /* |
546 | * RA: Not sure why one would do this | 546 | * RA: Not sure why one would do this |
@@ -678,10 +678,10 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
678 | m_newVelocity.Z = 0; | 678 | m_newVelocity.Z = 0; |
679 | 679 | ||
680 | // Apply velocity | 680 | // Apply velocity |
681 | Prim.Velocity = m_newVelocity; | 681 | Prim.ForceVelocity = m_newVelocity; |
682 | // apply gravity force | 682 | // apply gravity force |
683 | // Why is this set here? The physics engine already does gravity. | 683 | // Why is this set here? The physics engine already does gravity. |
684 | // m_prim.AddForce(grav, false); | 684 | Prim.AddForce(grav, false); |
685 | 685 | ||
686 | // Apply friction | 686 | // Apply friction |
687 | Vector3 keepFraction = Vector3.One - (Vector3.One / (m_linearFrictionTimescale / pTimestep)); | 687 | Vector3 keepFraction = Vector3.One - (Vector3.One / (m_linearFrictionTimescale / pTimestep)); |
@@ -704,7 +704,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
704 | // m_lastAngularVelocity // what was last applied to body | 704 | // m_lastAngularVelocity // what was last applied to body |
705 | 705 | ||
706 | // Get what the body is doing, this includes 'external' influences | 706 | // Get what the body is doing, this includes 'external' influences |
707 | Vector3 angularVelocity = Prim.RotationalVelocity; | 707 | Vector3 angularVelocity = Prim.ForceRotationalVelocity; |
708 | 708 | ||
709 | if (m_angularMotorApply > 0) | 709 | if (m_angularMotorApply > 0) |
710 | { | 710 | { |
@@ -810,7 +810,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
810 | m_lastAngularVelocity -= m_lastAngularVelocity * decayamount; | 810 | m_lastAngularVelocity -= m_lastAngularVelocity * decayamount; |
811 | 811 | ||
812 | // Apply to the body | 812 | // Apply to the body |
813 | Prim.RotationalVelocity = m_lastAngularVelocity; | 813 | Prim.ForceRotationalVelocity = m_lastAngularVelocity; |
814 | 814 | ||
815 | VDetailLog("{0},MoveAngular,done,decay={1},lastAngular={2}", Prim.LocalID, decayamount, m_lastAngularVelocity); | 815 | VDetailLog("{0},MoveAngular,done,decay={1},lastAngular={2}", Prim.LocalID, decayamount, m_lastAngularVelocity); |
816 | } //end MoveAngular | 816 | } //end MoveAngular |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 0665292..cae599c 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -85,6 +85,10 @@ public abstract class BSPhysObject : PhysicsActor | |||
85 | 85 | ||
86 | public abstract OMV.Quaternion ForceOrientation { get; set; } | 86 | public abstract OMV.Quaternion ForceOrientation { get; set; } |
87 | 87 | ||
88 | public abstract OMV.Vector3 ForceVelocity { get; set; } | ||
89 | |||
90 | public abstract OMV.Vector3 ForceRotationalVelocity { get; set; } | ||
91 | |||
88 | #region Collisions | 92 | #region Collisions |
89 | 93 | ||
90 | // Requested number of milliseconds between collision events. Zero means disabled. | 94 | // Requested number of milliseconds between collision events. Zero means disabled. |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 98a18a1..d408be0 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -265,6 +265,11 @@ public sealed class BSPrim : BSPhysObject | |||
265 | return _position; | 265 | return _position; |
266 | } | 266 | } |
267 | set { | 267 | set { |
268 | // If you must push the position into the physics engine, use ForcePosition. | ||
269 | if (_position == value) | ||
270 | { | ||
271 | return; | ||
272 | } | ||
268 | _position = value; | 273 | _position = value; |
269 | // TODO: what does it mean to set the position of a child prim?? Rebuild the constraint? | 274 | // TODO: what does it mean to set the position of a child prim?? Rebuild the constraint? |
270 | PositionSanityCheck(); | 275 | PositionSanityCheck(); |
@@ -453,7 +458,6 @@ public sealed class BSPrim : BSPhysObject | |||
453 | } | 458 | } |
454 | return; | 459 | return; |
455 | } | 460 | } |
456 | |||
457 | public override OMV.Vector3 Velocity { | 461 | public override OMV.Vector3 Velocity { |
458 | get { return _velocity; } | 462 | get { return _velocity; } |
459 | set { | 463 | set { |
@@ -465,6 +469,13 @@ public sealed class BSPrim : BSPhysObject | |||
465 | }); | 469 | }); |
466 | } | 470 | } |
467 | } | 471 | } |
472 | public override OMV.Vector3 ForceVelocity { | ||
473 | get { return _velocity; } | ||
474 | set { | ||
475 | _velocity = value; | ||
476 | BulletSimAPI.SetLinearVelocity2(BSBody.ptr, _velocity); | ||
477 | } | ||
478 | } | ||
468 | public override OMV.Vector3 Torque { | 479 | public override OMV.Vector3 Torque { |
469 | get { return _torque; } | 480 | get { return _torque; } |
470 | set { _torque = value; | 481 | set { _torque = value; |
@@ -490,6 +501,8 @@ public sealed class BSPrim : BSPhysObject | |||
490 | return _orientation; | 501 | return _orientation; |
491 | } | 502 | } |
492 | set { | 503 | set { |
504 | if (_orientation == value) | ||
505 | return; | ||
493 | _orientation = value; | 506 | _orientation = value; |
494 | // TODO: what does it mean if a child in a linkset changes its orientation? Rebuild the constraint? | 507 | // TODO: what does it mean if a child in a linkset changes its orientation? Rebuild the constraint? |
495 | PhysicsScene.TaintedObject("BSPrim.setOrientation", delegate() | 508 | PhysicsScene.TaintedObject("BSPrim.setOrientation", delegate() |
@@ -621,9 +634,9 @@ public sealed class BSPrim : BSPhysObject | |||
621 | // There can be special things needed for implementing linksets | 634 | // There can be special things needed for implementing linksets |
622 | Linkset.MakeStatic(this); | 635 | Linkset.MakeStatic(this); |
623 | // The activation state is 'disabled' so Bullet will not try to act on it. | 636 | // The activation state is 'disabled' so Bullet will not try to act on it. |
624 | // BulletSimAPI.ForceActivationState2(BSBody.ptr, ActivationState.DISABLE_SIMULATION); | 637 | BulletSimAPI.ForceActivationState2(BSBody.ptr, ActivationState.DISABLE_SIMULATION); |
625 | // Start it out sleeping and physical actions could wake it up. | 638 | // Start it out sleeping and physical actions could wake it up. |
626 | BulletSimAPI.ForceActivationState2(BSBody.ptr, ActivationState.ISLAND_SLEEPING); | 639 | // BulletSimAPI.ForceActivationState2(BSBody.ptr, ActivationState.ISLAND_SLEEPING); |
627 | 640 | ||
628 | BSBody.collisionFilter = CollisionFilterGroups.StaticObjectFilter; | 641 | BSBody.collisionFilter = CollisionFilterGroups.StaticObjectFilter; |
629 | BSBody.collisionMask = CollisionFilterGroups.StaticObjectMask; | 642 | BSBody.collisionMask = CollisionFilterGroups.StaticObjectMask; |
@@ -640,6 +653,9 @@ public sealed class BSPrim : BSPhysObject | |||
640 | // per http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=3382 | 653 | // per http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=3382 |
641 | BulletSimAPI.ClearAllForces2(BSBody.ptr); | 654 | BulletSimAPI.ClearAllForces2(BSBody.ptr); |
642 | 655 | ||
656 | // For good measure, make sure the transform is set through to the motion state | ||
657 | BulletSimAPI.SetTranslation2(BSBody.ptr, _position, _orientation); | ||
658 | |||
643 | // A dynamic object has mass | 659 | // A dynamic object has mass |
644 | IntPtr collisionShapePtr = BulletSimAPI.GetCollisionShape2(BSBody.ptr); | 660 | IntPtr collisionShapePtr = BulletSimAPI.GetCollisionShape2(BSBody.ptr); |
645 | OMV.Vector3 inertia = BulletSimAPI.CalculateLocalInertia2(collisionShapePtr, Mass); | 661 | OMV.Vector3 inertia = BulletSimAPI.CalculateLocalInertia2(collisionShapePtr, Mass); |
@@ -776,6 +792,15 @@ public sealed class BSPrim : BSPhysObject | |||
776 | }); | 792 | }); |
777 | } | 793 | } |
778 | } | 794 | } |
795 | public override OMV.Vector3 ForceRotationalVelocity { | ||
796 | get { | ||
797 | return _rotationalVelocity; | ||
798 | } | ||
799 | set { | ||
800 | _rotationalVelocity = value; | ||
801 | BulletSimAPI.SetAngularVelocity2(BSBody.ptr, _rotationalVelocity); | ||
802 | } | ||
803 | } | ||
779 | public override bool Kinematic { | 804 | public override bool Kinematic { |
780 | get { return _kinematic; } | 805 | get { return _kinematic; } |
781 | set { _kinematic = value; | 806 | set { _kinematic = value; |
@@ -1307,7 +1332,7 @@ public sealed class BSPrim : BSPhysObject | |||
1307 | /* | 1332 | /* |
1308 | else | 1333 | else |
1309 | { | 1334 | { |
1310 | // For debugging, we can also report the movement of children | 1335 | // For debugging, report the movement of children |
1311 | DetailLog("{0},BSPrim.UpdateProperties,child,pos={1},orient={2},vel={3},accel={4},rotVel={5}", | 1336 | DetailLog("{0},BSPrim.UpdateProperties,child,pos={1},orient={2},vel={3},accel={4},rotVel={5}", |
1312 | LocalID, entprop.Position, entprop.Rotation, entprop.Velocity, | 1337 | LocalID, entprop.Position, entprop.Rotation, entprop.Velocity, |
1313 | entprop.Acceleration, entprop.RotationalVelocity); | 1338 | entprop.Acceleration, entprop.RotationalVelocity); |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index eed915d..33ac116 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -90,10 +90,6 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
90 | // let my minuions use my logger | 90 | // let my minuions use my logger |
91 | public ILog Logger { get { return m_log; } } | 91 | public ILog Logger { get { return m_log; } } |
92 | 92 | ||
93 | // If non-zero, the number of simulation steps between calls to the physics | ||
94 | // engine to output detailed physics stats. Debug logging level must be on also. | ||
95 | private int m_detailedStatsStep = 0; | ||
96 | |||
97 | public IMesher mesher; | 93 | public IMesher mesher; |
98 | // Level of Detail values kept as float because that's what the Meshmerizer wants | 94 | // Level of Detail values kept as float because that's what the Meshmerizer wants |
99 | public float MeshLOD { get; private set; } | 95 | public float MeshLOD { get; private set; } |
@@ -112,6 +108,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
112 | private float m_fixedTimeStep; | 108 | private float m_fixedTimeStep; |
113 | private long m_simulationStep = 0; | 109 | private long m_simulationStep = 0; |
114 | public long SimulationStep { get { return m_simulationStep; } } | 110 | public long SimulationStep { get { return m_simulationStep; } } |
111 | private int m_taintsToProcessPerStep; | ||
115 | 112 | ||
116 | // A value of the time now so all the collision and update routines do not have to get their own | 113 | // A value of the time now so all the collision and update routines do not have to get their own |
117 | // Set to 'now' just before all the prims and actors are called for collisions and updates | 114 | // Set to 'now' just before all the prims and actors are called for collisions and updates |
@@ -131,6 +128,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
131 | 128 | ||
132 | public bool ShouldMeshSculptedPrim { get; private set; } // cause scuplted prims to get meshed | 129 | public bool ShouldMeshSculptedPrim { get; private set; } // cause scuplted prims to get meshed |
133 | public bool ShouldForceSimplePrimMeshing { get; private set; } // if a cube or sphere, let Bullet do internal shapes | 130 | public bool ShouldForceSimplePrimMeshing { get; private set; } // if a cube or sphere, let Bullet do internal shapes |
131 | public bool ShouldUseHullsForPhysicalObjects { get; private set; } // 'true' if should create hulls for physical objects | ||
134 | 132 | ||
135 | public float PID_D { get; private set; } // derivative | 133 | public float PID_D { get; private set; } // derivative |
136 | public float PID_P { get; private set; } // proportional | 134 | public float PID_P { get; private set; } // proportional |
@@ -582,15 +580,6 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
582 | } | 580 | } |
583 | } | 581 | } |
584 | 582 | ||
585 | // If enabled, call into the physics engine to dump statistics | ||
586 | if (m_detailedStatsStep > 0) | ||
587 | { | ||
588 | if ((m_simulationStep % m_detailedStatsStep) == 0) | ||
589 | { | ||
590 | BulletSimAPI.DumpBulletStatistics(); | ||
591 | } | ||
592 | } | ||
593 | |||
594 | // The physics engine returns the number of milliseconds it simulated this call. | 583 | // The physics engine returns the number of milliseconds it simulated this call. |
595 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. | 584 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. |
596 | // Since Bullet normally does 5 or 6 substeps, this will normally sum to about 60 FPS. | 585 | // Since Bullet normally does 5 or 6 substeps, this will normally sum to about 60 FPS. |
@@ -617,7 +606,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
617 | BSPhysObject collidee = null; | 606 | BSPhysObject collidee = null; |
618 | PhysObjects.TryGetValue(collidingWith, out collidee); | 607 | PhysObjects.TryGetValue(collidingWith, out collidee); |
619 | 608 | ||
620 | DetailLog("{0},BSScene.SendCollision,collide,id={1},with={2}", DetailLogZero, localID, collidingWith); | 609 | // DetailLog("{0},BSScene.SendCollision,collide,id={1},with={2}", DetailLogZero, localID, collidingWith); |
621 | 610 | ||
622 | if (collider.Collide(collidingWith, collidee, collidePoint, collideNormal, penetration)) | 611 | if (collider.Collide(collidingWith, collidee, collidePoint, collideNormal, penetration)) |
623 | { | 612 | { |
@@ -704,6 +693,35 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
704 | if (_taintedObjects.Count > 0) // save allocating new list if there is nothing to process | 693 | if (_taintedObjects.Count > 0) // save allocating new list if there is nothing to process |
705 | { | 694 | { |
706 | // swizzle a new list into the list location so we can process what's there | 695 | // swizzle a new list into the list location so we can process what's there |
696 | int taintCount = m_taintsToProcessPerStep; | ||
697 | TaintCallbackEntry oneCallback = new TaintCallbackEntry(); | ||
698 | while (_taintedObjects.Count > 0 && taintCount-- > 0) | ||
699 | { | ||
700 | bool gotOne = false; | ||
701 | lock (_taintLock) | ||
702 | { | ||
703 | if (_taintedObjects.Count > 0) | ||
704 | { | ||
705 | oneCallback = _taintedObjects[0]; | ||
706 | _taintedObjects.RemoveAt(0); | ||
707 | gotOne = true; | ||
708 | } | ||
709 | } | ||
710 | if (gotOne) | ||
711 | { | ||
712 | try | ||
713 | { | ||
714 | DetailLog("{0},BSScene.ProcessTaints,doTaint,id={1}", DetailLogZero, oneCallback.ident); // DEBUG DEBUG DEBUG | ||
715 | oneCallback.callback(); | ||
716 | } | ||
717 | catch (Exception e) | ||
718 | { | ||
719 | m_log.ErrorFormat("{0}: ProcessTaints: {1}: Exception: {2}", LogHeader, oneCallback.ident, e); | ||
720 | } | ||
721 | } | ||
722 | } | ||
723 | /* | ||
724 | // swizzle a new list into the list location so we can process what's there | ||
707 | List<TaintCallbackEntry> oldList; | 725 | List<TaintCallbackEntry> oldList; |
708 | lock (_taintLock) | 726 | lock (_taintLock) |
709 | { | 727 | { |
@@ -724,6 +742,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
724 | } | 742 | } |
725 | } | 743 | } |
726 | oldList.Clear(); | 744 | oldList.Clear(); |
745 | */ | ||
727 | } | 746 | } |
728 | } | 747 | } |
729 | 748 | ||
@@ -835,6 +854,11 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
835 | (s,cf,p,v) => { s.ShouldForceSimplePrimMeshing = cf.GetBoolean(p, s.BoolNumeric(v)); }, | 854 | (s,cf,p,v) => { s.ShouldForceSimplePrimMeshing = cf.GetBoolean(p, s.BoolNumeric(v)); }, |
836 | (s) => { return s.NumericBool(s.ShouldForceSimplePrimMeshing); }, | 855 | (s) => { return s.NumericBool(s.ShouldForceSimplePrimMeshing); }, |
837 | (s,p,l,v) => { s.ShouldForceSimplePrimMeshing = s.BoolNumeric(v); } ), | 856 | (s,p,l,v) => { s.ShouldForceSimplePrimMeshing = s.BoolNumeric(v); } ), |
857 | new ParameterDefn("UseHullsForPhysicalObjects", "If true, create hulls for physical objects", | ||
858 | ConfigurationParameters.numericFalse, | ||
859 | (s,cf,p,v) => { s.ShouldUseHullsForPhysicalObjects = cf.GetBoolean(p, s.BoolNumeric(v)); }, | ||
860 | (s) => { return s.NumericBool(s.ShouldUseHullsForPhysicalObjects); }, | ||
861 | (s,p,l,v) => { s.ShouldUseHullsForPhysicalObjects = s.BoolNumeric(v); } ), | ||
838 | 862 | ||
839 | new ParameterDefn("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)", | 863 | new ParameterDefn("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)", |
840 | 8f, | 864 | 8f, |
@@ -877,6 +901,11 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
877 | (s,cf,p,v) => { s.m_maxUpdatesPerFrame = cf.GetInt(p, (int)v); }, | 901 | (s,cf,p,v) => { s.m_maxUpdatesPerFrame = cf.GetInt(p, (int)v); }, |
878 | (s) => { return (float)s.m_maxUpdatesPerFrame; }, | 902 | (s) => { return (float)s.m_maxUpdatesPerFrame; }, |
879 | (s,p,l,v) => { s.m_maxUpdatesPerFrame = (int)v; } ), | 903 | (s,p,l,v) => { s.m_maxUpdatesPerFrame = (int)v; } ), |
904 | new ParameterDefn("MaxTaintsToProcessPerStep", "Number of update taints to process before each simulation step", | ||
905 | 100f, | ||
906 | (s,cf,p,v) => { s.m_taintsToProcessPerStep = cf.GetInt(p, (int)v); }, | ||
907 | (s) => { return (float)s.m_taintsToProcessPerStep; }, | ||
908 | (s,p,l,v) => { s.m_taintsToProcessPerStep = (int)v; } ), | ||
880 | new ParameterDefn("MaxObjectMass", "Maximum object mass (10000.01)", | 909 | new ParameterDefn("MaxObjectMass", "Maximum object mass (10000.01)", |
881 | 10000.01f, | 910 | 10000.01f, |
882 | (s,cf,p,v) => { s.MaximumObjectMass = cf.GetFloat(p, v); }, | 911 | (s,cf,p,v) => { s.MaximumObjectMass = cf.GetFloat(p, v); }, |
@@ -1086,11 +1115,11 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
1086 | (s) => { return s.m_params[0].linkConstraintSolverIterations; }, | 1115 | (s) => { return s.m_params[0].linkConstraintSolverIterations; }, |
1087 | (s,p,l,v) => { s.m_params[0].linkConstraintSolverIterations = v; } ), | 1116 | (s,p,l,v) => { s.m_params[0].linkConstraintSolverIterations = v; } ), |
1088 | 1117 | ||
1089 | new ParameterDefn("DetailedStats", "Frames between outputting detailed phys stats. (0 is off)", | 1118 | new ParameterDefn("LogPhysicsStatisticsFrames", "Frames between outputting detailed phys stats. (0 is off)", |
1090 | 0f, | 1119 | 0f, |
1091 | (s,cf,p,v) => { s.m_detailedStatsStep = cf.GetInt(p, (int)v); }, | 1120 | (s,cf,p,v) => { s.m_params[0].physicsLoggingFrames = cf.GetInt(p, (int)v); }, |
1092 | (s) => { return (float)s.m_detailedStatsStep; }, | 1121 | (s) => { return (float)s.m_params[0].physicsLoggingFrames; }, |
1093 | (s,p,l,v) => { s.m_detailedStatsStep = (int)v; } ), | 1122 | (s,p,l,v) => { s.m_params[0].physicsLoggingFrames = (int)v; } ), |
1094 | }; | 1123 | }; |
1095 | 1124 | ||
1096 | // Convert a boolean to our numeric true and false values | 1125 | // Convert a boolean to our numeric true and false values |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs index 283b601..e619b48 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs | |||
@@ -407,7 +407,7 @@ public class BSShapeCollection : IDisposable | |||
407 | // made. Native shapes are best used in either case. | 407 | // made. Native shapes are best used in either case. |
408 | if (!haveShape) | 408 | if (!haveShape) |
409 | { | 409 | { |
410 | if (prim.IsPhysical) | 410 | if (prim.IsPhysical && PhysicsScene.ShouldUseHullsForPhysicalObjects) |
411 | { | 411 | { |
412 | // Update prim.BSShape to reference a hull of this shape. | 412 | // Update prim.BSShape to reference a hull of this shape. |
413 | ret = GetReferenceToHull(prim, shapeData, pbs, shapeCallback); | 413 | ret = GetReferenceToHull(prim, shapeData, pbs, shapeCallback); |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index bb4d399..7a60afb 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | |||
@@ -306,6 +306,8 @@ public struct ConfigurationParameters | |||
306 | public float linkConstraintCFM; | 306 | public float linkConstraintCFM; |
307 | public float linkConstraintSolverIterations; | 307 | public float linkConstraintSolverIterations; |
308 | 308 | ||
309 | public float physicsLoggingFrames; | ||
310 | |||
309 | public const float numericTrue = 1f; | 311 | public const float numericTrue = 1f; |
310 | public const float numericFalse = 0f; | 312 | public const float numericFalse = 0f; |
311 | } | 313 | } |