aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMW2007-08-23 11:38:50 +0000
committerMW2007-08-23 11:38:50 +0000
commitedd50f2e8ea384e1fe9f9dc0ed5903477cb383f3 (patch)
treed2444c1588b98d28fbedb43dbac8772b01a53762
parentAdded a PhysicsActor PhysActor member to SceneObjectPart, and made it so this... (diff)
downloadopensim-SC-edd50f2e8ea384e1fe9f9dc0ed5903477cb383f3.zip
opensim-SC-edd50f2e8ea384e1fe9f9dc0ed5903477cb383f3.tar.gz
opensim-SC-edd50f2e8ea384e1fe9f9dc0ed5903477cb383f3.tar.bz2
opensim-SC-edd50f2e8ea384e1fe9f9dc0ed5903477cb383f3.tar.xz
Implemented Resize Method in OdePrim.
attached the links to that from SceneObject, so now resizing works (as much as resizing currently works in opensim, fixing resizing in general is on my todo list for today). Rotation of a root prim also now updates the physics engine. So think there really is only deleteprim left, then it should be usable (Different shapes (other than boxes that it currently uses) can wait a little bit longer). [of course there are still the other issues of ODE not really working when there is more than one region in a instance of opensim].
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs19
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs10
3 files changed, 31 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 20624d5..87a42b1 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -547,7 +547,7 @@ namespace OpenSim.Region.Environment.Scenes
547 SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape); 547 SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape);
548 AddEntity(sceneOb); 548 AddEntity(sceneOb);
549 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); 549 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
550 // rootPart.PhysActor =phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), 550 //rootPart.PhysActor =phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
551 // new Axiom.Math.Quaternion()); 551 // new Axiom.Math.Quaternion());
552 } 552 }
553 553
@@ -626,11 +626,11 @@ namespace OpenSim.Region.Environment.Scenes
626 AddEntity(obj); 626 AddEntity(obj);
627 627
628 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); 628 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
629 //rootPart.PhysActor = phyScene.AddPrim( 629 //rootPart.PhysActor = phyScene.AddPrim(
630 // new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), 630 // new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z),
631 // new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), 631 // new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
632 // new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, 632 // new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
633 // rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); 633 // rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
634 primCount++; 634 primCount++;
635 } 635 }
636 } 636 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 7e34637..f787190 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -717,6 +717,13 @@ namespace OpenSim.Region.Environment.Scenes
717 if (part != null) 717 if (part != null)
718 { 718 {
719 part.Resize(scale); 719 part.Resize(scale);
720 if (part.UUID == this.m_rootPart.UUID)
721 {
722 if (m_rootPart.PhysActor != null)
723 {
724 m_rootPart.PhysActor.Size = new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z);
725 }
726 }
720 } 727 }
721 } 728 }
722 #endregion 729 #endregion
@@ -789,6 +796,10 @@ namespace OpenSim.Region.Environment.Scenes
789 public void UpdateGroupRotation(LLQuaternion rot) 796 public void UpdateGroupRotation(LLQuaternion rot)
790 { 797 {
791 this.m_rootPart.UpdateRotation(rot); 798 this.m_rootPart.UpdateRotation(rot);
799 if (m_rootPart.PhysActor != null)
800 {
801 m_rootPart.PhysActor.Orientation = new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z);
802 }
792 this.ScheduleGroupForTerseUpdate(); 803 this.ScheduleGroupForTerseUpdate();
793 } 804 }
794 805
@@ -800,6 +811,10 @@ namespace OpenSim.Region.Environment.Scenes
800 public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot) 811 public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot)
801 { 812 {
802 this.m_rootPart.UpdateRotation(rot); 813 this.m_rootPart.UpdateRotation(rot);
814 if (m_rootPart.PhysActor != null)
815 {
816 m_rootPart.PhysActor.Orientation = new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z);
817 }
803 this.AbsolutePosition = pos; 818 this.AbsolutePosition = pos;
804 this.ScheduleGroupForTerseUpdate(); 819 this.ScheduleGroupForTerseUpdate();
805 } 820 }
@@ -832,6 +847,10 @@ namespace OpenSim.Region.Environment.Scenes
832 private void UpdateRootRotation(LLQuaternion rot) 847 private void UpdateRootRotation(LLQuaternion rot)
833 { 848 {
834 this.m_rootPart.UpdateRotation(rot); 849 this.m_rootPart.UpdateRotation(rot);
850 if (m_rootPart.PhysActor != null)
851 {
852 m_rootPart.PhysActor.Orientation = new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z);
853 }
835 Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z); 854 Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z);
836 Axiom.Math.Quaternion oldParentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z); 855 Axiom.Math.Quaternion oldParentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z);
837 856
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index ae46feb..f168340 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -148,7 +148,7 @@ namespace OpenSim.Region.Physics.OdePlugin
148 148
149 public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Quaternion rotation) 149 public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Quaternion rotation)
150 { 150 {
151 Console.WriteLine("+++++++++++++++++++++++++++++++++AddPrim pos: " + position + " size: " + size + " quat: " + rotation); 151 //Console.WriteLine("+++++++++++++++++++++++++++++++++AddPrim pos: " + position + " size: " + size + " quat: " + rotation);
152 PhysicsVector pos = new PhysicsVector(); 152 PhysicsVector pos = new PhysicsVector();
153 pos.X = position.X; 153 pos.X = position.X;
154 pos.Y = position.Y; 154 pos.Y = position.Y;
@@ -437,7 +437,7 @@ namespace OpenSim.Region.Physics.OdePlugin
437 } 437 }
438 set 438 set
439 { 439 {
440 Console.WriteLine("+++++++++++++++++++++++++++++++++++++++++++ setting pos: " + value); 440 //Console.WriteLine("+++++++++++++++++++++++++++++++++++++++++++ setting pos: " + value);
441 _position = value; 441 _position = value;
442 Monitor.Enter(typeof(OdeScene)); 442 Monitor.Enter(typeof(OdeScene));
443 d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); 443 d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
@@ -454,8 +454,11 @@ namespace OpenSim.Region.Physics.OdePlugin
454 } 454 }
455 set 455 set
456 { 456 {
457 Console.WriteLine("+++++++++++++++++++++++++++++++++++++++++++ setting size: " + value); 457 //Console.WriteLine("+++++++++++++++++++++++++++++++++++++++++++ setting size: " + value);
458 _size = value; 458 _size = value;
459 Monitor.Enter(typeof(OdeScene));
460 d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z);
461 Monitor.Exit(typeof(OdeScene));
459 } 462 }
460 } 463 }
461 464
@@ -490,6 +493,7 @@ namespace OpenSim.Region.Physics.OdePlugin
490 } 493 }
491 set 494 set
492 { 495 {
496 //Console.WriteLine("+++++++++++++++++++++++++++++++++++++++++++ setting Orientation");
493 _orientation = value; 497 _orientation = value;
494 Monitor.Enter(typeof(OdeScene)); 498 Monitor.Enter(typeof(OdeScene));
495 d.Quaternion myrot = new d.Quaternion(); 499 d.Quaternion myrot = new d.Quaternion();