aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorTeravus Ovares2008-03-14 06:20:50 +0000
committerTeravus Ovares2008-03-14 06:20:50 +0000
commitae9a98ceb15e43dc24c485955051f554a2247401 (patch)
tree27cd062a1ffd841eefba779db9752aa02350a8d1 /OpenSim/Region/Environment
parent* Preliminary work with the ODEPlugin to collect collision data. (diff)
downloadopensim-SC-ae9a98ceb15e43dc24c485955051f554a2247401.zip
opensim-SC-ae9a98ceb15e43dc24c485955051f554a2247401.tar.gz
opensim-SC-ae9a98ceb15e43dc24c485955051f554a2247401.tar.bz2
opensim-SC-ae9a98ceb15e43dc24c485955051f554a2247401.tar.xz
* Added proper handling of llSetStatus(STATUS_PHYSICS,BOOL)
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs47
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs15
2 files changed, 61 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 041dc4e..47c4567 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -590,6 +590,53 @@ namespace OpenSim.Region.Environment.Scenes
590 SetPartAsRoot(newPart); 590 SetPartAsRoot(newPart);
591 } 591 }
592 592
593 public void ScriptSetPhysicsStatus(bool UsePhysics)
594 {
595 if (m_scene.m_physicalPrim)
596 {
597 lock (m_parts)
598 {
599 foreach (SceneObjectPart part in m_parts.Values)
600 {
601 if (UsePhysics)
602 part.AddFlag(LLObject.ObjectFlags.Physics);
603 else
604 part.RemFlag(LLObject.ObjectFlags.Physics);
605
606 part.DoPhysicsPropertyUpdate(UsePhysics, false);
607 IsSelected = false;
608 }
609 }
610 }
611
612 }
613
614 public void ScriptSetPhantomStatus(bool PhantomStatus)
615 {
616 lock (m_parts)
617 {
618 foreach (SceneObjectPart part in m_parts.Values)
619 {
620 if (PhantomStatus)
621 {
622 part.AddFlag(LLObject.ObjectFlags.Phantom);
623 if (part.PhysActor != null)
624 {
625 m_scene.PhysicsScene.RemovePrim(part.PhysActor);
626 }
627 }
628 else
629 {
630 part.RemFlag(LLObject.ObjectFlags.Phantom);
631 if ((part.ObjectFlags & (int)LLObject.ObjectFlags.Physics) != 0)
632 {
633 part.DoPhysicsPropertyUpdate(true, false);
634 }
635 }
636 }
637 }
638 }
639
593 public void applyImpulse(PhysicsVector impulse) 640 public void applyImpulse(PhysicsVector impulse)
594 { 641 {
595 // We check if rootpart is null here because scripts don't delete if you delete the host. 642 // We check if rootpart is null here because scripts don't delete if you delete the host.
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index ffb9d36..5b3ea0f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -1326,7 +1326,20 @@ namespace OpenSim.Region.Environment.Scenes
1326 // System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); 1326 // System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString());
1327 ScheduleFullUpdate(); 1327 ScheduleFullUpdate();
1328 } 1328 }
1329 1329 public void ScriptSetPhysicsStatus(bool UsePhysics)
1330 {
1331 if (m_parentGroup != null)
1332 {
1333 m_parentGroup.ScriptSetPhysicsStatus(UsePhysics);
1334 }
1335 }
1336 public void ScriptSetPhantomStatus(bool Phantom)
1337 {
1338 if (m_parentGroup != null)
1339 {
1340 m_parentGroup.ScriptSetPhantomStatus(Phantom);
1341 }
1342 }
1330 public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) 1343 public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew)
1331 { 1344 {
1332 if (PhysActor != null) 1345 if (PhysActor != null)