aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorTeravus Ovares2008-03-10 14:14:44 +0000
committerTeravus Ovares2008-03-10 14:14:44 +0000
commitf46fcbb9d20525d1b0910ace02558bd54b31bd56 (patch)
tree5efbaf8b2222b5b66448c087dd06a20f054bfe19 /OpenSim/Region
parentODEPlugin (diff)
downloadopensim-SC_OLD-f46fcbb9d20525d1b0910ace02558bd54b31bd56.zip
opensim-SC_OLD-f46fcbb9d20525d1b0910ace02558bd54b31bd56.tar.gz
opensim-SC_OLD-f46fcbb9d20525d1b0910ace02558bd54b31bd56.tar.bz2
opensim-SC_OLD-f46fcbb9d20525d1b0910ace02558bd54b31bd56.tar.xz
* Added Linear Acceleration reporting to the ODEPlugin.
* Added support for LSL llGetOmega (Rotational/Angular Velocity)- ODEPlugin is the only physics plugin that reports it.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs22
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs3
2 files changed, 22 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 7cdc558..6a38037 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -1770,7 +1770,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1770 d.Quaternion ori = d.BodyGetQuaternion(Body); 1770 d.Quaternion ori = d.BodyGetQuaternion(Body);
1771 d.Vector3 vel = d.BodyGetLinearVel(Body); 1771 d.Vector3 vel = d.BodyGetLinearVel(Body);
1772 d.Vector3 rotvel = d.BodyGetAngularVel(Body); 1772 d.Vector3 rotvel = d.BodyGetAngularVel(Body);
1773 1773
1774 PhysicsVector l_position = new PhysicsVector(); 1774 PhysicsVector l_position = new PhysicsVector();
1775 1775
1776 1776
@@ -1815,6 +1815,11 @@ namespace OpenSim.Region.Physics.OdePlugin
1815 1815
1816 //IsPhysical = false; 1816 //IsPhysical = false;
1817 base.RaiseOutOfBounds(_position); 1817 base.RaiseOutOfBounds(_position);
1818
1819 _acceleration.X = 0;
1820 _acceleration.Y = 0;
1821 _acceleration.Z = 0;
1822
1818 _velocity.X = 0; 1823 _velocity.X = 0;
1819 _velocity.Y = 0; 1824 _velocity.Y = 0;
1820 _velocity.Z = 0; 1825 _velocity.Z = 0;
@@ -1850,6 +1855,11 @@ namespace OpenSim.Region.Physics.OdePlugin
1850 _velocity.X = 0.0f; 1855 _velocity.X = 0.0f;
1851 _velocity.Y = 0.0f; 1856 _velocity.Y = 0.0f;
1852 _velocity.Z = 0.0f; 1857 _velocity.Z = 0.0f;
1858
1859 _acceleration.X = 0;
1860 _acceleration.Y = 0;
1861 _acceleration.Z = 0;
1862
1853 //_orientation.w = 0f; 1863 //_orientation.w = 0f;
1854 //_orientation.x = 0f; 1864 //_orientation.x = 0f;
1855 //_orientation.y = 0f; 1865 //_orientation.y = 0f;
@@ -1878,6 +1888,11 @@ namespace OpenSim.Region.Physics.OdePlugin
1878 _velocity.X = vel.X; 1888 _velocity.X = vel.X;
1879 _velocity.Y = vel.Y; 1889 _velocity.Y = vel.Y;
1880 _velocity.Z = vel.Z; 1890 _velocity.Z = vel.Z;
1891
1892 _acceleration = ((_velocity - m_lastVelocity) / 0.1f);
1893 _acceleration = new PhysicsVector(_velocity.X - m_lastVelocity.X / 0.1f, _velocity.Y - m_lastVelocity.Y / 0.1f, _velocity.Z - m_lastVelocity.Z / 0.1f);
1894 //m_log.Info("[PHYSICS]: V1: " + _velocity + " V2: " + m_lastVelocity + " Acceleration: " + _acceleration.ToString());
1895
1881 if (_velocity.IsIdentical(pv, 0.5f)) 1896 if (_velocity.IsIdentical(pv, 0.5f))
1882 { 1897 {
1883 m_rotationalVelocity = pv; 1898 m_rotationalVelocity = pv;
@@ -1911,6 +1926,11 @@ namespace OpenSim.Region.Physics.OdePlugin
1911 _velocity.X = 0; 1926 _velocity.X = 0;
1912 _velocity.Y = 0; 1927 _velocity.Y = 0;
1913 _velocity.Z = 0; 1928 _velocity.Z = 0;
1929
1930 _acceleration.X = 0;
1931 _acceleration.Y = 0;
1932 _acceleration.Z = 0;
1933
1914 m_rotationalVelocity.X = 0; 1934 m_rotationalVelocity.X = 0;
1915 m_rotationalVelocity.Y = 0; 1935 m_rotationalVelocity.Y = 0;
1916 m_rotationalVelocity.Z = 0; 1936 m_rotationalVelocity.Z = 0;
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 623ac29..b744ee4 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -1163,8 +1163,7 @@ namespace OpenSim.Region.ScriptEngine.Common
1163 public LSL_Types.Vector3 llGetOmega() 1163 public LSL_Types.Vector3 llGetOmega()
1164 { 1164 {
1165 m_host.AddScriptLPS(1); 1165 m_host.AddScriptLPS(1);
1166 NotImplemented("llGetOmega"); 1166 return new LSL_Types.Vector3(m_host.RotationalVelocity.X, m_host.RotationalVelocity.Y, m_host.RotationalVelocity.Z);
1167 return new LSL_Types.Vector3();
1168 } 1167 }
1169 1168
1170 public double llGetTimeOfDay() 1169 public double llGetTimeOfDay()