diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 20624d5a02..87a42b1f2b 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -547,7 +547,7 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape); AddEntity(sceneOb); SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); - // rootPart.PhysActor =phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), + //rootPart.PhysActor =phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), // new Axiom.Math.Quaternion()); } @@ -626,11 +626,11 @@ namespace OpenSim.Region.Environment.Scenes AddEntity(obj); SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); - //rootPart.PhysActor = phyScene.AddPrim( + //rootPart.PhysActor = phyScene.AddPrim( // new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), - // new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), - // new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, - // rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); + // new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), + // new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, + // rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); primCount++; } } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 7e34637c74..f7871906a1 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -717,6 +717,13 @@ namespace OpenSim.Region.Environment.Scenes if (part != null) { part.Resize(scale); + if (part.UUID == this.m_rootPart.UUID) + { + if (m_rootPart.PhysActor != null) + { + m_rootPart.PhysActor.Size = new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z); + } + } } } #endregion @@ -789,6 +796,10 @@ namespace OpenSim.Region.Environment.Scenes public void UpdateGroupRotation(LLQuaternion rot) { this.m_rootPart.UpdateRotation(rot); + if (m_rootPart.PhysActor != null) + { + m_rootPart.PhysActor.Orientation = new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z); + } this.ScheduleGroupForTerseUpdate(); } @@ -800,6 +811,10 @@ namespace OpenSim.Region.Environment.Scenes public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot) { this.m_rootPart.UpdateRotation(rot); + if (m_rootPart.PhysActor != null) + { + m_rootPart.PhysActor.Orientation = new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z); + } this.AbsolutePosition = pos; this.ScheduleGroupForTerseUpdate(); } @@ -832,6 +847,10 @@ namespace OpenSim.Region.Environment.Scenes private void UpdateRootRotation(LLQuaternion rot) { this.m_rootPart.UpdateRotation(rot); + if (m_rootPart.PhysActor != null) + { + m_rootPart.PhysActor.Orientation = new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z); + } Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z); 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); diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index ae46feb4c2..f16834091d 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -148,7 +148,7 @@ namespace OpenSim.Region.Physics.OdePlugin public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Quaternion rotation) { - Console.WriteLine("+++++++++++++++++++++++++++++++++AddPrim pos: " + position + " size: " + size + " quat: " + rotation); + //Console.WriteLine("+++++++++++++++++++++++++++++++++AddPrim pos: " + position + " size: " + size + " quat: " + rotation); PhysicsVector pos = new PhysicsVector(); pos.X = position.X; pos.Y = position.Y; @@ -437,7 +437,7 @@ namespace OpenSim.Region.Physics.OdePlugin } set { - Console.WriteLine("+++++++++++++++++++++++++++++++++++++++++++ setting pos: " + value); + //Console.WriteLine("+++++++++++++++++++++++++++++++++++++++++++ setting pos: " + value); _position = value; Monitor.Enter(typeof(OdeScene)); d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); @@ -454,8 +454,11 @@ namespace OpenSim.Region.Physics.OdePlugin } set { - Console.WriteLine("+++++++++++++++++++++++++++++++++++++++++++ setting size: " + value); + //Console.WriteLine("+++++++++++++++++++++++++++++++++++++++++++ setting size: " + value); _size = value; + Monitor.Enter(typeof(OdeScene)); + d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z); + Monitor.Exit(typeof(OdeScene)); } } @@ -490,6 +493,7 @@ namespace OpenSim.Region.Physics.OdePlugin } set { + //Console.WriteLine("+++++++++++++++++++++++++++++++++++++++++++ setting Orientation"); _orientation = value; Monitor.Enter(typeof(OdeScene)); d.Quaternion myrot = new d.Quaternion();