diff options
author | Revolution | 2010-01-06 21:19:00 -0600 |
---|---|---|
committer | Melanie | 2010-01-07 10:06:30 +0000 |
commit | b4c83bc203147e9381d004074a026fd189d5fead (patch) | |
tree | 96a514189f81d74ffb41e531b327ae7178c95f7b /OpenSim | |
parent | Complete the XInventoryConnector. Flesh out the skeleton for the (diff) | |
download | opensim-SC-b4c83bc203147e9381d004074a026fd189d5fead.zip opensim-SC-b4c83bc203147e9381d004074a026fd189d5fead.tar.gz opensim-SC-b4c83bc203147e9381d004074a026fd189d5fead.tar.bz2 opensim-SC-b4c83bc203147e9381d004074a026fd189d5fead.tar.xz |
Fixes the Collision errors and adds more to llGetStatus
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 119 |
1 files changed, 74 insertions, 45 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 22a8ca1..d1bc351 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -139,7 +139,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
139 | public uint TimeStampTerse; | 139 | public uint TimeStampTerse; |
140 | 140 | ||
141 | [XmlIgnore] | 141 | [XmlIgnore] |
142 | public UUID FromItemID; | 142 | public UUID FromItemID; |
143 | |||
144 | [XmlIgnore] | ||
145 | public int STATUS_ROTATE_X; | ||
146 | |||
147 | [XmlIgnore] | ||
148 | public int STATUS_ROTATE_Y; | ||
149 | |||
150 | [XmlIgnore] | ||
151 | public int STATUS_ROTATE_Z; | ||
143 | 152 | ||
144 | [XmlIgnore] | 153 | [XmlIgnore] |
145 | private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>(); | 154 | private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>(); |
@@ -1671,6 +1680,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1671 | return false; | 1680 | return false; |
1672 | 1681 | ||
1673 | return m_parentGroup.RootPart.DIE_AT_EDGE; | 1682 | return m_parentGroup.RootPart.DIE_AT_EDGE; |
1683 | } | ||
1684 | |||
1685 | public int GetAxisRotation(int axis) | ||
1686 | { | ||
1687 | //Cannot use ScriptBaseClass constants as no referance to it currently. | ||
1688 | if (axis == 2)//STATUS_ROTATE_X | ||
1689 | return STATUS_ROTATE_X; | ||
1690 | if (axis == 4)//STATUS_ROTATE_Y | ||
1691 | return STATUS_ROTATE_Y; | ||
1692 | if (axis == 8)//STATUS_ROTATE_Z | ||
1693 | return STATUS_ROTATE_Z; | ||
1694 | |||
1695 | return 0; | ||
1674 | } | 1696 | } |
1675 | 1697 | ||
1676 | public double GetDistanceTo(Vector3 a, Vector3 b) | 1698 | public double GetDistanceTo(Vector3 a, Vector3 b) |
@@ -1914,24 +1936,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
1914 | else | 1936 | else |
1915 | { | 1937 | { |
1916 | } | 1938 | } |
1917 | } | 1939 | } |
1918 | else | 1940 | else |
1919 | { | 1941 | { |
1920 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1942 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1921 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | 1943 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work |
1922 | if (found) | 1944 | if (found) |
1923 | { | 1945 | { |
1924 | DetectedObject detobj = new DetectedObject(); | 1946 | DetectedObject detobj = new DetectedObject(); |
1925 | detobj.keyUUID = obj.UUID; | 1947 | detobj.keyUUID = obj.UUID; |
1926 | detobj.nameStr = obj.Name; | 1948 | detobj.nameStr = obj.Name; |
1927 | detobj.ownerUUID = obj._ownerID; | 1949 | detobj.ownerUUID = obj._ownerID; |
1928 | detobj.posVector = obj.AbsolutePosition; | 1950 | detobj.posVector = obj.AbsolutePosition; |
1929 | detobj.rotQuat = obj.GetWorldRotation(); | 1951 | detobj.rotQuat = obj.GetWorldRotation(); |
1930 | detobj.velVector = obj.Velocity; | 1952 | detobj.velVector = obj.Velocity; |
1931 | detobj.colliderType = 0; | 1953 | detobj.colliderType = 0; |
1932 | detobj.groupUUID = obj._groupID; | 1954 | detobj.groupUUID = obj._groupID; |
1933 | colliding.Add(detobj); | 1955 | colliding.Add(detobj); |
1934 | } | 1956 | } |
1935 | } | 1957 | } |
1936 | } | 1958 | } |
1937 | else | 1959 | else |
@@ -1943,8 +1965,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1943 | ScenePresence av = avlist[i]; | 1965 | ScenePresence av = avlist[i]; |
1944 | 1966 | ||
1945 | if (av.LocalId == localId) | 1967 | if (av.LocalId == localId) |
1946 | { | 1968 | { |
1947 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 1969 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
1948 | { | 1970 | { |
1949 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1971 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1950 | //If it is 1, it is to accept ONLY collisions from this avatar | 1972 | //If it is 1, it is to accept ONLY collisions from this avatar |
@@ -1965,24 +1987,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
1965 | else | 1987 | else |
1966 | { | 1988 | { |
1967 | } | 1989 | } |
1968 | } | 1990 | } |
1969 | else | 1991 | else |
1970 | { | 1992 | { |
1971 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1993 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1972 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 1994 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
1973 | if (found) | 1995 | if (!found) |
1974 | { | 1996 | { |
1975 | DetectedObject detobj = new DetectedObject(); | 1997 | DetectedObject detobj = new DetectedObject(); |
1976 | detobj.keyUUID = av.UUID; | 1998 | detobj.keyUUID = av.UUID; |
1977 | detobj.nameStr = av.ControllingClient.Name; | 1999 | detobj.nameStr = av.ControllingClient.Name; |
1978 | detobj.ownerUUID = av.UUID; | 2000 | detobj.ownerUUID = av.UUID; |
1979 | detobj.posVector = av.AbsolutePosition; | 2001 | detobj.posVector = av.AbsolutePosition; |
1980 | detobj.rotQuat = av.Rotation; | 2002 | detobj.rotQuat = av.Rotation; |
1981 | detobj.velVector = av.Velocity; | 2003 | detobj.velVector = av.Velocity; |
1982 | detobj.colliderType = 0; | 2004 | detobj.colliderType = 0; |
1983 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | 2005 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; |
1984 | colliding.Add(detobj); | 2006 | colliding.Add(detobj); |
1985 | } | 2007 | } |
1986 | } | 2008 | } |
1987 | 2009 | ||
1988 | } | 2010 | } |
@@ -2079,8 +2101,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2079 | ScenePresence av = avlist[i]; | 2101 | ScenePresence av = avlist[i]; |
2080 | 2102 | ||
2081 | if (av.LocalId == localId) | 2103 | if (av.LocalId == localId) |
2082 | { | 2104 | { |
2083 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2105 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2084 | { | 2106 | { |
2085 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2107 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2086 | //If it is 1, it is to accept ONLY collisions from this avatar | 2108 | //If it is 1, it is to accept ONLY collisions from this avatar |
@@ -2106,7 +2128,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2106 | { | 2128 | { |
2107 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2129 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2108 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2130 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2109 | if (found) | 2131 | if (!found) |
2110 | { | 2132 | { |
2111 | DetectedObject detobj = new DetectedObject(); | 2133 | DetectedObject detobj = new DetectedObject(); |
2112 | detobj.keyUUID = av.UUID; | 2134 | detobj.keyUUID = av.UUID; |
@@ -2210,8 +2232,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2210 | ScenePresence av = avlist[i]; | 2232 | ScenePresence av = avlist[i]; |
2211 | 2233 | ||
2212 | if (av.LocalId == localId) | 2234 | if (av.LocalId == localId) |
2213 | { | 2235 | { |
2214 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2236 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2215 | { | 2237 | { |
2216 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2238 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2217 | //If it is 1, it is to accept ONLY collisions from this avatar | 2239 | //If it is 1, it is to accept ONLY collisions from this avatar |
@@ -2237,7 +2259,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2237 | { | 2259 | { |
2238 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2260 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2239 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2261 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2240 | if (found) | 2262 | if (!found) |
2241 | { | 2263 | { |
2242 | DetectedObject detobj = new DetectedObject(); | 2264 | DetectedObject detobj = new DetectedObject(); |
2243 | detobj.keyUUID = av.UUID; | 2265 | detobj.keyUUID = av.UUID; |
@@ -2270,7 +2292,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2270 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingEnd(LocalId, EndCollidingMessage); | 2292 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingEnd(LocalId, EndCollidingMessage); |
2271 | } | 2293 | } |
2272 | } | 2294 | } |
2273 | } | 2295 | } |
2274 | } | 2296 | } |
2275 | 2297 | ||
2276 | public void PhysicsOutOfBounds(Vector3 pos) | 2298 | public void PhysicsOutOfBounds(Vector3 pos) |
@@ -2736,7 +2758,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2736 | if (m_parentGroup != null) | 2758 | if (m_parentGroup != null) |
2737 | { | 2759 | { |
2738 | m_parentGroup.SetAxisRotation(axis, rotate); | 2760 | m_parentGroup.SetAxisRotation(axis, rotate); |
2739 | } | 2761 | } |
2762 | //Cannot use ScriptBaseClass constants as no referance to it currently. | ||
2763 | if (axis == 2)//STATUS_ROTATE_X | ||
2764 | STATUS_ROTATE_X = rotate; | ||
2765 | if (axis == 4)//STATUS_ROTATE_Y | ||
2766 | STATUS_ROTATE_Y = rotate; | ||
2767 | if (axis == 8)//STATUS_ROTATE_Z | ||
2768 | STATUS_ROTATE_Z = rotate; | ||
2740 | } | 2769 | } |
2741 | 2770 | ||
2742 | public void SetBuoyancy(float fvalue) | 2771 | public void SetBuoyancy(float fvalue) |