diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 334 |
1 files changed, 63 insertions, 271 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 1e1eee2..6b562e5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -107,9 +107,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
107 | [XmlIgnore] | 107 | [XmlIgnore] |
108 | public bool DIE_AT_EDGE; | 108 | public bool DIE_AT_EDGE; |
109 | 109 | ||
110 | [XmlIgnore] | ||
111 | public Dictionary<int, string> m_CollisionFilter; | ||
112 | |||
113 | // TODO: This needs to be persisted in next XML version update! | 110 | // TODO: This needs to be persisted in next XML version update! |
114 | [XmlIgnore] | 111 | [XmlIgnore] |
115 | public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; | 112 | public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; |
@@ -459,15 +456,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
459 | ParentGroup.HasGroupChanged = true; | 456 | ParentGroup.HasGroupChanged = true; |
460 | } | 457 | } |
461 | } | 458 | } |
462 | |||
463 | public Dictionary<int, string> CollisionFilter | ||
464 | { | ||
465 | get { return m_CollisionFilter; } | ||
466 | set | ||
467 | { | ||
468 | m_CollisionFilter = value; | ||
469 | } | ||
470 | } | ||
471 | 459 | ||
472 | public ulong RegionHandle | 460 | public ulong RegionHandle |
473 | { | 461 | { |
@@ -1895,52 +1883,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
1895 | 1883 | ||
1896 | if (m_parentGroup.Scene == null) | 1884 | if (m_parentGroup.Scene == null) |
1897 | return; | 1885 | return; |
1898 | #region collision Filter | 1886 | |
1899 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | 1887 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); |
1900 | if (obj != null) | 1888 | if (obj != null) |
1901 | { | 1889 | { |
1902 | if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 1890 | DetectedObject detobj = new DetectedObject(); |
1903 | { | 1891 | detobj.keyUUID = obj.UUID; |
1904 | string data = ""; | 1892 | detobj.nameStr = obj.Name; |
1905 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1893 | detobj.ownerUUID = obj._ownerID; |
1906 | //If it is 1, it is to accept ONLY collisions from this object | 1894 | detobj.posVector = obj.AbsolutePosition; |
1907 | if(data != "") | 1895 | detobj.rotQuat = obj.GetWorldRotation(); |
1908 | { | 1896 | detobj.velVector = obj.Velocity; |
1909 | DetectedObject detobj = new DetectedObject(); | 1897 | detobj.colliderType = 0; |
1910 | detobj.keyUUID = obj.UUID; | 1898 | detobj.groupUUID = obj._groupID; |
1911 | detobj.nameStr = obj.Name; | 1899 | colliding.Add(detobj); |
1912 | detobj.ownerUUID = obj._ownerID; | ||
1913 | detobj.posVector = obj.AbsolutePosition; | ||
1914 | detobj.rotQuat = obj.GetWorldRotation(); | ||
1915 | detobj.velVector = obj.Velocity; | ||
1916 | detobj.colliderType = 0; | ||
1917 | detobj.groupUUID = obj._groupID; | ||
1918 | colliding.Add(detobj); | ||
1919 | } | ||
1920 | //If it is 0, it is to not accept collisions from this object | ||
1921 | else | ||
1922 | { | ||
1923 | } | ||
1924 | } | ||
1925 | else | ||
1926 | { | ||
1927 | string data = ""; | ||
1928 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
1929 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | ||
1930 | if(data == "") | ||
1931 | { | ||
1932 | DetectedObject detobj = new DetectedObject(); | ||
1933 | detobj.keyUUID = obj.UUID; | ||
1934 | detobj.nameStr = obj.Name; | ||
1935 | detobj.ownerUUID = obj._ownerID; | ||
1936 | detobj.posVector = obj.AbsolutePosition; | ||
1937 | detobj.rotQuat = obj.GetWorldRotation(); | ||
1938 | detobj.velVector = obj.Velocity; | ||
1939 | detobj.colliderType = 0; | ||
1940 | detobj.groupUUID = obj._groupID; | ||
1941 | colliding.Add(detobj); | ||
1942 | } | ||
1943 | } | ||
1944 | } | 1900 | } |
1945 | else | 1901 | else |
1946 | { | 1902 | { |
@@ -1952,52 +1908,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1952 | 1908 | ||
1953 | if (av.LocalId == localId) | 1909 | if (av.LocalId == localId) |
1954 | { | 1910 | { |
1955 | if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 1911 | DetectedObject detobj = new DetectedObject(); |
1956 | { | 1912 | detobj.keyUUID = av.UUID; |
1957 | string data = ""; | 1913 | detobj.nameStr = av.ControllingClient.Name; |
1958 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1914 | detobj.ownerUUID = av.UUID; |
1959 | //If it is 1, it is to accept ONLY collisions from this avatar | 1915 | detobj.posVector = av.AbsolutePosition; |
1960 | if(data != "") | 1916 | detobj.rotQuat = av.Rotation; |
1961 | { | 1917 | detobj.velVector = av.Velocity; |
1962 | DetectedObject detobj = new DetectedObject(); | 1918 | detobj.colliderType = 0; |
1963 | detobj.keyUUID = av.UUID; | 1919 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; |
1964 | detobj.nameStr = av.ControllingClient.Name; | 1920 | colliding.Add(detobj); |
1965 | detobj.ownerUUID = av.UUID; | ||
1966 | detobj.posVector = av.AbsolutePosition; | ||
1967 | detobj.rotQuat = av.Rotation; | ||
1968 | detobj.velVector = av.Velocity; | ||
1969 | detobj.colliderType = 0; | ||
1970 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
1971 | colliding.Add(detobj); | ||
1972 | } | ||
1973 | //If it is 0, it is to not accept collisions from this avatar | ||
1974 | else | ||
1975 | { | ||
1976 | } | ||
1977 | } | ||
1978 | else | ||
1979 | { | ||
1980 | string data = ""; | ||
1981 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
1982 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | ||
1983 | if(data == "") | ||
1984 | { | ||
1985 | DetectedObject detobj = new DetectedObject(); | ||
1986 | detobj.keyUUID = av.UUID; | ||
1987 | detobj.nameStr = av.ControllingClient.Name; | ||
1988 | detobj.ownerUUID = av.UUID; | ||
1989 | detobj.posVector = av.AbsolutePosition; | ||
1990 | detobj.rotQuat = av.Rotation; | ||
1991 | detobj.velVector = av.Velocity; | ||
1992 | detobj.colliderType = 0; | ||
1993 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
1994 | colliding.Add(detobj); | ||
1995 | } | ||
1996 | } | ||
1997 | } | 1921 | } |
1998 | } | 1922 | } |
1999 | } | 1923 | } |
2000 | #endregion | ||
2001 | } | 1924 | } |
2002 | if (colliding.Count > 0) | 1925 | if (colliding.Count > 0) |
2003 | { | 1926 | { |
@@ -2031,105 +1954,41 @@ namespace OpenSim.Region.Framework.Scenes | |||
2031 | 1954 | ||
2032 | if (m_parentGroup.Scene == null) | 1955 | if (m_parentGroup.Scene == null) |
2033 | return; | 1956 | return; |
2034 | #region collision Filter | 1957 | |
2035 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | 1958 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); |
2036 | if (obj != null) | 1959 | if (obj != null) |
2037 | { | 1960 | { |
2038 | if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 1961 | DetectedObject detobj = new DetectedObject(); |
2039 | { | 1962 | detobj.keyUUID = obj.UUID; |
2040 | string data = ""; | 1963 | detobj.nameStr = obj.Name; |
2041 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1964 | detobj.ownerUUID = obj._ownerID; |
2042 | //If it is 1, it is to accept ONLY collisions from this object | 1965 | detobj.posVector = obj.AbsolutePosition; |
2043 | if(data != "") | 1966 | detobj.rotQuat = obj.GetWorldRotation(); |
2044 | { | 1967 | detobj.velVector = obj.Velocity; |
2045 | DetectedObject detobj = new DetectedObject(); | 1968 | detobj.colliderType = 0; |
2046 | detobj.keyUUID = obj.UUID; | 1969 | detobj.groupUUID = obj._groupID; |
2047 | detobj.nameStr = obj.Name; | 1970 | colliding.Add(detobj); |
2048 | detobj.ownerUUID = obj._ownerID; | ||
2049 | detobj.posVector = obj.AbsolutePosition; | ||
2050 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2051 | detobj.velVector = obj.Velocity; | ||
2052 | detobj.colliderType = 0; | ||
2053 | detobj.groupUUID = obj._groupID; | ||
2054 | colliding.Add(detobj); | ||
2055 | } | ||
2056 | //If it is 0, it is to not accept collisions from this object | ||
2057 | else | ||
2058 | { | ||
2059 | } | ||
2060 | } | ||
2061 | else | ||
2062 | { | ||
2063 | string data = ""; | ||
2064 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
2065 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | ||
2066 | if(data == "") | ||
2067 | { | ||
2068 | DetectedObject detobj = new DetectedObject(); | ||
2069 | detobj.keyUUID = obj.UUID; | ||
2070 | detobj.nameStr = obj.Name; | ||
2071 | detobj.ownerUUID = obj._ownerID; | ||
2072 | detobj.posVector = obj.AbsolutePosition; | ||
2073 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2074 | detobj.velVector = obj.Velocity; | ||
2075 | detobj.colliderType = 0; | ||
2076 | detobj.groupUUID = obj._groupID; | ||
2077 | colliding.Add(detobj); | ||
2078 | } | ||
2079 | } | ||
2080 | } | 1971 | } |
2081 | else | 1972 | else |
2082 | { | 1973 | { |
2083 | ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); | 1974 | ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); |
2084 | 1975 | ||
2085 | for (int i = 0; i < avlist.Length; i++) | 1976 | for (int i = 0; i < avlist.Length; i++) |
2086 | { | 1977 | { |
2087 | ScenePresence av = avlist[i]; | 1978 | ScenePresence av = avlist[i]; |
2088 | 1979 | ||
2089 | if (av.LocalId == localId) | 1980 | if (av.LocalId == localId) |
2090 | { | 1981 | { |
2091 | if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 1982 | DetectedObject detobj = new DetectedObject(); |
2092 | { | 1983 | detobj.keyUUID = av.UUID; |
2093 | string data = ""; | 1984 | detobj.nameStr = av.Name; |
2094 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1985 | detobj.ownerUUID = av.UUID; |
2095 | //If it is 1, it is to accept ONLY collisions from this avatar | 1986 | detobj.posVector = av.AbsolutePosition; |
2096 | if(data != "") | 1987 | detobj.rotQuat = av.Rotation; |
2097 | { | 1988 | detobj.velVector = av.Velocity; |
2098 | DetectedObject detobj = new DetectedObject(); | 1989 | detobj.colliderType = 0; |
2099 | detobj.keyUUID = av.UUID; | 1990 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; |
2100 | detobj.nameStr = av.ControllingClient.Name; | 1991 | colliding.Add(detobj); |
2101 | detobj.ownerUUID = av.UUID; | ||
2102 | detobj.posVector = av.AbsolutePosition; | ||
2103 | detobj.rotQuat = av.Rotation; | ||
2104 | detobj.velVector = av.Velocity; | ||
2105 | detobj.colliderType = 0; | ||
2106 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2107 | colliding.Add(detobj); | ||
2108 | } | ||
2109 | //If it is 0, it is to not accept collisions from this avatar | ||
2110 | else | ||
2111 | { | ||
2112 | } | ||
2113 | } | ||
2114 | else | ||
2115 | { | ||
2116 | string data = ""; | ||
2117 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
2118 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | ||
2119 | if(data == "") | ||
2120 | { | ||
2121 | DetectedObject detobj = new DetectedObject(); | ||
2122 | detobj.keyUUID = av.UUID; | ||
2123 | detobj.nameStr = av.ControllingClient.Name; | ||
2124 | detobj.ownerUUID = av.UUID; | ||
2125 | detobj.posVector = av.AbsolutePosition; | ||
2126 | detobj.rotQuat = av.Rotation; | ||
2127 | detobj.velVector = av.Velocity; | ||
2128 | detobj.colliderType = 0; | ||
2129 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2130 | colliding.Add(detobj); | ||
2131 | } | ||
2132 | } | ||
2133 | } | 1992 | } |
2134 | } | 1993 | } |
2135 | } | 1994 | } |
@@ -2147,7 +2006,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2147 | m_parentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage); | 2006 | m_parentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage); |
2148 | } | 2007 | } |
2149 | } | 2008 | } |
2150 | #endregion | ||
2151 | } | 2009 | } |
2152 | 2010 | ||
2153 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0) | 2011 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0) |
@@ -2166,52 +2024,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2166 | return; | 2024 | return; |
2167 | if (m_parentGroup.Scene == null) | 2025 | if (m_parentGroup.Scene == null) |
2168 | return; | 2026 | return; |
2169 | #region collision Filter | ||
2170 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | 2027 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); |
2171 | if (obj != null) | 2028 | if (obj != null) |
2172 | { | 2029 | { |
2173 | if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2030 | DetectedObject detobj = new DetectedObject(); |
2174 | { | 2031 | detobj.keyUUID = obj.UUID; |
2175 | string data = ""; | 2032 | detobj.nameStr = obj.Name; |
2176 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2033 | detobj.ownerUUID = obj._ownerID; |
2177 | //If it is 1, it is to accept ONLY collisions from this object | 2034 | detobj.posVector = obj.AbsolutePosition; |
2178 | if(data != "") | 2035 | detobj.rotQuat = obj.GetWorldRotation(); |
2179 | { | 2036 | detobj.velVector = obj.Velocity; |
2180 | DetectedObject detobj = new DetectedObject(); | 2037 | detobj.colliderType = 0; |
2181 | detobj.keyUUID = obj.UUID; | 2038 | detobj.groupUUID = obj._groupID; |
2182 | detobj.nameStr = obj.Name; | 2039 | colliding.Add(detobj); |
2183 | detobj.ownerUUID = obj._ownerID; | ||
2184 | detobj.posVector = obj.AbsolutePosition; | ||
2185 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2186 | detobj.velVector = obj.Velocity; | ||
2187 | detobj.colliderType = 0; | ||
2188 | detobj.groupUUID = obj._groupID; | ||
2189 | colliding.Add(detobj); | ||
2190 | } | ||
2191 | //If it is 0, it is to not accept collisions from this object | ||
2192 | else | ||
2193 | { | ||
2194 | } | ||
2195 | } | ||
2196 | else | ||
2197 | { | ||
2198 | string data = ""; | ||
2199 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
2200 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | ||
2201 | if(data == "") | ||
2202 | { | ||
2203 | DetectedObject detobj = new DetectedObject(); | ||
2204 | detobj.keyUUID = obj.UUID; | ||
2205 | detobj.nameStr = obj.Name; | ||
2206 | detobj.ownerUUID = obj._ownerID; | ||
2207 | detobj.posVector = obj.AbsolutePosition; | ||
2208 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2209 | detobj.velVector = obj.Velocity; | ||
2210 | detobj.colliderType = 0; | ||
2211 | detobj.groupUUID = obj._groupID; | ||
2212 | colliding.Add(detobj); | ||
2213 | } | ||
2214 | } | ||
2215 | } | 2040 | } |
2216 | else | 2041 | else |
2217 | { | 2042 | { |
@@ -2223,52 +2048,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2223 | 2048 | ||
2224 | if (av.LocalId == localId) | 2049 | if (av.LocalId == localId) |
2225 | { | 2050 | { |
2226 | if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2051 | DetectedObject detobj = new DetectedObject(); |
2227 | { | 2052 | detobj.keyUUID = av.UUID; |
2228 | string data = ""; | 2053 | detobj.nameStr = av.Name; |
2229 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2054 | detobj.ownerUUID = av.UUID; |
2230 | //If it is 1, it is to accept ONLY collisions from this avatar | 2055 | detobj.posVector = av.AbsolutePosition; |
2231 | if(data != "") | 2056 | detobj.rotQuat = av.Rotation; |
2232 | { | 2057 | detobj.velVector = av.Velocity; |
2233 | DetectedObject detobj = new DetectedObject(); | 2058 | detobj.colliderType = 0; |
2234 | detobj.keyUUID = av.UUID; | 2059 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; |
2235 | detobj.nameStr = av.ControllingClient.Name; | 2060 | colliding.Add(detobj); |
2236 | detobj.ownerUUID = av.UUID; | ||
2237 | detobj.posVector = av.AbsolutePosition; | ||
2238 | detobj.rotQuat = av.Rotation; | ||
2239 | detobj.velVector = av.Velocity; | ||
2240 | detobj.colliderType = 0; | ||
2241 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2242 | colliding.Add(detobj); | ||
2243 | } | ||
2244 | //If it is 0, it is to not accept collisions from this avatar | ||
2245 | else | ||
2246 | { | ||
2247 | } | ||
2248 | } | ||
2249 | else | ||
2250 | { | ||
2251 | string data = ""; | ||
2252 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
2253 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | ||
2254 | if(data == "") | ||
2255 | { | ||
2256 | DetectedObject detobj = new DetectedObject(); | ||
2257 | detobj.keyUUID = av.UUID; | ||
2258 | detobj.nameStr = av.ControllingClient.Name; | ||
2259 | detobj.ownerUUID = av.UUID; | ||
2260 | detobj.posVector = av.AbsolutePosition; | ||
2261 | detobj.rotQuat = av.Rotation; | ||
2262 | detobj.velVector = av.Velocity; | ||
2263 | detobj.colliderType = 0; | ||
2264 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2265 | colliding.Add(detobj); | ||
2266 | } | ||
2267 | } | ||
2268 | } | 2061 | } |
2269 | } | 2062 | } |
2270 | } | 2063 | } |
2271 | #endregion | ||
2272 | } | 2064 | } |
2273 | 2065 | ||
2274 | if (colliding.Count > 0) | 2066 | if (colliding.Count > 0) |