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.

0.7.4.1
Robert Adams 2012-03-22 17:04:06 -07:00
parent 4bfd9e28ca
commit efe61b2481
3 changed files with 11 additions and 15 deletions

View File

@ -821,7 +821,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
*/ */
// Get what the body is doing, this includes 'external' influences // Get what the body is doing, this includes 'external' influences
Vector3 angularVelocity = m_prim.AngularVelocity; Vector3 angularVelocity = m_prim.RotationalVelocity;
// Vector3 angularVelocity = Vector3.Zero; // Vector3 angularVelocity = Vector3.Zero;
if (m_angularMotorApply > 0) if (m_angularMotorApply > 0)
@ -910,7 +910,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
m_lastAngularVelocity -= m_lastAngularVelocity * decayamount; m_lastAngularVelocity -= m_lastAngularVelocity * decayamount;
// Apply to the body // Apply to the body
m_prim.AngularVelocity = m_lastAngularVelocity; m_prim.RotationalVelocity = m_lastAngularVelocity;
} //end MoveAngular } //end MoveAngular
internal void LimitRotation(float timestep) internal void LimitRotation(float timestep)

View File

@ -85,7 +85,6 @@ public sealed class BSPrim : PhysicsActor
private OMV.Vector3 _rotationalVelocity; private OMV.Vector3 _rotationalVelocity;
private bool _kinematic; private bool _kinematic;
private float _buoyancy; private float _buoyancy;
private OMV.Vector3 _angularVelocity;
private List<BSPrim> _childrenPrims; private List<BSPrim> _childrenPrims;
private BSPrim _parentPrim; private BSPrim _parentPrim;
@ -119,7 +118,6 @@ public sealed class BSPrim : PhysicsActor
_buoyancy = 1f; _buoyancy = 1f;
_velocity = OMV.Vector3.Zero; _velocity = OMV.Vector3.Zero;
_rotationalVelocity = OMV.Vector3.Zero; _rotationalVelocity = OMV.Vector3.Zero;
_angularVelocity = OMV.Vector3.Zero;
_hullKey = 0; _hullKey = 0;
_meshKey = 0; _meshKey = 0;
_pbs = pbs; _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 // called when this prim is being destroyed and we should free all the resources
public void Destroy() public void Destroy()
{ {
// m_log.DebugFormat("{0}: Destroy", LogHeader); // m_log.DebugFormat("{0}: Destroy, id={1}", LogHeader, LocalID);
// Undo any vehicle properties // Undo any vehicle properties
_vehicle.ProcessTypeChange(Vehicle.TYPE_NONE); _vehicle.ProcessTypeChange(Vehicle.TYPE_NONE);
_scene.RemoveVehiclePrim(this); // just to make sure _scene.RemoveVehiclePrim(this); // just to make sure
@ -203,7 +201,7 @@ public sealed class BSPrim : PhysicsActor
// link me to the specified parent // link me to the specified parent
public override void link(PhysicsActor obj) { 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); // 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 // TODO: decide if this parent checking needs to happen at taint time
if (_parentPrim == null) 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 { public override bool Kinematic {
get { return _kinematic; } get { return _kinematic; }
set { _kinematic = value; 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}", // 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, BulletSimAPI.CreateMesh(_scene.WorldID, _meshKey, indices.GetLength(0), indices,
vertices.Count, verticesAsFloats); vertices.Count, verticesAsFloats);
@ -1127,7 +1121,7 @@ public sealed class BSPrim : PhysicsActor
return; 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 // No locking here because this is done when the physics engine is not simulating
private void CreateObject() private void CreateObject()
{ {
@ -1324,7 +1318,8 @@ public sealed class BSPrim : PhysicsActor
_velocity = entprop.Velocity; _velocity = entprop.Velocity;
_acceleration = entprop.Acceleration; _acceleration = entprop.Acceleration;
_rotationalVelocity = entprop.RotationalVelocity; _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(); base.RequestPhysicsterseUpdate();
} }
} }

View File

@ -487,12 +487,12 @@ public class BSScene : PhysicsScene, IPhysicsParameters
public override void DeleteTerrain() public override void DeleteTerrain()
{ {
m_log.DebugFormat("{0}: DeleteTerrain()", LogHeader); // m_log.DebugFormat("{0}: DeleteTerrain()", LogHeader);
} }
public override void Dispose() public override void Dispose()
{ {
m_log.DebugFormat("{0}: Dispose()", LogHeader); // m_log.DebugFormat("{0}: Dispose()", LogHeader);
} }
public override Dictionary<uint, float> GetTopColliders() public override Dictionary<uint, float> GetTopColliders()
@ -753,6 +753,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters
switch (lparm) switch (lparm)
{ {
case "detailedstats": m_detailedStatsStep = (int)val; break; case "detailedstats": m_detailedStatsStep = (int)val; break;
case "meshlod": m_meshLOD = (int)val; break; case "meshlod": m_meshLOD = (int)val; break;
case "sculptlod": m_sculptLOD = (int)val; break; case "sculptlod": m_sculptLOD = (int)val; break;
case "maxsubstep": m_maxSubSteps = (int)val; break; case "maxsubstep": m_maxSubSteps = (int)val; break;