diff options
author | Adam Johnson | 2007-12-07 08:54:31 +0000 |
---|---|---|
committer | Adam Johnson | 2007-12-07 08:54:31 +0000 |
commit | 3d938f76b7c2f8ede862f9979383d79dfb21372c (patch) | |
tree | 0c99beb3affa959f596e079f20ed806364e3d3dc /OpenSim | |
parent | * Added hacked support for 'anyone can move' and 'anyone can copy'. (diff) | |
download | opensim-SC-3d938f76b7c2f8ede862f9979383d79dfb21372c.zip opensim-SC-3d938f76b7c2f8ede862f9979383d79dfb21372c.tar.gz opensim-SC-3d938f76b7c2f8ede862f9979383d79dfb21372c.tar.bz2 opensim-SC-3d938f76b7c2f8ede862f9979383d79dfb21372c.tar.xz |
Updates to LibSL revision 1498. Thanks Johan!
Diffstat (limited to '')
12 files changed, 63 insertions, 56 deletions
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 4603280..f7cb20c 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs | |||
@@ -258,7 +258,7 @@ namespace OpenSim.Region.Capabilities | |||
258 | /// <returns></returns> | 258 | /// <returns></returns> |
259 | public string NoteCardAgentInventory(string request, string path, string param) | 259 | public string NoteCardAgentInventory(string request, string path, string param) |
260 | { | 260 | { |
261 | Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Helpers.StringToField(request)); | 261 | libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap)libsecondlife.StructuredData.LLSDParser.DeserializeBinary(Helpers.StringToField(request)); |
262 | LLSDItemUpdate llsdRequest = new LLSDItemUpdate(); | 262 | LLSDItemUpdate llsdRequest = new LLSDItemUpdate(); |
263 | LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); | 263 | LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); |
264 | 264 | ||
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs index 8252a63..793c366 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs | |||
@@ -48,7 +48,7 @@ namespace OpenSim.Region.Capabilities | |||
48 | return sw.ToString(); | 48 | return sw.ToString(); |
49 | } | 49 | } |
50 | 50 | ||
51 | public static void SerializeLLSDType(XmlTextWriter writer, object obj) | 51 | private static void SerializeLLSDType(XmlTextWriter writer, object obj) |
52 | { | 52 | { |
53 | Type myType = obj.GetType(); | 53 | Type myType = obj.GetType(); |
54 | LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); | 54 | LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); |
@@ -76,7 +76,8 @@ namespace OpenSim.Region.Capabilities | |||
76 | writer.WriteStartElement(String.Empty, "key", String.Empty); | 76 | writer.WriteStartElement(String.Empty, "key", String.Empty); |
77 | writer.WriteString(fields[i].Name); | 77 | writer.WriteString(fields[i].Name); |
78 | writer.WriteEndElement(); | 78 | writer.WriteEndElement(); |
79 | LLSD.LLSDWriteOne(writer, fieldValue); | 79 | libsecondlife.StructuredData.LLSDParser.SerializeXmlElement( |
80 | writer, libsecondlife.StructuredData.LLSD.FromObject(fieldValue)); | ||
80 | } | 81 | } |
81 | } | 82 | } |
82 | writer.WriteEndElement(); | 83 | writer.WriteEndElement(); |
@@ -99,11 +100,12 @@ namespace OpenSim.Region.Capabilities | |||
99 | } | 100 | } |
100 | else | 101 | else |
101 | { | 102 | { |
102 | LLSD.LLSDWriteOne(writer, obj); | 103 | libsecondlife.StructuredData.LLSDParser.SerializeXmlElement( |
104 | writer, libsecondlife.StructuredData.LLSD.FromObject(obj)); | ||
103 | } | 105 | } |
104 | } | 106 | } |
105 | 107 | ||
106 | public static object DeserialiseLLSDMap(Hashtable llsd, object obj) | 108 | public static object DeserialiseLLSDMap(libsecondlife.StructuredData.LLSDMap llsd, object obj) |
107 | { | 109 | { |
108 | Type myType = obj.GetType(); | 110 | Type myType = obj.GetType(); |
109 | LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); | 111 | LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); |
@@ -118,10 +120,10 @@ namespace OpenSim.Region.Capabilities | |||
118 | FieldInfo field = myType.GetField((string) enumerator.Key); | 120 | FieldInfo field = myType.GetField((string) enumerator.Key); |
119 | if (field != null) | 121 | if (field != null) |
120 | { | 122 | { |
121 | if (enumerator.Value is Hashtable) | 123 | if (enumerator.Value is libsecondlife.StructuredData.LLSDMap) |
122 | { | 124 | { |
123 | object fieldValue = field.GetValue(obj); | 125 | object fieldValue = field.GetValue(obj); |
124 | DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue); | 126 | DeserialiseLLSDMap((libsecondlife.StructuredData.LLSDMap) enumerator.Value, fieldValue); |
125 | } | 127 | } |
126 | else if (enumerator.Value is ArrayList) | 128 | else if (enumerator.Value is ArrayList) |
127 | { | 129 | { |
@@ -143,4 +145,4 @@ namespace OpenSim.Region.Capabilities | |||
143 | return obj; | 145 | return obj; |
144 | } | 146 | } |
145 | } | 147 | } |
146 | } \ No newline at end of file | 148 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs b/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs index 08e9563..ed25e71 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs | |||
@@ -31,6 +31,7 @@ using System.IO; | |||
31 | using System.Text; | 31 | using System.Text; |
32 | using libsecondlife; | 32 | using libsecondlife; |
33 | using OpenSim.Framework.Servers; | 33 | using OpenSim.Framework.Servers; |
34 | using System.Xml; | ||
34 | 35 | ||
35 | namespace OpenSim.Region.Capabilities | 36 | namespace OpenSim.Region.Capabilities |
36 | { | 37 | { |
@@ -53,7 +54,8 @@ namespace OpenSim.Region.Capabilities | |||
53 | //string requestBody = streamReader.ReadToEnd(); | 54 | //string requestBody = streamReader.ReadToEnd(); |
54 | //streamReader.Close(); | 55 | //streamReader.Close(); |
55 | 56 | ||
56 | Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(request); | 57 | libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap) |
58 | libsecondlife.StructuredData.LLSDParser.DeserializeXml(new XmlTextReader(request)); | ||
57 | TRequest llsdRequest = new TRequest(); | 59 | TRequest llsdRequest = new TRequest(); |
58 | LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); | 60 | LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); |
59 | 61 | ||
@@ -64,4 +66,4 @@ namespace OpenSim.Region.Capabilities | |||
64 | return encoding.GetBytes(LLSDHelpers.SerialiseLLSDReply(response)); | 66 | return encoding.GetBytes(LLSDHelpers.SerialiseLLSDReply(response)); |
65 | } | 67 | } |
66 | } | 68 | } |
67 | } \ No newline at end of file | 69 | } |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index c731561..a9aff60 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -46,6 +46,12 @@ namespace OpenSim.Framework | |||
46 | private static object XferLock = new object(); | 46 | private static object XferLock = new object(); |
47 | private static Dictionary<LLUUID, string> capsURLS = new Dictionary<LLUUID, string>(); | 47 | private static Dictionary<LLUUID, string> capsURLS = new Dictionary<LLUUID, string>(); |
48 | 48 | ||
49 | public static double GetDistanceTo(LLVector3 a, LLVector3 b) { | ||
50 | float dx = a.X - b.X; | ||
51 | float dy = a.Y - b.Y; | ||
52 | float dz = a.Z - b.Z; | ||
53 | return Math.Sqrt(dx * dx + dy * dy + dz * dz); | ||
54 | } | ||
49 | 55 | ||
50 | public static ulong UIntsToLong(uint X, uint Y) | 56 | public static ulong UIntsToLong(uint X, uint Y) |
51 | { | 57 | { |
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 284a2de..b2db4cb 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -722,9 +722,11 @@ namespace OpenSim.Region.ClientStack | |||
722 | /// | 722 | /// |
723 | /// </summary> | 723 | /// </summary> |
724 | /// <param name="regInfo"></param> | 724 | /// <param name="regInfo"></param> |
725 | private byte[] m_channelVersion=new byte[] { 0x00} ; // Dummy value needed by libSL | ||
725 | public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) | 726 | public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) |
726 | { | 727 | { |
727 | AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); | 728 | AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); |
729 | mov.SimData.ChannelVersion = m_channelVersion; | ||
728 | mov.AgentData.SessionID = m_sessionId; | 730 | mov.AgentData.SessionID = m_sessionId; |
729 | mov.AgentData.AgentID = AgentId; | 731 | mov.AgentData.AgentID = AgentId; |
730 | mov.Data.RegionHandle = regInfo.RegionHandle; | 732 | mov.Data.RegionHandle = regInfo.RegionHandle; |
@@ -1170,15 +1172,13 @@ namespace OpenSim.Region.ClientStack | |||
1170 | inventoryReply.InventoryData[0].SaleType = 0; | 1172 | inventoryReply.InventoryData[0].SaleType = 0; |
1171 | inventoryReply.InventoryData[0].Type = (sbyte) item.assetType; | 1173 | inventoryReply.InventoryData[0].Type = (sbyte) item.assetType; |
1172 | inventoryReply.InventoryData[0].CRC = | 1174 | inventoryReply.InventoryData[0].CRC = |
1173 | Helpers.InventoryCRC(inventoryReply.InventoryData[0].CreationDate, inventoryReply.InventoryData[0].SaleType, | 1175 | Helpers.InventoryCRC(1000, 0, inventoryReply.InventoryData[0].InvType, |
1174 | inventoryReply.InventoryData[0].InvType, | ||
1175 | inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID, | 1176 | inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID, |
1176 | inventoryReply.InventoryData[0].GroupID, inventoryReply.InventoryData[0].SalePrice, | 1177 | inventoryReply.InventoryData[0].GroupID, 100, |
1177 | inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID, | 1178 | inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID, |
1178 | inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID, | 1179 | inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID, |
1179 | inventoryReply.InventoryData[0].EveryoneMask, inventoryReply.InventoryData[0].Flags, | 1180 | FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, |
1180 | inventoryReply.InventoryData[0].NextOwnerMask, inventoryReply.InventoryData[0].GroupMask, | 1181 | FULL_MASK_PERMISSIONS); |
1181 | inventoryReply.InventoryData[0].OwnerMask); | ||
1182 | 1182 | ||
1183 | OutPacket(inventoryReply, ThrottleOutPacketType.Asset); | 1183 | OutPacket(inventoryReply, ThrottleOutPacketType.Asset); |
1184 | } | 1184 | } |
@@ -1213,16 +1213,13 @@ namespace OpenSim.Region.ClientStack | |||
1213 | InventoryReply.InventoryData[0].SaleType = 0; | 1213 | InventoryReply.InventoryData[0].SaleType = 0; |
1214 | InventoryReply.InventoryData[0].Type = (sbyte) Item.assetType; | 1214 | InventoryReply.InventoryData[0].Type = (sbyte) Item.assetType; |
1215 | InventoryReply.InventoryData[0].CRC = | 1215 | InventoryReply.InventoryData[0].CRC = |
1216 | Helpers.InventoryCRC(InventoryReply.InventoryData[0].CreationDate, InventoryReply.InventoryData[0].SaleType, | 1216 | Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, |
1217 | InventoryReply.InventoryData[0].InvType, | ||
1218 | InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, | 1217 | InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, |
1219 | InventoryReply.InventoryData[0].GroupID, InventoryReply.InventoryData[0].SalePrice, | 1218 | InventoryReply.InventoryData[0].GroupID, 100, |
1220 | InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, | 1219 | InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, |
1221 | InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, | 1220 | InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, |
1222 | InventoryReply.InventoryData[0].EveryoneMask, InventoryReply.InventoryData[0].Flags, | 1221 | FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, |
1223 | InventoryReply.InventoryData[0].NextOwnerMask, InventoryReply.InventoryData[0].GroupMask, | 1222 | FULL_MASK_PERMISSIONS); |
1224 | InventoryReply.InventoryData[0].OwnerMask); | ||
1225 | |||
1226 | 1223 | ||
1227 | OutPacket(InventoryReply, ThrottleOutPacketType.Asset); | 1224 | OutPacket(InventoryReply, ThrottleOutPacketType.Asset); |
1228 | } | 1225 | } |
@@ -1602,7 +1599,6 @@ namespace OpenSim.Region.ClientStack | |||
1602 | outPacket.ObjectData[0].ClickAction = clickAction; | 1599 | outPacket.ObjectData[0].ClickAction = clickAction; |
1603 | //outPacket.ObjectData[0].Flags = 0; | 1600 | //outPacket.ObjectData[0].Flags = 0; |
1604 | outPacket.ObjectData[0].Radius = 20; | 1601 | outPacket.ObjectData[0].Radius = 20; |
1605 | |||
1606 | 1602 | ||
1607 | byte[] pb = pos.GetBytes(); | 1603 | byte[] pb = pos.GetBytes(); |
1608 | Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); | 1604 | Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); |
@@ -2904,7 +2900,7 @@ namespace OpenSim.Region.ClientStack | |||
2904 | { | 2900 | { |
2905 | if (OnObjectDescription != null) | 2901 | if (OnObjectDescription != null) |
2906 | { | 2902 | { |
2907 | OnObjectDescription(this,objDes.ObjectData[i].LocalID, | 2903 | OnObjectDescription(this, objDes.ObjectData[i].LocalID, |
2908 | enc.GetString(objDes.ObjectData[i].Description)); | 2904 | enc.GetString(objDes.ObjectData[i].Description)); |
2909 | } | 2905 | } |
2910 | } | 2906 | } |
@@ -2915,7 +2911,7 @@ namespace OpenSim.Region.ClientStack | |||
2915 | { | 2911 | { |
2916 | if (OnObjectName != null) | 2912 | if (OnObjectName != null) |
2917 | { | 2913 | { |
2918 | OnObjectName(this,objName.ObjectData[i].LocalID, enc.GetString(objName.ObjectData[i].Name)); | 2914 | OnObjectName(this, objName.ObjectData[i].LocalID, enc.GetString(objName.ObjectData[i].Name)); |
2919 | } | 2915 | } |
2920 | } | 2916 | } |
2921 | break; | 2917 | break; |
@@ -3003,7 +2999,8 @@ namespace OpenSim.Region.ClientStack | |||
3003 | // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToStringHyphenated()); | 2999 | // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToStringHyphenated()); |
3004 | if (OnAssetUploadRequest != null) | 3000 | if (OnAssetUploadRequest != null) |
3005 | { | 3001 | { |
3006 | OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(SecureSessionId), | 3002 | LLUUID temp=libsecondlife.LLUUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); |
3003 | OnAssetUploadRequest(this, temp, | ||
3007 | request.AssetBlock.TransactionID, request.AssetBlock.Type, | 3004 | request.AssetBlock.TransactionID, request.AssetBlock.Type, |
3008 | request.AssetBlock.AssetData, request.AssetBlock.StoreLocal); | 3005 | request.AssetBlock.AssetData, request.AssetBlock.StoreLocal); |
3009 | } | 3006 | } |
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index c93804f..8af7b49 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs | |||
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules | |||
192 | scene.RegionInfo.RegionLocY * 256, | 192 | scene.RegionInfo.RegionLocY * 256, |
193 | 0); | 193 | 0); |
194 | dis = | 194 | dis = |
195 | Math.Abs((int)avatarRegionPos.GetDistanceTo(fromRegionPos)); | 195 | Math.Abs((int) Util.GetDistanceTo(avatarRegionPos, fromRegionPos)); |
196 | 196 | ||
197 | switch (e.Type) | 197 | switch (e.Type) |
198 | { | 198 | { |
diff --git a/OpenSim/Region/Environment/Modules/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/WorldCommModule.cs index a31b484..0dad998 100644 --- a/OpenSim/Region/Environment/Modules/WorldCommModule.cs +++ b/OpenSim/Region/Environment/Modules/WorldCommModule.cs | |||
@@ -135,7 +135,7 @@ namespace OpenSim.Region.Environment.Modules | |||
135 | { | 135 | { |
136 | m_listenerManager.Remove(handle); | 136 | m_listenerManager.Remove(handle); |
137 | } | 137 | } |
138 | 138 | ||
139 | // This method scans nearby objects and determines if they are listeners, | 139 | // This method scans nearby objects and determines if they are listeners, |
140 | // and if so if this message fits the filter. If it does, then | 140 | // and if so if this message fits the filter. If it does, then |
141 | // enqueue the message for delivery to the objects listen event handler. | 141 | // enqueue the message for delivery to the objects listen event handler. |
@@ -171,9 +171,9 @@ namespace OpenSim.Region.Environment.Modules | |||
171 | double dis = 0; | 171 | double dis = 0; |
172 | 172 | ||
173 | if (source != null) | 173 | if (source != null) |
174 | dis = sPart.AbsolutePosition.GetDistanceTo(source.AbsolutePosition); | 174 | dis = Util.GetDistanceTo(sPart.AbsolutePosition, source.AbsolutePosition); |
175 | else | 175 | else |
176 | dis = sPart.AbsolutePosition.GetDistanceTo(avatar.AbsolutePosition); | 176 | dis = Util.GetDistanceTo(sPart.AbsolutePosition, avatar.AbsolutePosition); |
177 | 177 | ||
178 | switch (type) | 178 | switch (type) |
179 | { | 179 | { |
@@ -490,4 +490,4 @@ namespace OpenSim.Region.Environment.Modules | |||
490 | return m_id; | 490 | return m_id; |
491 | } | 491 | } |
492 | } | 492 | } |
493 | } \ No newline at end of file | 493 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 6c8b3bf..ac504e1 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
144 | 144 | ||
145 | if (transactions != null) | 145 | if (transactions != null) |
146 | { | 146 | { |
147 | LLUUID assetID = transactionID.Combine(remoteClient.SecureSessionId); | 147 | LLUUID assetID = libsecondlife.LLUUID.Combine(transactionID, remoteClient.SecureSessionId); |
148 | AssetBase asset = AssetCache.GetAsset(assetID); | 148 | AssetBase asset = AssetCache.GetAsset(assetID); |
149 | 149 | ||
150 | if (asset == null) | 150 | if (asset == null) |
@@ -432,7 +432,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
432 | ((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId), | 432 | ((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId), |
433 | ((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId), | 433 | ((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId), |
434 | (sbyte) InventoryType.Object, | 434 | (sbyte) InventoryType.Object, |
435 | (sbyte) AssetType.Object, // TODO: after libSL r1357, this becomes AssetType.Primitive | 435 | (sbyte) AssetType.Primitive, |
436 | Helpers.StringToField(sceneObjectXml)); | 436 | Helpers.StringToField(sceneObjectXml)); |
437 | AssetCache.AddAsset(asset); | 437 | AssetCache.AddAsset(asset); |
438 | 438 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index bcee5c7..89e2f0d 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -675,7 +675,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
675 | /// </summary> | 675 | /// </summary> |
676 | public override void Update() | 676 | public override void Update() |
677 | { | 677 | { |
678 | if (lastPhysGroupPos.GetDistanceTo(AbsolutePosition) > 0.02) | 678 | if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) |
679 | { | 679 | { |
680 | foreach (SceneObjectPart part in m_parts.Values) | 680 | foreach (SceneObjectPart part in m_parts.Values) |
681 | { | 681 | { |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index bf02e8d..05a59a2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -749,7 +749,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
749 | 749 | ||
750 | LLVector3 distanceConvert1 = new LLVector3(iray.Origin.x, iray.Origin.y, iray.Origin.z); | 750 | LLVector3 distanceConvert1 = new LLVector3(iray.Origin.x, iray.Origin.y, iray.Origin.z); |
751 | LLVector3 distanceConvert2 = new LLVector3(ipoint.x, ipoint.y, ipoint.z); | 751 | LLVector3 distanceConvert2 = new LLVector3(ipoint.x, ipoint.y, ipoint.z); |
752 | float distance = (float)distanceConvert1.GetDistanceTo(distanceConvert2); | 752 | float distance = (float)Util.GetDistanceTo(distanceConvert1, distanceConvert2); |
753 | 753 | ||
754 | returnresult.distance = distance; | 754 | returnresult.distance = distance; |
755 | 755 | ||
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index b8a2555..66872fa 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -93,12 +93,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
93 | 93 | ||
94 | private enum Dir_ControlFlags | 94 | private enum Dir_ControlFlags |
95 | { | 95 | { |
96 | DIR_CONTROL_FLAG_FOWARD = MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS, | 96 | DIR_CONTROL_FLAG_FOWARD = AgentManager.ControlFlags.AGENT_CONTROL_AT_POS, |
97 | DIR_CONTROL_FLAG_BACK = MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG, | 97 | DIR_CONTROL_FLAG_BACK = AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG, |
98 | DIR_CONTROL_FLAG_LEFT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_POS, | 98 | DIR_CONTROL_FLAG_LEFT = AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS, |
99 | DIR_CONTROL_FLAG_RIGHT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_NEG, | 99 | DIR_CONTROL_FLAG_RIGHT = AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG, |
100 | DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS, | 100 | DIR_CONTROL_FLAG_UP = AgentManager.ControlFlags.AGENT_CONTROL_UP_POS, |
101 | DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG | 101 | DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG |
102 | } | 102 | } |
103 | 103 | ||
104 | /// <summary> | 104 | /// <summary> |
@@ -609,7 +609,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
609 | //MainLog.Instance.Verbose("CAMERA", "AtAxis:" + m_CameraAtAxis.ToString() + " Center:" + m_CameraCenter.ToString() + " LeftAxis:" + m_CameraLeftAxis.ToString() + " UpAxis:" + m_CameraUpAxis.ToString() + " Far:" + m_CameraFar); | 609 | //MainLog.Instance.Verbose("CAMERA", "AtAxis:" + m_CameraAtAxis.ToString() + " Center:" + m_CameraCenter.ToString() + " LeftAxis:" + m_CameraLeftAxis.ToString() + " UpAxis:" + m_CameraUpAxis.ToString() + " Far:" + m_CameraFar); |
610 | 610 | ||
611 | 611 | ||
612 | if ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) | 612 | if ((flags & (uint) AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) |
613 | { | 613 | { |
614 | StandUp(); | 614 | StandUp(); |
615 | } | 615 | } |
@@ -630,7 +630,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
630 | Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); | 630 | Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); |
631 | bool oldflying = PhysicsActor.Flying; | 631 | bool oldflying = PhysicsActor.Flying; |
632 | 632 | ||
633 | PhysicsActor.Flying = ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0); | 633 | PhysicsActor.Flying = ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); |
634 | if (PhysicsActor.Flying != oldflying) | 634 | if (PhysicsActor.Flying != oldflying) |
635 | { | 635 | { |
636 | update_movementflag = true; | 636 | update_movementflag = true; |
@@ -796,7 +796,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
796 | } | 796 | } |
797 | else | 797 | else |
798 | { | 798 | { |
799 | if (((m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && | 799 | if (((m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && |
800 | PhysicsActor.IsColliding) | 800 | PhysicsActor.IsColliding) |
801 | { | 801 | { |
802 | SendAnimPack(Animations.AnimsLLUUID["CROUCHWALK"], 1); | 802 | SendAnimPack(Animations.AnimsLLUUID["CROUCHWALK"], 1); |
@@ -807,7 +807,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
807 | { | 807 | { |
808 | SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1); | 808 | SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1); |
809 | } | 809 | } |
810 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && (m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS) != 0) | 810 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && (m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0) |
811 | { | 811 | { |
812 | SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1); | 812 | SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1); |
813 | } | 813 | } |
@@ -839,7 +839,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
839 | } | 839 | } |
840 | else | 840 | else |
841 | { | 841 | { |
842 | if (((m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && | 842 | if (((m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && |
843 | PhysicsActor.IsColliding) | 843 | PhysicsActor.IsColliding) |
844 | { | 844 | { |
845 | SendAnimPack(Animations.AnimsLLUUID["CROUCH"], 1); | 845 | SendAnimPack(Animations.AnimsLLUUID["CROUCH"], 1); |
@@ -854,7 +854,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
854 | { | 854 | { |
855 | SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1); | 855 | SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1); |
856 | } | 856 | } |
857 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && !m_physicsActor.Flying && (m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS) != 0) | 857 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && !m_physicsActor.Flying && (m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0) |
858 | { | 858 | { |
859 | SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1); | 859 | SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1); |
860 | } | 860 | } |
@@ -955,7 +955,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
955 | m_updateCount = 0; | 955 | m_updateCount = 0; |
956 | } | 956 | } |
957 | } | 957 | } |
958 | else if (lastPhysPos.GetDistanceTo(AbsolutePosition) > 0.02) // physics-related movement | 958 | else if (Util.GetDistanceTo(lastPhysPos, AbsolutePosition) > 0.02) // physics-related movement |
959 | { | 959 | { |
960 | SendTerseUpdateToAllClients(); | 960 | SendTerseUpdateToAllClients(); |
961 | m_updateCount = 0; | 961 | m_updateCount = 0; |
@@ -1123,7 +1123,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1123 | 1123 | ||
1124 | protected void CheckForSignificantMovement() | 1124 | protected void CheckForSignificantMovement() |
1125 | { | 1125 | { |
1126 | if (AbsolutePosition.GetDistanceTo(posLastSignificantMove) > 0.02) | 1126 | if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.02) |
1127 | { | 1127 | { |
1128 | posLastSignificantMove = AbsolutePosition; | 1128 | posLastSignificantMove = AbsolutePosition; |
1129 | if (OnSignificantClientMovement != null) | 1129 | if (OnSignificantClientMovement != null) |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index a3046b0..a9bba3f 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -384,19 +384,19 @@ namespace SimpleApp | |||
384 | } | 384 | } |
385 | if (flyState == 0) | 385 | if (flyState == 0) |
386 | { | 386 | { |
387 | movementFlag = (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY | | 387 | movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY | |
388 | (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG; | 388 | (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG; |
389 | flyState = 1; | 389 | flyState = 1; |
390 | } | 390 | } |
391 | else if (flyState == 1) | 391 | else if (flyState == 1) |
392 | { | 392 | { |
393 | movementFlag = (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY | | 393 | movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY | |
394 | (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS; | 394 | (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; |
395 | flyState = 2; | 395 | flyState = 2; |
396 | } | 396 | } |
397 | else | 397 | else |
398 | { | 398 | { |
399 | movementFlag = (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY; | 399 | movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
400 | flyState = 0; | 400 | flyState = 0; |
401 | } | 401 | } |
402 | 402 | ||