diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-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 8ac4c37..c0243a5 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}; |
@@ -454,15 +451,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
454 | ParentGroup.HasGroupChanged = true; | 451 | ParentGroup.HasGroupChanged = true; |
455 | } | 452 | } |
456 | } | 453 | } |
457 | |||
458 | public Dictionary<int, string> CollisionFilter | ||
459 | { | ||
460 | get { return m_CollisionFilter; } | ||
461 | set | ||
462 | { | ||
463 | m_CollisionFilter = value; | ||
464 | } | ||
465 | } | ||
466 | 454 | ||
467 | public ulong RegionHandle | 455 | public ulong RegionHandle |
468 | { | 456 | { |
@@ -1886,52 +1874,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
1886 | 1874 | ||
1887 | if (m_parentGroup.Scene == null) | 1875 | if (m_parentGroup.Scene == null) |
1888 | return; | 1876 | return; |
1889 | #region collision Filter | 1877 | |
1890 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | 1878 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); |
1891 | if (obj != null) | 1879 | if (obj != null) |
1892 | { | 1880 | { |
1893 | if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 1881 | DetectedObject detobj = new DetectedObject(); |
1894 | { | 1882 | detobj.keyUUID = obj.UUID; |
1895 | string data = ""; | 1883 | detobj.nameStr = obj.Name; |
1896 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1884 | detobj.ownerUUID = obj._ownerID; |
1897 | //If it is 1, it is to accept ONLY collisions from this object | 1885 | detobj.posVector = obj.AbsolutePosition; |
1898 | if(data != "") | 1886 | detobj.rotQuat = obj.GetWorldRotation(); |
1899 | { | 1887 | detobj.velVector = obj.Velocity; |
1900 | DetectedObject detobj = new DetectedObject(); | 1888 | detobj.colliderType = 0; |
1901 | detobj.keyUUID = obj.UUID; | 1889 | detobj.groupUUID = obj._groupID; |
1902 | detobj.nameStr = obj.Name; | 1890 | colliding.Add(detobj); |
1903 | detobj.ownerUUID = obj._ownerID; | ||
1904 | detobj.posVector = obj.AbsolutePosition; | ||
1905 | detobj.rotQuat = obj.GetWorldRotation(); | ||
1906 | detobj.velVector = obj.Velocity; | ||
1907 | detobj.colliderType = 0; | ||
1908 | detobj.groupUUID = obj._groupID; | ||
1909 | colliding.Add(detobj); | ||
1910 | } | ||
1911 | //If it is 0, it is to not accept collisions from this object | ||
1912 | else | ||
1913 | { | ||
1914 | } | ||
1915 | } | ||
1916 | else | ||
1917 | { | ||
1918 | string data = ""; | ||
1919 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
1920 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | ||
1921 | if(data == "") | ||
1922 | { | ||
1923 | DetectedObject detobj = new DetectedObject(); | ||
1924 | detobj.keyUUID = obj.UUID; | ||
1925 | detobj.nameStr = obj.Name; | ||
1926 | detobj.ownerUUID = obj._ownerID; | ||
1927 | detobj.posVector = obj.AbsolutePosition; | ||
1928 | detobj.rotQuat = obj.GetWorldRotation(); | ||
1929 | detobj.velVector = obj.Velocity; | ||
1930 | detobj.colliderType = 0; | ||
1931 | detobj.groupUUID = obj._groupID; | ||
1932 | colliding.Add(detobj); | ||
1933 | } | ||
1934 | } | ||
1935 | } | 1891 | } |
1936 | else | 1892 | else |
1937 | { | 1893 | { |
@@ -1943,52 +1899,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1943 | 1899 | ||
1944 | if (av.LocalId == localId) | 1900 | if (av.LocalId == localId) |
1945 | { | 1901 | { |
1946 | if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 1902 | DetectedObject detobj = new DetectedObject(); |
1947 | { | 1903 | detobj.keyUUID = av.UUID; |
1948 | string data = ""; | 1904 | detobj.nameStr = av.ControllingClient.Name; |
1949 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1905 | detobj.ownerUUID = av.UUID; |
1950 | //If it is 1, it is to accept ONLY collisions from this avatar | 1906 | detobj.posVector = av.AbsolutePosition; |
1951 | if(data != "") | 1907 | detobj.rotQuat = av.Rotation; |
1952 | { | 1908 | detobj.velVector = av.Velocity; |
1953 | DetectedObject detobj = new DetectedObject(); | 1909 | detobj.colliderType = 0; |
1954 | detobj.keyUUID = av.UUID; | 1910 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; |
1955 | detobj.nameStr = av.ControllingClient.Name; | 1911 | colliding.Add(detobj); |
1956 | detobj.ownerUUID = av.UUID; | ||
1957 | detobj.posVector = av.AbsolutePosition; | ||
1958 | detobj.rotQuat = av.Rotation; | ||
1959 | detobj.velVector = av.Velocity; | ||
1960 | detobj.colliderType = 0; | ||
1961 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
1962 | colliding.Add(detobj); | ||
1963 | } | ||
1964 | //If it is 0, it is to not accept collisions from this avatar | ||
1965 | else | ||
1966 | { | ||
1967 | } | ||
1968 | } | ||
1969 | else | ||
1970 | { | ||
1971 | string data = ""; | ||
1972 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
1973 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | ||
1974 | if(data == "") | ||
1975 | { | ||
1976 | DetectedObject detobj = new DetectedObject(); | ||
1977 | detobj.keyUUID = av.UUID; | ||
1978 | detobj.nameStr = av.ControllingClient.Name; | ||
1979 | detobj.ownerUUID = av.UUID; | ||
1980 | detobj.posVector = av.AbsolutePosition; | ||
1981 | detobj.rotQuat = av.Rotation; | ||
1982 | detobj.velVector = av.Velocity; | ||
1983 | detobj.colliderType = 0; | ||
1984 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
1985 | colliding.Add(detobj); | ||
1986 | } | ||
1987 | } | ||
1988 | } | 1912 | } |
1989 | } | 1913 | } |
1990 | } | 1914 | } |
1991 | #endregion | ||
1992 | } | 1915 | } |
1993 | if (colliding.Count > 0) | 1916 | if (colliding.Count > 0) |
1994 | { | 1917 | { |
@@ -2022,105 +1945,41 @@ namespace OpenSim.Region.Framework.Scenes | |||
2022 | 1945 | ||
2023 | if (m_parentGroup.Scene == null) | 1946 | if (m_parentGroup.Scene == null) |
2024 | return; | 1947 | return; |
2025 | #region collision Filter | 1948 | |
2026 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | 1949 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); |
2027 | if (obj != null) | 1950 | if (obj != null) |
2028 | { | 1951 | { |
2029 | if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 1952 | DetectedObject detobj = new DetectedObject(); |
2030 | { | 1953 | detobj.keyUUID = obj.UUID; |
2031 | string data = ""; | 1954 | detobj.nameStr = obj.Name; |
2032 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1955 | detobj.ownerUUID = obj._ownerID; |
2033 | //If it is 1, it is to accept ONLY collisions from this object | 1956 | detobj.posVector = obj.AbsolutePosition; |
2034 | if(data != "") | 1957 | detobj.rotQuat = obj.GetWorldRotation(); |
2035 | { | 1958 | detobj.velVector = obj.Velocity; |
2036 | DetectedObject detobj = new DetectedObject(); | 1959 | detobj.colliderType = 0; |
2037 | detobj.keyUUID = obj.UUID; | 1960 | detobj.groupUUID = obj._groupID; |
2038 | detobj.nameStr = obj.Name; | 1961 | colliding.Add(detobj); |
2039 | detobj.ownerUUID = obj._ownerID; | ||
2040 | detobj.posVector = obj.AbsolutePosition; | ||
2041 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2042 | detobj.velVector = obj.Velocity; | ||
2043 | detobj.colliderType = 0; | ||
2044 | detobj.groupUUID = obj._groupID; | ||
2045 | colliding.Add(detobj); | ||
2046 | } | ||
2047 | //If it is 0, it is to not accept collisions from this object | ||
2048 | else | ||
2049 | { | ||
2050 | } | ||
2051 | } | ||
2052 | else | ||
2053 | { | ||
2054 | string data = ""; | ||
2055 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
2056 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | ||
2057 | if(data == "") | ||
2058 | { | ||
2059 | DetectedObject detobj = new DetectedObject(); | ||
2060 | detobj.keyUUID = obj.UUID; | ||
2061 | detobj.nameStr = obj.Name; | ||
2062 | detobj.ownerUUID = obj._ownerID; | ||
2063 | detobj.posVector = obj.AbsolutePosition; | ||
2064 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2065 | detobj.velVector = obj.Velocity; | ||
2066 | detobj.colliderType = 0; | ||
2067 | detobj.groupUUID = obj._groupID; | ||
2068 | colliding.Add(detobj); | ||
2069 | } | ||
2070 | } | ||
2071 | } | 1962 | } |
2072 | else | 1963 | else |
2073 | { | 1964 | { |
2074 | ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); | 1965 | ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); |
2075 | 1966 | ||
2076 | for (int i = 0; i < avlist.Length; i++) | 1967 | for (int i = 0; i < avlist.Length; i++) |
2077 | { | 1968 | { |
2078 | ScenePresence av = avlist[i]; | 1969 | ScenePresence av = avlist[i]; |
2079 | 1970 | ||
2080 | if (av.LocalId == localId) | 1971 | if (av.LocalId == localId) |
2081 | { | 1972 | { |
2082 | if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 1973 | DetectedObject detobj = new DetectedObject(); |
2083 | { | 1974 | detobj.keyUUID = av.UUID; |
2084 | string data = ""; | 1975 | detobj.nameStr = av.Name; |
2085 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1976 | detobj.ownerUUID = av.UUID; |
2086 | //If it is 1, it is to accept ONLY collisions from this avatar | 1977 | detobj.posVector = av.AbsolutePosition; |
2087 | if(data != "") | 1978 | detobj.rotQuat = av.Rotation; |
2088 | { | 1979 | detobj.velVector = av.Velocity; |
2089 | DetectedObject detobj = new DetectedObject(); | 1980 | detobj.colliderType = 0; |
2090 | detobj.keyUUID = av.UUID; | 1981 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; |
2091 | detobj.nameStr = av.ControllingClient.Name; | 1982 | colliding.Add(detobj); |
2092 | detobj.ownerUUID = av.UUID; | ||
2093 | detobj.posVector = av.AbsolutePosition; | ||
2094 | detobj.rotQuat = av.Rotation; | ||
2095 | detobj.velVector = av.Velocity; | ||
2096 | detobj.colliderType = 0; | ||
2097 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2098 | colliding.Add(detobj); | ||
2099 | } | ||
2100 | //If it is 0, it is to not accept collisions from this avatar | ||
2101 | else | ||
2102 | { | ||
2103 | } | ||
2104 | } | ||
2105 | else | ||
2106 | { | ||
2107 | string data = ""; | ||
2108 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
2109 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | ||
2110 | if(data == "") | ||
2111 | { | ||
2112 | DetectedObject detobj = new DetectedObject(); | ||
2113 | detobj.keyUUID = av.UUID; | ||
2114 | detobj.nameStr = av.ControllingClient.Name; | ||
2115 | detobj.ownerUUID = av.UUID; | ||
2116 | detobj.posVector = av.AbsolutePosition; | ||
2117 | detobj.rotQuat = av.Rotation; | ||
2118 | detobj.velVector = av.Velocity; | ||
2119 | detobj.colliderType = 0; | ||
2120 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2121 | colliding.Add(detobj); | ||
2122 | } | ||
2123 | } | ||
2124 | } | 1983 | } |
2125 | } | 1984 | } |
2126 | } | 1985 | } |
@@ -2138,7 +1997,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2138 | m_parentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage); | 1997 | m_parentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage); |
2139 | } | 1998 | } |
2140 | } | 1999 | } |
2141 | #endregion | ||
2142 | } | 2000 | } |
2143 | 2001 | ||
2144 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0) | 2002 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0) |
@@ -2157,52 +2015,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2157 | return; | 2015 | return; |
2158 | if (m_parentGroup.Scene == null) | 2016 | if (m_parentGroup.Scene == null) |
2159 | return; | 2017 | return; |
2160 | #region collision Filter | ||
2161 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | 2018 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); |
2162 | if (obj != null) | 2019 | if (obj != null) |
2163 | { | 2020 | { |
2164 | if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2021 | DetectedObject detobj = new DetectedObject(); |
2165 | { | 2022 | detobj.keyUUID = obj.UUID; |
2166 | string data = ""; | 2023 | detobj.nameStr = obj.Name; |
2167 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2024 | detobj.ownerUUID = obj._ownerID; |
2168 | //If it is 1, it is to accept ONLY collisions from this object | 2025 | detobj.posVector = obj.AbsolutePosition; |
2169 | if(data != "") | 2026 | detobj.rotQuat = obj.GetWorldRotation(); |
2170 | { | 2027 | detobj.velVector = obj.Velocity; |
2171 | DetectedObject detobj = new DetectedObject(); | 2028 | detobj.colliderType = 0; |
2172 | detobj.keyUUID = obj.UUID; | 2029 | detobj.groupUUID = obj._groupID; |
2173 | detobj.nameStr = obj.Name; | 2030 | colliding.Add(detobj); |
2174 | detobj.ownerUUID = obj._ownerID; | ||
2175 | detobj.posVector = obj.AbsolutePosition; | ||
2176 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2177 | detobj.velVector = obj.Velocity; | ||
2178 | detobj.colliderType = 0; | ||
2179 | detobj.groupUUID = obj._groupID; | ||
2180 | colliding.Add(detobj); | ||
2181 | } | ||
2182 | //If it is 0, it is to not accept collisions from this object | ||
2183 | else | ||
2184 | { | ||
2185 | } | ||
2186 | } | ||
2187 | else | ||
2188 | { | ||
2189 | string data = ""; | ||
2190 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
2191 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | ||
2192 | if(data == "") | ||
2193 | { | ||
2194 | DetectedObject detobj = new DetectedObject(); | ||
2195 | detobj.keyUUID = obj.UUID; | ||
2196 | detobj.nameStr = obj.Name; | ||
2197 | detobj.ownerUUID = obj._ownerID; | ||
2198 | detobj.posVector = obj.AbsolutePosition; | ||
2199 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2200 | detobj.velVector = obj.Velocity; | ||
2201 | detobj.colliderType = 0; | ||
2202 | detobj.groupUUID = obj._groupID; | ||
2203 | colliding.Add(detobj); | ||
2204 | } | ||
2205 | } | ||
2206 | } | 2031 | } |
2207 | else | 2032 | else |
2208 | { | 2033 | { |
@@ -2214,52 +2039,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2214 | 2039 | ||
2215 | if (av.LocalId == localId) | 2040 | if (av.LocalId == localId) |
2216 | { | 2041 | { |
2217 | if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2042 | DetectedObject detobj = new DetectedObject(); |
2218 | { | 2043 | detobj.keyUUID = av.UUID; |
2219 | string data = ""; | 2044 | detobj.nameStr = av.Name; |
2220 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2045 | detobj.ownerUUID = av.UUID; |
2221 | //If it is 1, it is to accept ONLY collisions from this avatar | 2046 | detobj.posVector = av.AbsolutePosition; |
2222 | if(data != "") | 2047 | detobj.rotQuat = av.Rotation; |
2223 | { | 2048 | detobj.velVector = av.Velocity; |
2224 | DetectedObject detobj = new DetectedObject(); | 2049 | detobj.colliderType = 0; |
2225 | detobj.keyUUID = av.UUID; | 2050 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; |
2226 | detobj.nameStr = av.ControllingClient.Name; | 2051 | colliding.Add(detobj); |
2227 | detobj.ownerUUID = av.UUID; | ||
2228 | detobj.posVector = av.AbsolutePosition; | ||
2229 | detobj.rotQuat = av.Rotation; | ||
2230 | detobj.velVector = av.Velocity; | ||
2231 | detobj.colliderType = 0; | ||
2232 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2233 | colliding.Add(detobj); | ||
2234 | } | ||
2235 | //If it is 0, it is to not accept collisions from this avatar | ||
2236 | else | ||
2237 | { | ||
2238 | } | ||
2239 | } | ||
2240 | else | ||
2241 | { | ||
2242 | string data = ""; | ||
2243 | m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
2244 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | ||
2245 | if(data == "") | ||
2246 | { | ||
2247 | DetectedObject detobj = new DetectedObject(); | ||
2248 | detobj.keyUUID = av.UUID; | ||
2249 | detobj.nameStr = av.ControllingClient.Name; | ||
2250 | detobj.ownerUUID = av.UUID; | ||
2251 | detobj.posVector = av.AbsolutePosition; | ||
2252 | detobj.rotQuat = av.Rotation; | ||
2253 | detobj.velVector = av.Velocity; | ||
2254 | detobj.colliderType = 0; | ||
2255 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2256 | colliding.Add(detobj); | ||
2257 | } | ||
2258 | } | ||
2259 | } | 2052 | } |
2260 | } | 2053 | } |
2261 | } | 2054 | } |
2262 | #endregion | ||
2263 | } | 2055 | } |
2264 | 2056 | ||
2265 | if (colliding.Count > 0) | 2057 | if (colliding.Count > 0) |