* Added Linear Acceleration reporting to the ODEPlugin.

* Added support for LSL llGetOmega (Rotational/Angular Velocity)- ODEPlugin is the only physics plugin that reports it.
0.6.0-stable
Teravus Ovares 2008-03-10 14:14:44 +00:00
parent d0123a796b
commit f46fcbb9d2
2 changed files with 22 additions and 3 deletions

View File

@ -1815,6 +1815,11 @@ namespace OpenSim.Region.Physics.OdePlugin
//IsPhysical = false; //IsPhysical = false;
base.RaiseOutOfBounds(_position); base.RaiseOutOfBounds(_position);
_acceleration.X = 0;
_acceleration.Y = 0;
_acceleration.Z = 0;
_velocity.X = 0; _velocity.X = 0;
_velocity.Y = 0; _velocity.Y = 0;
_velocity.Z = 0; _velocity.Z = 0;
@ -1850,6 +1855,11 @@ namespace OpenSim.Region.Physics.OdePlugin
_velocity.X = 0.0f; _velocity.X = 0.0f;
_velocity.Y = 0.0f; _velocity.Y = 0.0f;
_velocity.Z = 0.0f; _velocity.Z = 0.0f;
_acceleration.X = 0;
_acceleration.Y = 0;
_acceleration.Z = 0;
//_orientation.w = 0f; //_orientation.w = 0f;
//_orientation.x = 0f; //_orientation.x = 0f;
//_orientation.y = 0f; //_orientation.y = 0f;
@ -1878,6 +1888,11 @@ namespace OpenSim.Region.Physics.OdePlugin
_velocity.X = vel.X; _velocity.X = vel.X;
_velocity.Y = vel.Y; _velocity.Y = vel.Y;
_velocity.Z = vel.Z; _velocity.Z = vel.Z;
_acceleration = ((_velocity - m_lastVelocity) / 0.1f);
_acceleration = new PhysicsVector(_velocity.X - m_lastVelocity.X / 0.1f, _velocity.Y - m_lastVelocity.Y / 0.1f, _velocity.Z - m_lastVelocity.Z / 0.1f);
//m_log.Info("[PHYSICS]: V1: " + _velocity + " V2: " + m_lastVelocity + " Acceleration: " + _acceleration.ToString());
if (_velocity.IsIdentical(pv, 0.5f)) if (_velocity.IsIdentical(pv, 0.5f))
{ {
m_rotationalVelocity = pv; m_rotationalVelocity = pv;
@ -1911,6 +1926,11 @@ namespace OpenSim.Region.Physics.OdePlugin
_velocity.X = 0; _velocity.X = 0;
_velocity.Y = 0; _velocity.Y = 0;
_velocity.Z = 0; _velocity.Z = 0;
_acceleration.X = 0;
_acceleration.Y = 0;
_acceleration.Z = 0;
m_rotationalVelocity.X = 0; m_rotationalVelocity.X = 0;
m_rotationalVelocity.Y = 0; m_rotationalVelocity.Y = 0;
m_rotationalVelocity.Z = 0; m_rotationalVelocity.Z = 0;

View File

@ -1163,8 +1163,7 @@ namespace OpenSim.Region.ScriptEngine.Common
public LSL_Types.Vector3 llGetOmega() public LSL_Types.Vector3 llGetOmega()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llGetOmega"); return new LSL_Types.Vector3(m_host.RotationalVelocity.X, m_host.RotationalVelocity.Y, m_host.RotationalVelocity.Z);
return new LSL_Types.Vector3();
} }
public double llGetTimeOfDay() public double llGetTimeOfDay()