diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 949ac3d..b428269 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -1407,34 +1407,23 @@ namespace OpenSim.Region.Environment.Scenes | |||
1407 | 1407 | ||
1408 | public void ScriptSetPhysicsStatus(bool UsePhysics) | 1408 | public void ScriptSetPhysicsStatus(bool UsePhysics) |
1409 | { | 1409 | { |
1410 | if (m_scene.m_physicalPrim) | 1410 | bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0); |
1411 | { | 1411 | bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0); |
1412 | lock (m_parts) | 1412 | UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, IsPhantom); |
1413 | { | 1413 | } |
1414 | foreach (SceneObjectPart part in m_parts.Values) | ||
1415 | { | ||
1416 | if (UsePhysics) | ||
1417 | part.AddFlag(PrimFlags.Physics); | ||
1418 | else | ||
1419 | part.RemFlag(PrimFlags.Physics); | ||
1420 | 1414 | ||
1421 | part.DoPhysicsPropertyUpdate(UsePhysics, false); | 1415 | public void ScriptSetTemporaryStatus(bool TemporaryStatus) |
1422 | IsSelected = false; | 1416 | { |
1423 | } | 1417 | bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); |
1424 | } | 1418 | bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0); |
1425 | } | 1419 | UpdatePrimFlags(RootPart.LocalId, UsePhysics, TemporaryStatus, IsPhantom); |
1426 | } | 1420 | } |
1427 | 1421 | ||
1428 | public void ScriptSetPhantomStatus(bool PhantomStatus) | 1422 | public void ScriptSetPhantomStatus(bool PhantomStatus) |
1429 | { | 1423 | { |
1430 | byte[] flags = new byte[50]; | 1424 | bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); |
1431 | // only the following 3 flags are updated by UpdatePrimFlags | 1425 | bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0); |
1432 | flags[46] = (byte)((RootPart.Flags & PrimFlags.Physics) != 0 ? 1 : 0); | 1426 | UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, PhantomStatus); |
1433 | flags[47] = (byte)((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0 ? 1 : 0); | ||
1434 | flags[48] = (byte)(PhantomStatus ? 1 : 0); | ||
1435 | // 94 is the packet type that comes from the ll viewer when selecting/unselecting | ||
1436 | // so pretend we are from the viewer | ||
1437 | UpdatePrimFlags(RootPart.LocalId, (ushort)94, true, flags); | ||
1438 | } | 1427 | } |
1439 | 1428 | ||
1440 | public void applyImpulse(PhysicsVector impulse) | 1429 | public void applyImpulse(PhysicsVector impulse) |
@@ -2160,11 +2149,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
2160 | /// <param name="type"></param> | 2149 | /// <param name="type"></param> |
2161 | /// <param name="inUse"></param> | 2150 | /// <param name="inUse"></param> |
2162 | /// <param name="data"></param> | 2151 | /// <param name="data"></param> |
2163 | public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data) | 2152 | public void UpdatePrimFlags(uint localID, bool UsePhysics, bool IsTemporary, bool IsPhantom) |
2164 | { | 2153 | { |
2165 | SceneObjectPart selectionPart = GetChildPart(localID); | 2154 | SceneObjectPart selectionPart = GetChildPart(localID); |
2166 | 2155 | ||
2167 | if (data[47] != 0) // Temporary | 2156 | if (IsTemporary) |
2168 | { | 2157 | { |
2169 | DetachFromBackup(); | 2158 | DetachFromBackup(); |
2170 | // Remove from database and parcel prim count | 2159 | // Remove from database and parcel prim count |
@@ -2181,14 +2170,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
2181 | { | 2170 | { |
2182 | if (part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0) | 2171 | if (part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0) |
2183 | { | 2172 | { |
2184 | data[46] = 0; // Reset physics | 2173 | UsePhysics = false; // Reset physics |
2185 | break; | 2174 | break; |
2186 | } | 2175 | } |
2187 | } | 2176 | } |
2188 | 2177 | ||
2189 | foreach (SceneObjectPart part in m_parts.Values) | 2178 | foreach (SceneObjectPart part in m_parts.Values) |
2190 | { | 2179 | { |
2191 | part.UpdatePrimFlags(type, inUse, data); | 2180 | part.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom); |
2192 | } | 2181 | } |
2193 | } | 2182 | } |
2194 | } | 2183 | } |