diff options
author | Justin Clark-Casey (justincc) | 2011-07-08 18:34:44 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-07-08 18:34:44 +0100 |
commit | 29034bc0e0a8c24d7f2b8de8544d593ed5ac663f (patch) | |
tree | 7d9a454ebbd7627b24c605ba3711e7b86c818207 /OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |
parent | refactor: Separate the OdeScene class into its own file from OdePlugin.cs, to... (diff) | |
download | opensim-SC_OLD-29034bc0e0a8c24d7f2b8de8544d593ed5ac663f.zip opensim-SC_OLD-29034bc0e0a8c24d7f2b8de8544d593ed5ac663f.tar.gz opensim-SC_OLD-29034bc0e0a8c24d7f2b8de8544d593ed5ac663f.tar.bz2 opensim-SC_OLD-29034bc0e0a8c24d7f2b8de8544d593ed5ac663f.tar.xz |
minor: code tidy up - remove a couple of Console.WriteLine() accidentally added in the last commit
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODEPrim.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 62 |
1 files changed, 15 insertions, 47 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 1060278..bc839e0 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -54,7 +54,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
54 | /// <summary> | 54 | /// <summary> |
55 | /// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves. | 55 | /// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves. |
56 | /// </summary> | 56 | /// </summary> |
57 | |||
58 | public class OdePrim : PhysicsActor | 57 | public class OdePrim : PhysicsActor |
59 | { | 58 | { |
60 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 59 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -279,14 +278,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
279 | 278 | ||
280 | public override bool Selected | 279 | public override bool Selected |
281 | { | 280 | { |
282 | set { | 281 | set |
283 | 282 | { | |
284 | |||
285 | // This only makes the object not collidable if the object | 283 | // This only makes the object not collidable if the object |
286 | // is physical or the object is modified somehow *IN THE FUTURE* | 284 | // is physical or the object is modified somehow *IN THE FUTURE* |
287 | // without this, if an avatar selects prim, they can walk right | 285 | // without this, if an avatar selects prim, they can walk right |
288 | // through it while it's selected | 286 | // through it while it's selected |
289 | m_collisionscore = 0; | 287 | m_collisionscore = 0; |
288 | |||
290 | if ((m_isphysical && !_zeroFlag) || !value) | 289 | if ((m_isphysical && !_zeroFlag) || !value) |
291 | { | 290 | { |
292 | m_taintselected = value; | 291 | m_taintselected = value; |
@@ -297,7 +296,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
297 | m_taintselected = value; | 296 | m_taintselected = value; |
298 | m_isSelected = value; | 297 | m_isSelected = value; |
299 | } | 298 | } |
300 | if (m_isSelected) disableBodySoft(); | 299 | |
300 | if (m_isSelected) | ||
301 | disableBodySoft(); | ||
301 | } | 302 | } |
302 | } | 303 | } |
303 | 304 | ||
@@ -324,8 +325,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
324 | //m_log.Warn("Setting Geom to: " + prim_geom); | 325 | //m_log.Warn("Setting Geom to: " + prim_geom); |
325 | } | 326 | } |
326 | 327 | ||
327 | |||
328 | |||
329 | public void enableBodySoft() | 328 | public void enableBodySoft() |
330 | { | 329 | { |
331 | if (!childPrim) | 330 | if (!childPrim) |
@@ -626,8 +625,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
626 | break; | 625 | break; |
627 | } | 626 | } |
628 | 627 | ||
629 | |||
630 | |||
631 | float taperX1; | 628 | float taperX1; |
632 | float taperY1; | 629 | float taperY1; |
633 | float taperX; | 630 | float taperX; |
@@ -682,9 +679,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
682 | // else if (returnMass > _parent_scene.maximumMassObject) | 679 | // else if (returnMass > _parent_scene.maximumMassObject) |
683 | // returnMass = _parent_scene.maximumMassObject; | 680 | // returnMass = _parent_scene.maximumMassObject; |
684 | 681 | ||
685 | |||
686 | |||
687 | |||
688 | // Recursively calculate mass | 682 | // Recursively calculate mass |
689 | bool HasChildPrim = false; | 683 | bool HasChildPrim = false; |
690 | lock (childrenPrim) | 684 | lock (childrenPrim) |
@@ -693,8 +687,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
693 | { | 687 | { |
694 | HasChildPrim = true; | 688 | HasChildPrim = true; |
695 | } | 689 | } |
696 | |||
697 | } | 690 | } |
691 | |||
698 | if (HasChildPrim) | 692 | if (HasChildPrim) |
699 | { | 693 | { |
700 | OdePrim[] childPrimArr = new OdePrim[0]; | 694 | OdePrim[] childPrimArr = new OdePrim[0]; |
@@ -711,10 +705,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
711 | break; | 705 | break; |
712 | } | 706 | } |
713 | } | 707 | } |
708 | |||
714 | if (returnMass > _parent_scene.maximumMassObject) | 709 | if (returnMass > _parent_scene.maximumMassObject) |
715 | returnMass = _parent_scene.maximumMassObject; | 710 | returnMass = _parent_scene.maximumMassObject; |
711 | |||
716 | return returnMass; | 712 | return returnMass; |
717 | }// end CalculateMass | 713 | } |
718 | 714 | ||
719 | #endregion | 715 | #endregion |
720 | 716 | ||
@@ -937,7 +933,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
937 | } | 933 | } |
938 | } | 934 | } |
939 | 935 | ||
940 | |||
941 | private void changeAngularLock(float timestep) | 936 | private void changeAngularLock(float timestep) |
942 | { | 937 | { |
943 | // do we have a Physical object? | 938 | // do we have a Physical object? |
@@ -965,7 +960,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
965 | } | 960 | } |
966 | // Store this for later in case we get turned into a separate body | 961 | // Store this for later in case we get turned into a separate body |
967 | m_angularlock = m_taintAngularLock; | 962 | m_angularlock = m_taintAngularLock; |
968 | |||
969 | } | 963 | } |
970 | 964 | ||
971 | private void changelink(float timestep) | 965 | private void changelink(float timestep) |
@@ -1104,7 +1098,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1104 | m_log.DebugFormat("[PHYSICS]: {0} ain't got no boooooooooddy, no body", Name); | 1098 | m_log.DebugFormat("[PHYSICS]: {0} ain't got no boooooooooddy, no body", Name); |
1105 | } | 1099 | } |
1106 | 1100 | ||
1107 | |||
1108 | prm.m_interpenetrationcount = 0; | 1101 | prm.m_interpenetrationcount = 0; |
1109 | prm.m_collisionscore = 0; | 1102 | prm.m_collisionscore = 0; |
1110 | prm.m_disabled = false; | 1103 | prm.m_disabled = false; |
@@ -1164,7 +1157,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1164 | } | 1157 | } |
1165 | } | 1158 | } |
1166 | } | 1159 | } |
1167 | |||
1168 | } | 1160 | } |
1169 | 1161 | ||
1170 | private void ChildSetGeom(OdePrim odePrim) | 1162 | private void ChildSetGeom(OdePrim odePrim) |
@@ -1225,17 +1217,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1225 | //Console.WriteLine("childrenPrim.Remove " + odePrim); | 1217 | //Console.WriteLine("childrenPrim.Remove " + odePrim); |
1226 | childrenPrim.Remove(odePrim); | 1218 | childrenPrim.Remove(odePrim); |
1227 | } | 1219 | } |
1228 | |||
1229 | |||
1230 | |||
1231 | 1220 | ||
1232 | if (Body != IntPtr.Zero) | 1221 | if (Body != IntPtr.Zero) |
1233 | { | 1222 | { |
1234 | _parent_scene.remActivePrim(this); | 1223 | _parent_scene.remActivePrim(this); |
1235 | } | 1224 | } |
1236 | 1225 | ||
1237 | |||
1238 | |||
1239 | lock (childrenPrim) | 1226 | lock (childrenPrim) |
1240 | { | 1227 | { |
1241 | foreach (OdePrim prm in childrenPrim) | 1228 | foreach (OdePrim prm in childrenPrim) |
@@ -1244,8 +1231,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1244 | ParentPrim(prm); | 1231 | ParentPrim(prm); |
1245 | } | 1232 | } |
1246 | } | 1233 | } |
1247 | |||
1248 | |||
1249 | } | 1234 | } |
1250 | 1235 | ||
1251 | private void changeSelectedStatus(float timestep) | 1236 | private void changeSelectedStatus(float timestep) |
@@ -1685,13 +1670,11 @@ Console.WriteLine(" JointCreateFixed"); | |||
1685 | { | 1670 | { |
1686 | PID_G = m_PIDTau + 1; | 1671 | PID_G = m_PIDTau + 1; |
1687 | } | 1672 | } |
1688 | |||
1689 | 1673 | ||
1690 | // Where are we, and where are we headed? | 1674 | // Where are we, and where are we headed? |
1691 | d.Vector3 pos = d.BodyGetPosition(Body); | 1675 | d.Vector3 pos = d.BodyGetPosition(Body); |
1692 | d.Vector3 vel = d.BodyGetLinearVel(Body); | 1676 | d.Vector3 vel = d.BodyGetLinearVel(Body); |
1693 | 1677 | ||
1694 | |||
1695 | // Non-Vehicles have a limited set of Hover options. | 1678 | // Non-Vehicles have a limited set of Hover options. |
1696 | // determine what our target height really is based on HoverType | 1679 | // determine what our target height really is based on HoverType |
1697 | switch (m_PIDHoverType) | 1680 | switch (m_PIDHoverType) |
@@ -1797,8 +1780,6 @@ Console.WriteLine(" JointCreateFixed"); | |||
1797 | } | 1780 | } |
1798 | } | 1781 | } |
1799 | 1782 | ||
1800 | |||
1801 | |||
1802 | public void rotate(float timestep) | 1783 | public void rotate(float timestep) |
1803 | { | 1784 | { |
1804 | d.Quaternion myrot = new d.Quaternion(); | 1785 | d.Quaternion myrot = new d.Quaternion(); |
@@ -1909,7 +1890,6 @@ Console.WriteLine(" JointCreateFixed"); | |||
1909 | 1890 | ||
1910 | public void changesize(float timestamp) | 1891 | public void changesize(float timestamp) |
1911 | { | 1892 | { |
1912 | |||
1913 | string oldname = _parent_scene.geom_name_map[prim_geom]; | 1893 | string oldname = _parent_scene.geom_name_map[prim_geom]; |
1914 | 1894 | ||
1915 | if (_size.X <= 0) _size.X = 0.01f; | 1895 | if (_size.X <= 0) _size.X = 0.01f; |
@@ -1961,15 +1941,13 @@ Console.WriteLine(" JointCreateFixed"); | |||
1961 | mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); | 1941 | mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); |
1962 | 1942 | ||
1963 | //IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); | 1943 | //IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); |
1964 | Console.WriteLine("changesize 1"); | 1944 | //Console.WriteLine("changesize 1"); |
1965 | CreateGeom(m_targetSpace, mesh); | 1945 | CreateGeom(m_targetSpace, mesh); |
1966 | |||
1967 | |||
1968 | } | 1946 | } |
1969 | else | 1947 | else |
1970 | { | 1948 | { |
1971 | _mesh = null; | 1949 | _mesh = null; |
1972 | Console.WriteLine("changesize 2"); | 1950 | //Console.WriteLine("changesize 2"); |
1973 | CreateGeom(m_targetSpace, _mesh); | 1951 | CreateGeom(m_targetSpace, _mesh); |
1974 | } | 1952 | } |
1975 | 1953 | ||
@@ -2005,8 +1983,6 @@ Console.WriteLine("changesize 2"); | |||
2005 | m_taintsize = _size; | 1983 | m_taintsize = _size; |
2006 | } | 1984 | } |
2007 | 1985 | ||
2008 | |||
2009 | |||
2010 | public void changefloatonwater(float timestep) | 1986 | public void changefloatonwater(float timestep) |
2011 | { | 1987 | { |
2012 | m_collidesWater = m_taintCollidesWater; | 1988 | m_collidesWater = m_taintCollidesWater; |
@@ -2071,13 +2047,13 @@ Console.WriteLine("changesize 2"); | |||
2071 | 2047 | ||
2072 | IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); | 2048 | IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); |
2073 | // createmesh returns null when it doesn't mesh. | 2049 | // createmesh returns null when it doesn't mesh. |
2074 | Console.WriteLine("changeshape needed meshing"); | 2050 | //Console.WriteLine("changeshape needed meshing"); |
2075 | CreateGeom(m_targetSpace, mesh); | 2051 | CreateGeom(m_targetSpace, mesh); |
2076 | } | 2052 | } |
2077 | else | 2053 | else |
2078 | { | 2054 | { |
2079 | _mesh = null; | 2055 | _mesh = null; |
2080 | Console.WriteLine("changeshape not need meshing"); | 2056 | //Console.WriteLine("changeshape not need meshing"); |
2081 | CreateGeom(m_targetSpace, null); | 2057 | CreateGeom(m_targetSpace, null); |
2082 | } | 2058 | } |
2083 | 2059 | ||
@@ -2162,11 +2138,8 @@ Console.WriteLine("changeshape not need meshing"); | |||
2162 | } | 2138 | } |
2163 | 2139 | ||
2164 | m_taintforce = false; | 2140 | m_taintforce = false; |
2165 | |||
2166 | } | 2141 | } |
2167 | 2142 | ||
2168 | |||
2169 | |||
2170 | public void changeSetTorque(float timestamp) | 2143 | public void changeSetTorque(float timestamp) |
2171 | { | 2144 | { |
2172 | if (!m_isSelected) | 2145 | if (!m_isSelected) |
@@ -2835,7 +2808,6 @@ Console.WriteLine("changeshape not need meshing"); | |||
2835 | 2808 | ||
2836 | public override float APIDDamping{ set { return; } } | 2809 | public override float APIDDamping{ set { return; } } |
2837 | 2810 | ||
2838 | |||
2839 | private void createAMotor(Vector3 axis) | 2811 | private void createAMotor(Vector3 axis) |
2840 | { | 2812 | { |
2841 | if (Body == IntPtr.Zero) | 2813 | if (Body == IntPtr.Zero) |
@@ -2955,7 +2927,6 @@ Console.WriteLine("changeshape not need meshing"); | |||
2955 | //d.JointSetAMotorParam(Amotor, (int) dParam.Vel, 9000f); | 2927 | //d.JointSetAMotorParam(Amotor, (int) dParam.Vel, 9000f); |
2956 | d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f); | 2928 | d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f); |
2957 | d.JointSetAMotorParam(Amotor, (int)dParam.FMax, Mass * 50f);// | 2929 | d.JointSetAMotorParam(Amotor, (int)dParam.FMax, Mass * 50f);// |
2958 | |||
2959 | } | 2930 | } |
2960 | 2931 | ||
2961 | public Matrix4 FromDMass(d.Mass pMass) | 2932 | public Matrix4 FromDMass(d.Mass pMass) |
@@ -3040,8 +3011,6 @@ Console.WriteLine("changeshape not need meshing"); | |||
3040 | return Matrix4.Identity; // should probably throw an error. singluar matrix inverse not possible | 3011 | return Matrix4.Identity; // should probably throw an error. singluar matrix inverse not possible |
3041 | } | 3012 | } |
3042 | 3013 | ||
3043 | |||
3044 | |||
3045 | return (Adjoint(pMat) / determinant3x3(pMat)); | 3014 | return (Adjoint(pMat) / determinant3x3(pMat)); |
3046 | } | 3015 | } |
3047 | 3016 | ||
@@ -3078,6 +3047,7 @@ Console.WriteLine("changeshape not need meshing"); | |||
3078 | } | 3047 | } |
3079 | m++; | 3048 | m++; |
3080 | } | 3049 | } |
3050 | |||
3081 | return minor; | 3051 | return minor; |
3082 | } | 3052 | } |
3083 | 3053 | ||
@@ -3180,7 +3150,6 @@ Console.WriteLine("changeshape not need meshing"); | |||
3180 | 3150 | ||
3181 | det = diag1 + diag2 + diag3 - (diag4 + diag5 + diag6); | 3151 | det = diag1 + diag2 + diag3 - (diag4 + diag5 + diag6); |
3182 | return det; | 3152 | return det; |
3183 | |||
3184 | } | 3153 | } |
3185 | 3154 | ||
3186 | private static void DMassCopy(ref d.Mass src, ref d.Mass dst) | 3155 | private static void DMassCopy(ref d.Mass src, ref d.Mass dst) |
@@ -3205,6 +3174,5 @@ Console.WriteLine("changeshape not need meshing"); | |||
3205 | { | 3174 | { |
3206 | m_material = pMaterial; | 3175 | m_material = pMaterial; |
3207 | } | 3176 | } |
3208 | |||
3209 | } | 3177 | } |
3210 | } | 3178 | } |