diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 47 |
1 files changed, 47 insertions, 0 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. |