aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/ChOdePlugin
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/ChOdePlugin')
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs21
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs18
2 files changed, 29 insertions, 10 deletions
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
index 0c79aa6..ae63cfa 100644
--- a/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
@@ -269,7 +269,10 @@ namespace OpenSim.Region.Physics.OdePlugin
269 /// </summary> 269 /// </summary>
270 public override bool IsColliding 270 public override bool IsColliding
271 { 271 {
272 get { return m_iscolliding; } 272//#@ get { return m_iscolliding; }
273 get { //##
274//Console.WriteLine(">>>>>>>>>>>> IC get = {0}", m_iscolliding); //##
275 return m_iscolliding; } //##
273 set 276 set
274 { 277 {
275 int i; 278 int i;
@@ -307,6 +310,7 @@ namespace OpenSim.Region.Physics.OdePlugin
307 { 310 {
308 m_iscolliding = true; 311 m_iscolliding = true;
309 } 312 }
313// ## Console.WriteLine("IC SET = {0} t{1} f{2} i {3}", value, truecount, falsecount, m_iscolliding);
310 if (m_wascolliding != m_iscolliding) 314 if (m_wascolliding != m_iscolliding)
311 { 315 {
312 //base.SendCollisionUpdate(new CollisionEventUpdate()); 316 //base.SendCollisionUpdate(new CollisionEventUpdate());
@@ -589,7 +593,7 @@ namespace OpenSim.Region.Physics.OdePlugin
589 Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH); 593 Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH);
590 _parent_scene.geom_name_map[Shell] = m_name; 594 _parent_scene.geom_name_map[Shell] = m_name;
591 _parent_scene.actor_name_map[Shell] = (PhysicsActor)this; 595 _parent_scene.actor_name_map[Shell] = (PhysicsActor)this;
592//Console.WriteLine("**** Create {2} Dicts: actor={0} name={1}", _parent_scene.actor_name_map.Count, _parent_scene.geom_name_map.Count, m_name); 596Console.WriteLine("**** Create {2} Dicts: actor={0} name={1} height={3} rad={4}", _parent_scene.actor_name_map.Count, _parent_scene.geom_name_map.Count, m_name, CAPSULE_LENGTH, CAPSULE_RADIUS);
593 597
594 d.GeomSetCategoryBits(Shell, (int)m_collisionCategories); 598 d.GeomSetCategoryBits(Shell, (int)m_collisionCategories);
595 d.GeomSetCollideBits(Shell, (int)m_collisionFlags); 599 d.GeomSetCollideBits(Shell, (int)m_collisionFlags);
@@ -857,7 +861,9 @@ namespace OpenSim.Region.Physics.OdePlugin
857 { 861 {
858 m_pidControllerActive = false; 862 m_pidControllerActive = false;
859 force *= 100f; 863 force *= 100f;
860 doForce(force); 864//Console.WriteLine("DF 1"); // ##
865 if (!force.ApproxEquals(Vector3.Zero, 0.01f))
866 doForce(force);
861 // If uncommented, things get pushed off world 867 // If uncommented, things get pushed off world
862 // 868 //
863 // m_log.Debug("Push!"); 869 // m_log.Debug("Push!");
@@ -896,7 +902,8 @@ namespace OpenSim.Region.Physics.OdePlugin
896 d.BodyAddForce(Body, force.X, force.Y, force.Z); 902 d.BodyAddForce(Body, force.X, force.Y, force.Z);
897 //d.BodySetRotation(Body, ref m_StandUpRotation); 903 //d.BodySetRotation(Body, ref m_StandUpRotation);
898 //standupStraight(); 904 //standupStraight();
899 905 d.Vector3 vel = d.BodyGetLinearVel(Body); //##
906//Console.WriteLine("AvVel <{0},{1},{2}>", vel.X, vel.Y, vel.Z); //##
900 } 907 }
901 } 908 }
902 909
@@ -1103,12 +1110,14 @@ namespace OpenSim.Region.Physics.OdePlugin
1103 } 1110 }
1104 if (vec.IsFinite()) 1111 if (vec.IsFinite())
1105 { 1112 {
1106 if (!vec.ApproxEquals(Vector3.Zero, 0.01f)) 1113 if (!vec.ApproxEquals(Vector3.Zero, 0.02f)) // 0.01 allows 0.002 !!
1107 { 1114 {
1115//Console.WriteLine("DF 2"); // ##
1116
1108 doForce(vec); 1117 doForce(vec);
1109 if (!_zeroFlag) 1118 if (!_zeroFlag)
1110 { 1119 {
1111 AlignAvatarTiltWithCurrentDirectionOfMovement(vec); 1120// AlignAvatarTiltWithCurrentDirectionOfMovement(vec);
1112 } 1121 }
1113 } 1122 }
1114 } 1123 }
diff --git a/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
index ab084fd..86f9893 100644
--- a/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
@@ -713,7 +713,7 @@ namespace OpenSim.Region.Physics.OdePlugin
713 713
714 // Test if we're colliding a geom with a space. 714 // Test if we're colliding a geom with a space.
715 // If so we have to drill down into the space recursively 715 // If so we have to drill down into the space recursively
716 716//Console.WriteLine("near -----------"); //##
717 if (d.GeomIsSpace(g1) || d.GeomIsSpace(g2)) 717 if (d.GeomIsSpace(g1) || d.GeomIsSpace(g2))
718 { 718 {
719 if (g1 == IntPtr.Zero || g2 == IntPtr.Zero) 719 if (g1 == IntPtr.Zero || g2 == IntPtr.Zero)
@@ -844,11 +844,21 @@ namespace OpenSim.Region.Physics.OdePlugin
844 // Testing if the collision is at the feet of the avatar 844 // Testing if the collision is at the feet of the avatar
845 845
846 //m_log.DebugFormat("[PHYSICS]: {0} - {1} - {2} - {3}", curContact.pos.Z, p2.Position.Z, (p2.Position.Z - curContact.pos.Z), (p2.Size.Z * 0.6f)); 846 //m_log.DebugFormat("[PHYSICS]: {0} - {1} - {2} - {3}", curContact.pos.Z, p2.Position.Z, (p2.Position.Z - curContact.pos.Z), (p2.Size.Z * 0.6f));
847 if ((p2.Position.Z - curContact.pos.Z) > (p2.Size.Z * 0.6f)) 847//#@ if ((p2.Position.Z - curContact.pos.Z) > (p2.Size.Z * 0.6f))
848 p2.IsColliding = true; 848//#@ p2.IsColliding = true;
849 } 849 if ((p2.Position.Z - curContact.pos.Z) > (p2.Size.Z * 0.6f)){ //##
850//Console.WriteLine("AvColl 1 {0} - {1} - {2} - {3}", //##
851// curContact.pos.Z, p2.Position.Z, (p2.Position.Z - curContact.pos.Z), (p2.Size.Z * 0.6f)); //##
852 p2.IsColliding = true; //##
853 }else{
854//Console.WriteLine("AvColl 2 {0} - {1} - {2} - {3}", //##
855// curContact.pos.Z, p2.Position.Z, (p2.Position.Z - curContact.pos.Z), (p2.Size.Z * 0.6f)); //##
856
857 } //##
858 }
850 else 859 else
851 { 860 {
861//Console.WriteLine("AvColl 3 {0}", p2.PhysicsActorType); //##
852 p2.IsColliding = true; 862 p2.IsColliding = true;
853 } 863 }
854 864