From 9ba4511d3e6b63d51f951519151aaae1c59250d6 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 24 Aug 2011 21:53:12 +0100
Subject: add SOG helper properties IsPhantom, IsTemporary, etc. to improve
code readability
use these in some sog methods
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 66 +++++++++++++++-------
1 file changed, 46 insertions(+), 20 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index fe96152..079148f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -167,6 +167,44 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ ///
+ /// Is this scene object phantom?
+ ///
+ ///
+ /// Updating must currently take place through UpdatePrimFlags()
+ ///
+ public bool IsPhantom
+ {
+ get { return (RootPart.Flags & PrimFlags.Phantom) != 0; }
+ }
+
+ ///
+ /// Does this scene object use physics?
+ ///
+ ///
+ /// Updating must currently take place through UpdatePrimFlags()
+ ///
+ public bool UsesPhysics
+ {
+ get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; }
+ }
+
+ ///
+ /// Is this scene object temporary?
+ ///
+ ///
+ /// Updating must currently take place through UpdatePrimFlags()
+ ///
+ public bool IsTemporary
+ {
+ get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; }
+ }
+
+ public bool IsVolumeDetect
+ {
+ get { return RootPart.VolumeDetectActive; }
+ }
+
public float scriptScore;
private Vector3 lastPhysGroupPos;
@@ -1510,36 +1548,24 @@ namespace OpenSim.Region.Framework.Scenes
SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed));
}
- public void ScriptSetPhysicsStatus(bool UsePhysics)
+ public void ScriptSetPhysicsStatus(bool usePhysics)
{
- bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0);
- bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
- bool IsVolumeDetect = RootPart.VolumeDetectActive;
- UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
+ UpdatePrimFlags(RootPart.LocalId, usePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
}
- public void ScriptSetTemporaryStatus(bool TemporaryStatus)
+ public void ScriptSetTemporaryStatus(bool makeTemporary)
{
- bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
- bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
- bool IsVolumeDetect = RootPart.VolumeDetectActive;
- UpdatePrimFlags(RootPart.LocalId, UsePhysics, TemporaryStatus, IsPhantom, IsVolumeDetect);
+ UpdatePrimFlags(RootPart.LocalId, UsesPhysics, makeTemporary, IsPhantom, IsVolumeDetect);
}
- public void ScriptSetPhantomStatus(bool PhantomStatus)
+ public void ScriptSetPhantomStatus(bool makePhantom)
{
- bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
- bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0);
- bool IsVolumeDetect = RootPart.VolumeDetectActive;
- UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, PhantomStatus, IsVolumeDetect);
+ UpdatePrimFlags(RootPart.LocalId, UsesPhysics, IsTemporary, makePhantom, IsVolumeDetect);
}
- public void ScriptSetVolumeDetect(bool VDStatus)
+ public void ScriptSetVolumeDetect(bool makeVolumeDetect)
{
- bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
- bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0);
- bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
- UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, IsPhantom, VDStatus);
+ UpdatePrimFlags(RootPart.LocalId, UsesPhysics, IsTemporary, IsPhantom, makeVolumeDetect);
/*
ScriptSetPhantomStatus(false); // What ever it was before, now it's not phantom anymore
--
cgit v1.1