aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs65
1 files changed, 43 insertions, 22 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index b528b9b..a397467 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -539,28 +539,28 @@ namespace OpenSim.Region.Physics.OdePlugin
539 /// debugging code 539 /// debugging code
540 float Zoff = -33.0f; 540 float Zoff = -33.0f;
541 d.Matrix3 temp = d.BodyGetRotation(actor.Body); 541 d.Matrix3 temp = d.BodyGetRotation(actor.Body);
542 Console.WriteLine("RENDER: cylinder; " + // shape 542 //Console.WriteLine("RENDER: cylinder; " + // shape
543 OdeCharacter.CAPSULE_RADIUS + ", " + OdeCharacter.CAPSULE_LENGTH + //size 543 //OdeCharacter.CAPSULE_RADIUS + ", " + OdeCharacter.CAPSULE_LENGTH + //size
544 "; 0, 1, 0; " + // color 544 //"; 0, 1, 0; " + // color
545 (actor.Position.X - 128.0f) + ", " + (actor.Position.Y - 128.0f) + ", " + 545 //(actor.Position.X - 128.0f) + ", " + (actor.Position.Y - 128.0f) + ", " +
546 (actor.Position.Z + Zoff) + "; " + // position 546 //(actor.Position.Z + Zoff) + "; " + // position
547 temp.M00 + "," + temp.M10 + "," + temp.M20 + ", " + // rotation 547 //temp.M00 + "," + temp.M10 + "," + temp.M20 + ", " + // rotation
548 temp.M01 + "," + temp.M11 + "," + temp.M21 + ", " + 548 //temp.M01 + "," + temp.M11 + "," + temp.M21 + ", " +
549 temp.M02 + "," + temp.M12 + "," + temp.M22); 549 //temp.M02 + "," + temp.M12 + "," + temp.M22);
550 d.Vector3 caphead; 550 d.Vector3 caphead;
551 d.BodyGetRelPointPos(actor.Body, 0, 0, OdeCharacter.CAPSULE_LENGTH*.5f, out caphead); 551 //d.BodyGetRelPointPos(actor.Body, 0, 0, OdeCharacter.CAPSULE_LENGTH*.5f, out caphead);
552 d.Vector3 capfoot; 552 d.Vector3 capfoot;
553 d.BodyGetRelPointPos(actor.Body, 0, 0, -OdeCharacter.CAPSULE_LENGTH*.5f, out capfoot); 553 //d.BodyGetRelPointPos(actor.Body, 0, 0, -OdeCharacter.CAPSULE_LENGTH*.5f, out capfoot);
554 Console.WriteLine("RENDER: sphere; " + OdeCharacter.CAPSULE_RADIUS + // shape, size 554 //Console.WriteLine("RENDER: sphere; " + OdeCharacter.CAPSULE_RADIUS + // shape, size
555 "; 1, 0, 1; " + //color 555 //"; 1, 0, 1; " + //color
556 (caphead.X - 128.0f) + ", " + (caphead.Y - 128.0f) + ", " + (caphead.Z + Zoff) + 556 //(caphead.X - 128.0f) + ", " + (caphead.Y - 128.0f) + ", " + (caphead.Z + Zoff) +
557 "; " + // position 557 //"; " + // position
558 "1,0,0, 0,1,0, 0,0,1"); // rotation 558 ///"1,0,0, 0,1,0, 0,0,1"); // rotation
559 Console.WriteLine("RENDER: sphere; " + OdeCharacter.CAPSULE_RADIUS + // shape, size 559 // Console.WriteLine("RENDER: sphere; " + OdeCharacter.CAPSULE_RADIUS + // shape, size
560 "; 1, 0, 0; " + //color 560 //"; 1, 0, 0; " + //color
561 (capfoot.X - 128.0f) + ", " + (capfoot.Y - 128.0f) + ", " + (capfoot.Z + Zoff) + 561 //(capfoot.X - 128.0f) + ", " + (capfoot.Y - 128.0f) + ", " + (capfoot.Z + Zoff) +
562 "; " + // position 562 //"; " + // position
563 "1,0,0, 0,1,0, 0,0,1"); // rotation 563 //"1,0,0, 0,1,0, 0,0,1"); // rotation
564 } 564 }
565 } 565 }
566 if (timeStep < 0.2f) 566 if (timeStep < 0.2f)
@@ -656,11 +656,12 @@ namespace OpenSim.Region.Physics.OdePlugin
656 private static float PID_P = 7000.0f; 656 private static float PID_P = 7000.0f;
657 private static float POSTURE_SERVO = 10000.0f; 657 private static float POSTURE_SERVO = 10000.0f;
658 public static float CAPSULE_RADIUS = 0.5f; 658 public static float CAPSULE_RADIUS = 0.5f;
659 public static float CAPSULE_LENGTH = 0.79f; 659 public float CAPSULE_LENGTH = 0.79f;
660 private bool flying = false; 660 private bool flying = false;
661 private bool m_iscolliding = false; 661 private bool m_iscolliding = false;
662 private bool m_wascolliding = false; 662 private bool m_wascolliding = false;
663 private bool m_alwaysRun = false; 663 private bool m_alwaysRun = false;
664 private string m_name = "";
664 665
665 private bool[] m_colliderarr = new bool[11]; 666 private bool[] m_colliderarr = new bool[11];
666 667
@@ -695,6 +696,7 @@ namespace OpenSim.Region.Physics.OdePlugin
695 d.BodySetPosition(Body, pos.X, pos.Y, pos.Z); 696 d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
696 d.GeomSetBody(Shell, Body); 697 d.GeomSetBody(Shell, Body);
697 } 698 }
699 m_name = avName;
698 parent_scene.geom_name_map[Shell] = avName; 700 parent_scene.geom_name_map[Shell] = avName;
699 parent_scene.actor_name_map[Shell] = (PhysicsActor)this; 701 parent_scene.actor_name_map[Shell] = (PhysicsActor)this;
700 } 702 }
@@ -802,7 +804,26 @@ namespace OpenSim.Region.Physics.OdePlugin
802 public override PhysicsVector Size 804 public override PhysicsVector Size
803 { 805 {
804 get { return new PhysicsVector(CAPSULE_RADIUS*2, CAPSULE_RADIUS*2, CAPSULE_LENGTH); } 806 get { return new PhysicsVector(CAPSULE_RADIUS*2, CAPSULE_RADIUS*2, CAPSULE_LENGTH); }
805 set { } 807 set {
808 lock (OdeScene.OdeLock)
809 {
810 PhysicsVector SetSize = value;
811 float prevCapsule = CAPSULE_LENGTH;
812
813 CAPSULE_LENGTH = (SetSize.Z - (CAPSULE_RADIUS * 2))/ 1.75f; //;
814 d.BodyDestroy(Body);
815 d.GeomDestroy(Shell);
816 //OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICS", "Set Avatar Height To: " + (CAPSULE_RADIUS + CAPSULE_LENGTH));
817 Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH);
818 d.MassSetCapsule(out ShellMass, 50.0f, 3, CAPSULE_RADIUS, CAPSULE_LENGTH);
819 Body = d.BodyCreate(_parent_scene.world);
820 d.BodySetMass(Body, ref ShellMass);
821 d.BodySetPosition(Body, _position.X, _position.Y, _position.Z + Math.Abs(CAPSULE_LENGTH-prevCapsule));
822 d.GeomSetBody(Shell, Body);
823 }
824 _parent_scene.geom_name_map[Shell] = m_name;
825 _parent_scene.actor_name_map[Shell] = (PhysicsActor)this;
826 }
806 } 827 }
807 828
808 public override PrimitiveBaseShape Shape 829 public override PrimitiveBaseShape Shape