diff options
author | UbitUmarov | 2012-05-20 13:18:15 +0100 |
---|---|---|
committer | UbitUmarov | 2012-05-20 13:18:15 +0100 |
commit | 11f582b26da987afe4c9ad76c6ce35b58a8bc6fd (patch) | |
tree | 0f6255c1502399613a9f133d2fb8a5cb47fc81e1 /OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |
parent | fix m_sitAvatarHeight to be half size.z, reduced default to a more resonable... (diff) | |
download | opensim-SC-11f582b26da987afe4c9ad76c6ce35b58a8bc6fd.zip opensim-SC-11f582b26da987afe4c9ad76c6ce35b58a8bc6fd.tar.gz opensim-SC-11f582b26da987afe4c9ad76c6ce35b58a8bc6fd.tar.bz2 opensim-SC-11f582b26da987afe4c9ad76c6ce35b58a8bc6fd.tar.xz |
minor changes
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index 0f341b9..bfcfd21 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |||
@@ -190,6 +190,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
190 | 190 | ||
191 | public float ODE_STEPSIZE = 0.020f; | 191 | public float ODE_STEPSIZE = 0.020f; |
192 | public float HalfOdeStep = 0.01f; | 192 | public float HalfOdeStep = 0.01f; |
193 | public int odetimestepMS = 20; // rounded | ||
193 | private float metersInSpace = 25.6f; | 194 | private float metersInSpace = 25.6f; |
194 | private float m_timeDilation = 1.0f; | 195 | private float m_timeDilation = 1.0f; |
195 | 196 | ||
@@ -490,6 +491,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
490 | } | 491 | } |
491 | 492 | ||
492 | HalfOdeStep = ODE_STEPSIZE * 0.5f; | 493 | HalfOdeStep = ODE_STEPSIZE * 0.5f; |
494 | odetimestepMS = (int)(1000.0f * ODE_STEPSIZE +0.5f); | ||
493 | 495 | ||
494 | ContactgeomsArray = Marshal.AllocHGlobal(contactsPerCollision * d.ContactGeom.unmanagedSizeOf); | 496 | ContactgeomsArray = Marshal.AllocHGlobal(contactsPerCollision * d.ContactGeom.unmanagedSizeOf); |
495 | GlobalContactsArray = GlobalContactsArray = Marshal.AllocHGlobal(maxContactsbeforedeath * d.Contact.unmanagedSizeOf); | 497 | GlobalContactsArray = GlobalContactsArray = Marshal.AllocHGlobal(maxContactsbeforedeath * d.Contact.unmanagedSizeOf); |
@@ -1827,7 +1829,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1827 | { | 1829 | { |
1828 | int ttmpstart = Util.EnvironmentTickCount(); | 1830 | int ttmpstart = Util.EnvironmentTickCount(); |
1829 | int ttmp; | 1831 | int ttmp; |
1830 | int ttmp2; | ||
1831 | 1832 | ||
1832 | while(ChangesQueue.Dequeue(out item)) | 1833 | while(ChangesQueue.Dequeue(out item)) |
1833 | { | 1834 | { |
@@ -1849,11 +1850,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1849 | if (ttmp > 20) | 1850 | if (ttmp > 20) |
1850 | break; | 1851 | break; |
1851 | } | 1852 | } |
1852 | |||
1853 | ttmp2 = Util.EnvironmentTickCountSubtract(ttmpstart); | ||
1854 | if (ttmp2 > 50) | ||
1855 | ttmp2 = 0; | ||
1856 | |||
1857 | } | 1853 | } |
1858 | 1854 | ||
1859 | // Move characters | 1855 | // Move characters |
@@ -1899,7 +1895,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1899 | { | 1895 | { |
1900 | case ActorTypes.Agent: | 1896 | case ActorTypes.Agent: |
1901 | OdeCharacter cobj = (OdeCharacter)obj; | 1897 | OdeCharacter cobj = (OdeCharacter)obj; |
1902 | cobj.AddCollisionFrameTime((int)(ODE_STEPSIZE * 1000.0f)); | 1898 | cobj.AddCollisionFrameTime((int)(odetimestepMS)); |
1903 | cobj.SendCollisions(); | 1899 | cobj.SendCollisions(); |
1904 | break; | 1900 | break; |
1905 | 1901 | ||
@@ -1907,7 +1903,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1907 | OdePrim pobj = (OdePrim)obj; | 1903 | OdePrim pobj = (OdePrim)obj; |
1908 | if (pobj.Body == IntPtr.Zero || (d.BodyIsEnabled(pobj.Body) && !pobj.m_outbounds)) | 1904 | if (pobj.Body == IntPtr.Zero || (d.BodyIsEnabled(pobj.Body) && !pobj.m_outbounds)) |
1909 | { | 1905 | { |
1910 | pobj.AddCollisionFrameTime((int)(ODE_STEPSIZE * 1000.0f)); | 1906 | pobj.AddCollisionFrameTime((int)(odetimestepMS)); |
1911 | pobj.SendCollisions(); | 1907 | pobj.SendCollisions(); |
1912 | } | 1908 | } |
1913 | break; | 1909 | break; |
@@ -1924,21 +1920,21 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1924 | d.JointGroupEmpty(contactgroup); | 1920 | d.JointGroupEmpty(contactgroup); |
1925 | 1921 | ||
1926 | // update managed ideia of physical data and do updates to core | 1922 | // update managed ideia of physical data and do updates to core |
1927 | /* | 1923 | /* |
1928 | lock (_characters) | 1924 | lock (_characters) |
1929 | { | 1925 | { |
1930 | foreach (OdeCharacter actor in _characters) | 1926 | foreach (OdeCharacter actor in _characters) |
1931 | { | 1927 | { |
1932 | if (actor != null) | 1928 | if (actor != null) |
1933 | { | 1929 | { |
1934 | if (actor.bad) | 1930 | if (actor.bad) |
1935 | m_log.WarnFormat("[PHYSICS]: BAD Actor {0} in _characters list was not removed?", actor.m_uuid); | 1931 | m_log.WarnFormat("[PHYSICS]: BAD Actor {0} in _characters list was not removed?", actor.m_uuid); |
1936 | 1932 | ||
1937 | actor.UpdatePositionAndVelocity(); | 1933 | actor.UpdatePositionAndVelocity(); |
1938 | } | 1934 | } |
1939 | } | 1935 | } |
1940 | } | 1936 | } |
1941 | */ | 1937 | */ |
1942 | 1938 | ||
1943 | lock (_activegroups) | 1939 | lock (_activegroups) |
1944 | { | 1940 | { |