aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMic Bowman2011-06-15 11:31:32 -0700
committerMic Bowman2011-06-15 11:31:32 -0700
commitad84728aba1ea5efe0d237c89e1578657e6d8288 (patch)
treec73288cf710167ec00bf5dbcf71a26a4eec3d1d8 /OpenSim/Region
parentAdd the PhysActor to the correct SOP when duplicating a physical (diff)
downloadopensim-SC-ad84728aba1ea5efe0d237c89e1578657e6d8288.zip
opensim-SC-ad84728aba1ea5efe0d237c89e1578657e6d8288.tar.gz
opensim-SC-ad84728aba1ea5efe0d237c89e1578657e6d8288.tar.bz2
opensim-SC-ad84728aba1ea5efe0d237c89e1578657e6d8288.tar.xz
Add localID to physical object creation functions.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsActor.cs7
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsScene.cs15
5 files changed, 25 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f745169..42ac9aa 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1467,6 +1467,7 @@ namespace OpenSim.Region.Framework.Scenes
1467 1467
1468 newPart.PhysActor 1468 newPart.PhysActor
1469 = m_scene.PhysicsScene.AddPrimShape( 1469 = m_scene.PhysicsScene.AddPrimShape(
1470 part.LocalId,
1470 string.Format("{0}/{1}", part.Name, part.UUID), 1471 string.Format("{0}/{1}", part.Name, part.UUID),
1471 pbs, 1472 pbs,
1472 part.AbsolutePosition, 1473 part.AbsolutePosition,
@@ -1474,7 +1475,6 @@ namespace OpenSim.Region.Framework.Scenes
1474 part.RotationOffset, 1475 part.RotationOffset,
1475 part.PhysActor.IsPhysical); 1476 part.PhysActor.IsPhysical);
1476 1477
1477 newPart.PhysActor.LocalID = part.LocalId;
1478 newPart.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true); 1478 newPart.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
1479 } 1479 }
1480 } 1480 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index a215b20..c6d8c73 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1582,6 +1582,7 @@ namespace OpenSim.Region.Framework.Scenes
1582 if (!isPhantom && !IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible)) 1582 if (!isPhantom && !IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible))
1583 { 1583 {
1584 PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( 1584 PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
1585 LocalId,
1585 string.Format("{0}/{1}", Name, UUID), 1586 string.Format("{0}/{1}", Name, UUID),
1586 Shape, 1587 Shape,
1587 AbsolutePosition, 1588 AbsolutePosition,
@@ -1594,7 +1595,6 @@ namespace OpenSim.Region.Framework.Scenes
1594 { 1595 {
1595 PhysActor.SOPName = this.Name; // save object name and desc into the PhysActor so ODE internals know the joint/body info 1596 PhysActor.SOPName = this.Name; // save object name and desc into the PhysActor so ODE internals know the joint/body info
1596 PhysActor.SOPDescription = this.Description; 1597 PhysActor.SOPDescription = this.Description;
1597 PhysActor.LocalID = LocalId;
1598 DoPhysicsPropertyUpdate(RigidBody, true); 1598 DoPhysicsPropertyUpdate(RigidBody, true);
1599 PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0); 1599 PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0);
1600 } 1600 }
@@ -4410,6 +4410,7 @@ namespace OpenSim.Region.Framework.Scenes
4410 { 4410 {
4411 // It's not phantom anymore. So make sure the physics engine get's knowledge of it 4411 // It's not phantom anymore. So make sure the physics engine get's knowledge of it
4412 PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( 4412 PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
4413 LocalId,
4413 string.Format("{0}/{1}", Name, UUID), 4414 string.Format("{0}/{1}", Name, UUID),
4414 Shape, 4415 Shape,
4415 AbsolutePosition, 4416 AbsolutePosition,
@@ -4420,7 +4421,6 @@ namespace OpenSim.Region.Framework.Scenes
4420 pa = PhysActor; 4421 pa = PhysActor;
4421 if (pa != null) 4422 if (pa != null)
4422 { 4423 {
4423 pa.LocalID = LocalId;
4424 DoPhysicsPropertyUpdate(UsePhysics, true); 4424 DoPhysicsPropertyUpdate(UsePhysics, true);
4425 if (m_parentGroup != null) 4425 if (m_parentGroup != null)
4426 { 4426 {
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index f6295b1..80aafd0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3295,7 +3295,7 @@ namespace OpenSim.Region.Framework.Scenes
3295 Vector3 pVec = AbsolutePosition; 3295 Vector3 pVec = AbsolutePosition;
3296 3296
3297 // Old bug where the height was in centimeters instead of meters 3297 // Old bug where the height was in centimeters instead of meters
3298 m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, 3298 m_physicsActor = scene.AddAvatar(LocalId, Firstname + "." + Lastname, pVec,
3299 new Vector3(0f, 0f, m_appearance.AvatarHeight), isFlying); 3299 new Vector3(0f, 0f, m_appearance.AvatarHeight), isFlying);
3300 3300
3301 scene.AddPhysicsActorTaint(m_physicsActor); 3301 scene.AddPhysicsActorTaint(m_physicsActor);
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
index 880c3ea..1c36e55 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
@@ -142,7 +142,12 @@ namespace OpenSim.Region.Physics.Manager
142 142
143 public abstract PrimitiveBaseShape Shape { set; } 143 public abstract PrimitiveBaseShape Shape { set; }
144 144
145 public abstract uint LocalID { set; } 145 uint m_baseLocalID;
146 public virtual uint LocalID
147 {
148 set { m_baseLocalID = value; }
149 get { return m_baseLocalID; }
150 }
146 151
147 public abstract bool Grabbed { set; } 152 public abstract bool Grabbed { set; }
148 153
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index 217d307..54c50f8 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
@@ -66,6 +66,13 @@ namespace OpenSim.Region.Physics.Manager
66 66
67 public abstract PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying); 67 public abstract PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying);
68 68
69 public virtual PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 size, bool isFlying)
70 {
71 PhysicsActor ret = AddAvatar(avName, position, size, isFlying);
72 if (ret != null) ret.LocalID = localID;
73 return ret;
74 }
75
69 public abstract void RemoveAvatar(PhysicsActor actor); 76 public abstract void RemoveAvatar(PhysicsActor actor);
70 77
71 public abstract void RemovePrim(PhysicsActor prim); 78 public abstract void RemovePrim(PhysicsActor prim);
@@ -75,6 +82,14 @@ namespace OpenSim.Region.Physics.Manager
75 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, 82 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
76 Vector3 size, Quaternion rotation, bool isPhysical); 83 Vector3 size, Quaternion rotation, bool isPhysical);
77 84
85 public virtual PhysicsActor AddPrimShape(uint localID, string primName, PrimitiveBaseShape pbs, Vector3 position,
86 Vector3 size, Quaternion rotation, bool isPhysical)
87 {
88 PhysicsActor ret = AddPrimShape(primName, pbs, position, size, rotation, isPhysical);
89 if (ret != null) ret.LocalID = localID;
90 return ret;
91 }
92
78 public virtual float TimeDilation 93 public virtual float TimeDilation
79 { 94 {
80 get { return 1.0f; } 95 get { return 1.0f; }