aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs52
1 files changed, 16 insertions, 36 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index d2c4253..bdeaa6f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -2031,6 +2031,14 @@ if (m_shape != null) {
2031 } 2031 }
2032 } 2032 }
2033 2033
2034 public void ScriptSetTemporaryStatus(bool Temporary)
2035 {
2036 if (m_parentGroup != null)
2037 {
2038 m_parentGroup.ScriptSetTemporaryStatus(Temporary);
2039 }
2040 }
2041
2034 public void ScriptSetPhysicsStatus(bool UsePhysics) 2042 public void ScriptSetPhysicsStatus(bool UsePhysics)
2035 { 2043 {
2036 if (m_parentGroup == null) 2044 if (m_parentGroup == null)
@@ -3046,45 +3054,17 @@ if (m_shape != null) {
3046 } 3054 }
3047 } 3055 }
3048 3056
3049 public void UpdatePrimFlags(ushort type, bool inUse, byte[] data) 3057 public void UpdatePrimFlags(bool UsePhysics, bool IsTemporary, bool IsPhantom)
3050 { 3058 {
3051 //m_log.Info("TSomething1:" + ((type & (ushort)ExtraParamType.Something1) == (ushort)ExtraParamType.Something1));
3052 //m_log.Info("TSomething2:" + ((type & (ushort)ExtraParamType.Something2) == (ushort)ExtraParamType.Something2));
3053 //m_log.Info("TSomething3:" + ((type & (ushort)ExtraParamType.Something3) == (ushort)ExtraParamType.Something3));
3054 //m_log.Info("TSomething4:" + ((type & (ushort)ExtraParamType.Something4) == (ushort)ExtraParamType.Something4));
3055 //m_log.Info("TSomething5:" + ((type & (ushort)ExtraParamType.Something5) == (ushort)ExtraParamType.Something5));
3056 //m_log.Info("TSomething6:" + ((type & (ushort)ExtraParamType.Something6) == (ushort)ExtraParamType.Something6));
3057 3059
3058 bool usePhysics = false;
3059 bool IsTemporary = false;
3060 bool IsPhantom = false;
3061 // bool castsShadows = false;
3062 bool wasUsingPhysics = ((ObjectFlags & (uint) PrimFlags.Physics) != 0); 3060 bool wasUsingPhysics = ((ObjectFlags & (uint) PrimFlags.Physics) != 0);
3063 //bool IsLocked = false;
3064 int i = 0;
3065 3061
3066 try 3062 if (UsePhysics)
3067 {
3068 i += 46;
3069 //IsLocked = (data[i++] != 0) ? true : false;
3070 usePhysics = ((data[i++] != 0) && m_parentGroup.Scene.m_physicalPrim) ? true : false;
3071 //System.Console.WriteLine("U" + packet.ToBytes().Length.ToString());
3072 IsTemporary = (data[i++] != 0) ? true : false;
3073 IsPhantom = (data[i++] != 0) ? true : false;
3074 // castsShadows = (data[i++] != 0) ? true : false;
3075 }
3076 catch (Exception)
3077 {
3078 Console.WriteLine("Ignoring invalid Packet:");
3079 //Silently ignore it - TODO: FIXME Quick
3080 }
3081
3082 if (usePhysics)
3083 { 3063 {
3084 AddFlag(PrimFlags.Physics); 3064 AddFlag(PrimFlags.Physics);
3085 if (!wasUsingPhysics) 3065 if (!wasUsingPhysics)
3086 { 3066 {
3087 DoPhysicsPropertyUpdate(usePhysics, false); 3067 DoPhysicsPropertyUpdate(UsePhysics, false);
3088 if (m_parentGroup != null) 3068 if (m_parentGroup != null)
3089 { 3069 {
3090 if (m_parentGroup.RootPart != null) 3070 if (m_parentGroup.RootPart != null)
@@ -3102,7 +3082,7 @@ if (m_shape != null) {
3102 RemFlag(PrimFlags.Physics); 3082 RemFlag(PrimFlags.Physics);
3103 if (wasUsingPhysics) 3083 if (wasUsingPhysics)
3104 { 3084 {
3105 DoPhysicsPropertyUpdate(usePhysics, false); 3085 DoPhysicsPropertyUpdate(UsePhysics, false);
3106 } 3086 }
3107 } 3087 }
3108 3088
@@ -3127,12 +3107,12 @@ if (m_shape != null) {
3127 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z), 3107 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z),
3128 new PhysicsVector(Scale.X, Scale.Y, Scale.Z), 3108 new PhysicsVector(Scale.X, Scale.Y, Scale.Z),
3129 RotationOffset, 3109 RotationOffset,
3130 usePhysics); 3110 UsePhysics);
3131 3111
3132 if (PhysActor != null) 3112 if (PhysActor != null)
3133 { 3113 {
3134 PhysActor.LocalID = LocalId; 3114 PhysActor.LocalID = LocalId;
3135 DoPhysicsPropertyUpdate(usePhysics, true); 3115 DoPhysicsPropertyUpdate(UsePhysics, true);
3136 if (m_parentGroup != null) 3116 if (m_parentGroup != null)
3137 { 3117 {
3138 if (m_parentGroup.RootPart != null) 3118 if (m_parentGroup.RootPart != null)
@@ -3147,8 +3127,8 @@ if (m_shape != null) {
3147 } 3127 }
3148 else 3128 else
3149 { 3129 {
3150 PhysActor.IsPhysical = usePhysics; 3130 PhysActor.IsPhysical = UsePhysics;
3151 DoPhysicsPropertyUpdate(usePhysics, false); 3131 DoPhysicsPropertyUpdate(UsePhysics, false);
3152 if (m_parentGroup != null) 3132 if (m_parentGroup != null)
3153 { 3133 {
3154 if (m_parentGroup.RootPart != null) 3134 if (m_parentGroup.RootPart != null)