From 1273f259e46154f861104610e8f6029b3c19623d Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 22 Mar 2012 17:04:06 -0700 Subject: BulletSim: remove confusion between angularVelocity and rotationalVelocity (there is still confusion in the rest of OpenSim). Enhance some debug statements to include the object ID. --- OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 4 ++-- OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 17 ++++++----------- OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 5 +++-- 3 files changed, 11 insertions(+), 15 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index 046726d..eb20eb3 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs @@ -821,7 +821,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin */ // Get what the body is doing, this includes 'external' influences - Vector3 angularVelocity = m_prim.AngularVelocity; + Vector3 angularVelocity = m_prim.RotationalVelocity; // Vector3 angularVelocity = Vector3.Zero; if (m_angularMotorApply > 0) @@ -910,7 +910,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin m_lastAngularVelocity -= m_lastAngularVelocity * decayamount; // Apply to the body - m_prim.AngularVelocity = m_lastAngularVelocity; + m_prim.RotationalVelocity = m_lastAngularVelocity; } //end MoveAngular internal void LimitRotation(float timestep) diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 898436b..f122df9 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs @@ -85,7 +85,6 @@ public sealed class BSPrim : PhysicsActor private OMV.Vector3 _rotationalVelocity; private bool _kinematic; private float _buoyancy; - private OMV.Vector3 _angularVelocity; private List _childrenPrims; private BSPrim _parentPrim; @@ -119,7 +118,6 @@ public sealed class BSPrim : PhysicsActor _buoyancy = 1f; _velocity = OMV.Vector3.Zero; _rotationalVelocity = OMV.Vector3.Zero; - _angularVelocity = OMV.Vector3.Zero; _hullKey = 0; _meshKey = 0; _pbs = pbs; @@ -146,7 +144,7 @@ public sealed class BSPrim : PhysicsActor // called when this prim is being destroyed and we should free all the resources public void Destroy() { - // m_log.DebugFormat("{0}: Destroy", LogHeader); + // m_log.DebugFormat("{0}: Destroy, id={1}", LogHeader, LocalID); // Undo any vehicle properties _vehicle.ProcessTypeChange(Vehicle.TYPE_NONE); _scene.RemoveVehiclePrim(this); // just to make sure @@ -203,7 +201,7 @@ public sealed class BSPrim : PhysicsActor // link me to the specified parent public override void link(PhysicsActor obj) { - BSPrim parent = (BSPrim)obj; + BSPrim parent = obj as BSPrim; // m_log.DebugFormat("{0}: link {1}/{2} to {3}", LogHeader, _avName, _localID, obj.LocalID); // TODO: decide if this parent checking needs to happen at taint time if (_parentPrim == null) @@ -527,10 +525,6 @@ public sealed class BSPrim : PhysicsActor }); } } - public OMV.Vector3 AngularVelocity { - get { return _angularVelocity; } - set { _angularVelocity = value; } - } public override bool Kinematic { get { return _kinematic; } set { _kinematic = value; @@ -993,7 +987,7 @@ public sealed class BSPrim : PhysicsActor } // m_log.DebugFormat("{0}: CreateGeomMesh: calling CreateMesh. lid={1}, key={2}, indices={3}, vertices={4}", - // LogHeader, _localID, _meshKey, indices.Length, vertices.Count); + // LogHeader, _localID, _meshKey, indices.Length, vertices.Count); BulletSimAPI.CreateMesh(_scene.WorldID, _meshKey, indices.GetLength(0), indices, vertices.Count, verticesAsFloats); @@ -1127,7 +1121,7 @@ public sealed class BSPrim : PhysicsActor return; } - // Create an object in Bullet + // Create an object in Bullet if it has not already been created // No locking here because this is done when the physics engine is not simulating private void CreateObject() { @@ -1324,7 +1318,8 @@ public sealed class BSPrim : PhysicsActor _velocity = entprop.Velocity; _acceleration = entprop.Acceleration; _rotationalVelocity = entprop.RotationalVelocity; - // m_log.DebugFormat("{0}: RequestTerseUpdate. id={1}, ch={2}, pos={3}, rot={4}", LogHeader, LocalID, changed, _position, _orientation); + // m_log.DebugFormat("{0}: RequestTerseUpdate. id={1}, ch={2}, pos={3}, rot={4}, vel={5}, acc={6}, rvel={7}", + // LogHeader, LocalID, changed, _position, _orientation, _velocity, _acceleration, _rotationalVelocity); base.RequestPhysicsterseUpdate(); } } diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 142103b..13d5e03 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs @@ -487,12 +487,12 @@ public class BSScene : PhysicsScene, IPhysicsParameters public override void DeleteTerrain() { - m_log.DebugFormat("{0}: DeleteTerrain()", LogHeader); + // m_log.DebugFormat("{0}: DeleteTerrain()", LogHeader); } public override void Dispose() { - m_log.DebugFormat("{0}: Dispose()", LogHeader); + // m_log.DebugFormat("{0}: Dispose()", LogHeader); } public override Dictionary GetTopColliders() @@ -753,6 +753,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters switch (lparm) { case "detailedstats": m_detailedStatsStep = (int)val; break; + case "meshlod": m_meshLOD = (int)val; break; case "sculptlod": m_sculptLOD = (int)val; break; case "maxsubstep": m_maxSubSteps = (int)val; break; -- cgit v1.1