diff options
author | Jeff Ames | 2008-08-18 00:39:10 +0000 |
---|---|---|
committer | Jeff Ames | 2008-08-18 00:39:10 +0000 |
commit | 6ef9d4da901a346c232458317cca6268da888e2e (patch) | |
tree | dd1d935b10f34f261839da9f9879c02322e8ede7 /OpenSim/Region/Physics/OdePlugin | |
parent | Update svn properties, minor formatting cleanup. (diff) | |
download | opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.zip opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.gz opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.bz2 opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODETestClass.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 164 |
2 files changed, 81 insertions, 89 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs index bc2ad69..074170a 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
40 | private OdePlugin cbt; | 40 | private OdePlugin cbt; |
41 | private PhysicsScene ps; | 41 | private PhysicsScene ps; |
42 | private IMeshingPlugin imp; | 42 | private IMeshingPlugin imp; |
43 | 43 | ||
44 | [SetUp] | 44 | [SetUp] |
45 | public void Initialize() | 45 | public void Initialize() |
46 | { | 46 | { |
@@ -96,11 +96,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
96 | 96 | ||
97 | Assert.That(!oprim.m_taintadd); | 97 | Assert.That(!oprim.m_taintadd); |
98 | Console.WriteLine("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString()); | 98 | Console.WriteLine("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString()); |
99 | 99 | ||
100 | // Make sure we're above the ground | 100 | // Make sure we're above the ground |
101 | //Assert.That(prim.Position.Z > 20f); | 101 | //Assert.That(prim.Position.Z > 20f); |
102 | //Console.WriteLine("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore); | 102 | //Console.WriteLine("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore); |
103 | 103 | ||
104 | // Make sure we've got a Body | 104 | // Make sure we've got a Body |
105 | Assert.That(oprim.Body != (IntPtr)0); | 105 | Assert.That(oprim.Body != (IntPtr)0); |
106 | //Console.WriteLine( | 106 | //Console.WriteLine( |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 3f8aa26..f285911 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -252,7 +252,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
252 | public int physics_logging_interval = 0; | 252 | public int physics_logging_interval = 0; |
253 | public bool physics_logging_append_existing_logfile = false; | 253 | public bool physics_logging_append_existing_logfile = false; |
254 | 254 | ||
255 | |||
256 | /// <summary> | 255 | /// <summary> |
257 | /// Initiailizes the scene | 256 | /// Initiailizes the scene |
258 | /// Sets many properties that ODE requires to be stable | 257 | /// Sets many properties that ODE requires to be stable |
@@ -352,14 +351,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
352 | 351 | ||
353 | geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", 10.000006836f); | 352 | geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", 10.000006836f); |
354 | bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", 20); | 353 | bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", 20); |
355 | 354 | ||
356 | bodyPIDD = physicsconfig.GetFloat("body_pid_derivative", 35f); | 355 | bodyPIDD = physicsconfig.GetFloat("body_pid_derivative", 35f); |
357 | bodyPIDG = physicsconfig.GetFloat("body_pid_gain", 25f); | 356 | bodyPIDG = physicsconfig.GetFloat("body_pid_gain", 25f); |
358 | 357 | ||
359 | meshSculptedPrim = physicsconfig.GetBoolean("mesh_sculpted_prim", true); | 358 | meshSculptedPrim = physicsconfig.GetBoolean("mesh_sculpted_prim", true); |
360 | meshSculptLOD = physicsconfig.GetFloat("mesh_lod", 32f); | 359 | meshSculptLOD = physicsconfig.GetFloat("mesh_lod", 32f); |
361 | MeshSculptphysicalLOD = physicsconfig.GetFloat("mesh_physical_lod", 16f); | 360 | MeshSculptphysicalLOD = physicsconfig.GetFloat("mesh_physical_lod", 16f); |
362 | |||
363 | 361 | ||
364 | if (Environment.OSVersion.Platform == PlatformID.Unix) | 362 | if (Environment.OSVersion.Platform == PlatformID.Unix) |
365 | { | 363 | { |
@@ -367,7 +365,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
367 | avPIDP = physicsconfig.GetFloat("av_pid_proportional_linux", 1400.0f); | 365 | avPIDP = physicsconfig.GetFloat("av_pid_proportional_linux", 1400.0f); |
368 | avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_linux", 2000000f); | 366 | avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_linux", 2000000f); |
369 | bodyMotorJointMaxforceTensor = physicsconfig.GetFloat("body_motor_joint_maxforce_tensor_linux", 2f); | 367 | bodyMotorJointMaxforceTensor = physicsconfig.GetFloat("body_motor_joint_maxforce_tensor_linux", 2f); |
370 | |||
371 | } | 368 | } |
372 | else | 369 | else |
373 | { | 370 | { |
@@ -547,7 +544,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
547 | } | 544 | } |
548 | catch (AccessViolationException) | 545 | catch (AccessViolationException) |
549 | { | 546 | { |
550 | |||
551 | m_log.Warn("[PHYSICS]: Unable to collide test an object"); | 547 | m_log.Warn("[PHYSICS]: Unable to collide test an object"); |
552 | return; | 548 | return; |
553 | } | 549 | } |
@@ -603,7 +599,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
603 | p2.CollidingGround = true; | 599 | p2.CollidingGround = true; |
604 | break; | 600 | break; |
605 | } | 601 | } |
606 | |||
607 | 602 | ||
608 | // we don't want prim or avatar to explode | 603 | // we don't want prim or avatar to explode |
609 | 604 | ||
@@ -850,87 +845,87 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
850 | case ActorTypes.Agent: | 845 | case ActorTypes.Agent: |
851 | cc2 = (OdeCharacter)p2; | 846 | cc2 = (OdeCharacter)p2; |
852 | 847 | ||
853 | // obj1LocalID = cc2.m_localID; | 848 | // obj1LocalID = cc2.m_localID; |
854 | switch ((ActorTypes)p1.PhysicsActorType) | 849 | switch ((ActorTypes)p1.PhysicsActorType) |
855 | { | 850 | { |
856 | case ActorTypes.Agent: | 851 | case ActorTypes.Agent: |
857 | cc1 = (OdeCharacter)p1; | 852 | cc1 = (OdeCharacter)p1; |
858 | obj2LocalID = cc1.m_localID; | 853 | obj2LocalID = cc1.m_localID; |
859 | cc1.AddCollisionEvent(cc2.m_localID, collisiondepth); | 854 | cc1.AddCollisionEvent(cc2.m_localID, collisiondepth); |
860 | //ctype = (int)CollisionCategories.Character; | 855 | //ctype = (int)CollisionCategories.Character; |
861 | 856 | ||
862 | //if (cc1.CollidingObj) | 857 | //if (cc1.CollidingObj) |
863 | //cStartStop = (int)StatusIndicators.Generic; | 858 | //cStartStop = (int)StatusIndicators.Generic; |
864 | //else | 859 | //else |
865 | //cStartStop = (int)StatusIndicators.Start; | 860 | //cStartStop = (int)StatusIndicators.Start; |
866 | 861 | ||
867 | //returncollisions = true; | 862 | //returncollisions = true; |
868 | break; | 863 | break; |
869 | case ActorTypes.Prim: | 864 | case ActorTypes.Prim: |
870 | cp1 = (OdePrim)p1; | 865 | cp1 = (OdePrim)p1; |
871 | obj2LocalID = cp1.m_localID; | 866 | obj2LocalID = cp1.m_localID; |
872 | cp1.AddCollisionEvent(cc2.m_localID, collisiondepth); | 867 | cp1.AddCollisionEvent(cc2.m_localID, collisiondepth); |
873 | //ctype = (int)CollisionCategories.Geom; | 868 | //ctype = (int)CollisionCategories.Geom; |
874 | 869 | ||
875 | //if (cp1.CollidingObj) | 870 | //if (cp1.CollidingObj) |
876 | //cStartStop = (int)StatusIndicators.Generic; | 871 | //cStartStop = (int)StatusIndicators.Generic; |
877 | //else | 872 | //else |
878 | //cStartStop = (int)StatusIndicators.Start; | 873 | //cStartStop = (int)StatusIndicators.Start; |
879 | 874 | ||
880 | //returncollisions = true; | 875 | //returncollisions = true; |
881 | break; | 876 | break; |
882 | 877 | ||
883 | case ActorTypes.Ground: | 878 | case ActorTypes.Ground: |
884 | case ActorTypes.Unknown: | 879 | case ActorTypes.Unknown: |
885 | obj2LocalID = 0; | 880 | obj2LocalID = 0; |
886 | //ctype = (int)CollisionCategories.Land; | 881 | //ctype = (int)CollisionCategories.Land; |
887 | //returncollisions = true; | 882 | //returncollisions = true; |
888 | break; | 883 | break; |
889 | } | 884 | } |
890 | 885 | ||
891 | cc2.AddCollisionEvent(obj2LocalID, collisiondepth); | 886 | cc2.AddCollisionEvent(obj2LocalID, collisiondepth); |
892 | break; | 887 | break; |
893 | case ActorTypes.Prim: | 888 | case ActorTypes.Prim: |
894 | cp2 = (OdePrim)p2; | 889 | cp2 = (OdePrim)p2; |
895 | 890 | ||
896 | // obj1LocalID = cp2.m_localID; | 891 | // obj1LocalID = cp2.m_localID; |
897 | switch ((ActorTypes)p1.PhysicsActorType) | 892 | switch ((ActorTypes)p1.PhysicsActorType) |
898 | { | 893 | { |
899 | case ActorTypes.Agent: | 894 | case ActorTypes.Agent: |
900 | cc1 = (OdeCharacter)p1; | 895 | cc1 = (OdeCharacter)p1; |
901 | obj2LocalID = cc1.m_localID; | 896 | obj2LocalID = cc1.m_localID; |
902 | cc1.AddCollisionEvent(cp2.m_localID, collisiondepth); | 897 | cc1.AddCollisionEvent(cp2.m_localID, collisiondepth); |
903 | //ctype = (int)CollisionCategories.Character; | 898 | //ctype = (int)CollisionCategories.Character; |
904 | 899 | ||
905 | //if (cc1.CollidingObj) | 900 | //if (cc1.CollidingObj) |
906 | //cStartStop = (int)StatusIndicators.Generic; | 901 | //cStartStop = (int)StatusIndicators.Generic; |
907 | //else | 902 | //else |
908 | //cStartStop = (int)StatusIndicators.Start; | 903 | //cStartStop = (int)StatusIndicators.Start; |
909 | //returncollisions = true; | 904 | //returncollisions = true; |
910 | 905 | ||
911 | break; | 906 | break; |
912 | case ActorTypes.Prim: | 907 | case ActorTypes.Prim: |
913 | cp1 = (OdePrim)p1; | 908 | cp1 = (OdePrim)p1; |
914 | obj2LocalID = cp1.m_localID; | 909 | obj2LocalID = cp1.m_localID; |
915 | cp1.AddCollisionEvent(cp2.m_localID, collisiondepth); | 910 | cp1.AddCollisionEvent(cp2.m_localID, collisiondepth); |
916 | //ctype = (int)CollisionCategories.Geom; | 911 | //ctype = (int)CollisionCategories.Geom; |
917 | 912 | ||
918 | //if (cp1.CollidingObj) | 913 | //if (cp1.CollidingObj) |
919 | //cStartStop = (int)StatusIndicators.Generic; | 914 | //cStartStop = (int)StatusIndicators.Generic; |
920 | //else | 915 | //else |
921 | //cStartStop = (int)StatusIndicators.Start; | 916 | //cStartStop = (int)StatusIndicators.Start; |
922 | 917 | ||
923 | //returncollisions = true; | 918 | //returncollisions = true; |
924 | break; | 919 | break; |
925 | 920 | ||
926 | case ActorTypes.Ground: | 921 | case ActorTypes.Ground: |
927 | case ActorTypes.Unknown: | 922 | case ActorTypes.Unknown: |
928 | obj2LocalID = 0; | 923 | obj2LocalID = 0; |
929 | //ctype = (int)CollisionCategories.Land; | 924 | //ctype = (int)CollisionCategories.Land; |
930 | 925 | ||
931 | //returncollisions = true; | 926 | //returncollisions = true; |
932 | break; | 927 | break; |
933 | } | 928 | } |
934 | 929 | ||
935 | cp2.AddCollisionEvent(obj2LocalID, collisiondepth); | 930 | cp2.AddCollisionEvent(obj2LocalID, collisiondepth); |
936 | break; | 931 | break; |
@@ -1015,7 +1010,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1015 | /// <param name="timeStep"></param> | 1010 | /// <param name="timeStep"></param> |
1016 | private void collision_optimized(float timeStep) | 1011 | private void collision_optimized(float timeStep) |
1017 | { | 1012 | { |
1018 | |||
1019 | foreach (OdeCharacter chr in _characters) | 1013 | foreach (OdeCharacter chr in _characters) |
1020 | { | 1014 | { |
1021 | // Reset the collision values to false | 1015 | // Reset the collision values to false |
@@ -1579,7 +1573,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1579 | // if (pbs.ProfileShape == ProfileShape.EquilateralTriangle) | 1573 | // if (pbs.ProfileShape == ProfileShape.EquilateralTriangle) |
1580 | // return true; | 1574 | // return true; |
1581 | 1575 | ||
1582 | 1576 | ||
1583 | 1577 | ||
1584 | // return false; | 1578 | // return false; |
1585 | 1579 | ||
@@ -1625,7 +1619,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1625 | //m_log.Info(timeStep.ToString()); | 1619 | //m_log.Info(timeStep.ToString()); |
1626 | step_time += timeStep; | 1620 | step_time += timeStep; |
1627 | 1621 | ||
1628 | |||
1629 | // If We're loaded down by something else, | 1622 | // If We're loaded down by something else, |
1630 | // or debugging with the Visual Studio project on pause | 1623 | // or debugging with the Visual Studio project on pause |
1631 | // skip a few frames to catch up gracefully. | 1624 | // skip a few frames to catch up gracefully. |
@@ -1739,7 +1732,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1739 | } | 1732 | } |
1740 | 1733 | ||
1741 | d.WorldQuickStep(world, ODE_STEPSIZE); | 1734 | d.WorldQuickStep(world, ODE_STEPSIZE); |
1742 | |||
1743 | d.JointGroupEmpty(contactgroup); | 1735 | d.JointGroupEmpty(contactgroup); |
1744 | //ode.dunlock(world); | 1736 | //ode.dunlock(world); |
1745 | } | 1737 | } |
@@ -2075,7 +2067,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2075 | if (resultarr2[y, x] <= 0) | 2067 | if (resultarr2[y, x] <= 0) |
2076 | { | 2068 | { |
2077 | returnarr[i] = 0.0000001f; | 2069 | returnarr[i] = 0.0000001f; |
2078 | 2070 | ||
2079 | } | 2071 | } |
2080 | else | 2072 | else |
2081 | returnarr[i] = resultarr2[y, x]; | 2073 | returnarr[i] = resultarr2[y, x]; |