aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-24 20:36:16 +0000
committerJustin Clark-Casey (justincc)2012-01-24 20:36:16 +0000
commita704d444f2f1a4887598cd9eb2f59c0b4c595f2b (patch)
tree066a47464322b9e73687f60d8308e34efbb45568 /OpenSim/Framework
parentRestrict accessible of ODECharacter Shell and Body. Add method doc and some ... (diff)
parentTeleport routing, part 1 (diff)
downloadopensim-SC_OLD-a704d444f2f1a4887598cd9eb2f59c0b4c595f2b.zip
opensim-SC_OLD-a704d444f2f1a4887598cd9eb2f59c0b4c595f2b.tar.gz
opensim-SC_OLD-a704d444f2f1a4887598cd9eb2f59c0b4c595f2b.tar.bz2
opensim-SC_OLD-a704d444f2f1a4887598cd9eb2f59c0b4c595f2b.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/IClientAPI.cs5
-rw-r--r--OpenSim/Framework/RegionSettings.cs86
2 files changed, 91 insertions, 0 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 29a69c3..1326fe9 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -358,6 +358,8 @@ namespace OpenSim.Framework
358 358
359 public delegate void EstateChangeInfo(IClientAPI client, UUID invoice, UUID senderID, UInt32 param1, UInt32 param2); 359 public delegate void EstateChangeInfo(IClientAPI client, UUID invoice, UUID senderID, UInt32 param1, UInt32 param2);
360 360
361 public delegate void EstateManageTelehub(IClientAPI client, UUID invoice, UUID senderID, string cmd, UInt32 param1);
362
361 public delegate void RequestTerrain(IClientAPI remoteClient, string clientFileName); 363 public delegate void RequestTerrain(IClientAPI remoteClient, string clientFileName);
362 364
363 public delegate void BakeTerrain(IClientAPI remoteClient); 365 public delegate void BakeTerrain(IClientAPI remoteClient);
@@ -769,6 +771,7 @@ namespace OpenSim.Framework
769 event ModifyTerrain OnModifyTerrain; 771 event ModifyTerrain OnModifyTerrain;
770 event BakeTerrain OnBakeTerrain; 772 event BakeTerrain OnBakeTerrain;
771 event EstateChangeInfo OnEstateChangeInfo; 773 event EstateChangeInfo OnEstateChangeInfo;
774 event EstateManageTelehub OnEstateManageTelehub;
772 // [Obsolete("LLClientView Specific.")] 775 // [Obsolete("LLClientView Specific.")]
773 event SetAppearance OnSetAppearance; 776 event SetAppearance OnSetAppearance;
774 // [Obsolete("LLClientView Specific - Replace and rename OnAvatarUpdate. Difference from SetAppearance?")] 777 // [Obsolete("LLClientView Specific - Replace and rename OnAvatarUpdate. Difference from SetAppearance?")]
@@ -1141,6 +1144,8 @@ namespace OpenSim.Framework
1141 1144
1142 void SendTaskInventory(UUID taskID, short serial, byte[] fileName); 1145 void SendTaskInventory(UUID taskID, short serial, byte[] fileName);
1143 1146
1147 void SendTelehubInfo(UUID ObjectID, string ObjectName, Vector3 ObjectPos, Quaternion ObjectRot, List<Vector3> SpawnPoint);
1148
1144 /// <summary> 1149 /// <summary>
1145 /// Used by the server to inform the client of new inventory items and folders. 1150 /// Used by the server to inform the client of new inventory items and folders.
1146 /// </summary> 1151 /// </summary>
diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs
index 673cf20..e115432 100644
--- a/OpenSim/Framework/RegionSettings.cs
+++ b/OpenSim/Framework/RegionSettings.cs
@@ -26,11 +26,53 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using System.IO; 30using System.IO;
30using OpenMetaverse; 31using OpenMetaverse;
31 32
32namespace OpenSim.Framework 33namespace OpenSim.Framework
33{ 34{
35 public struct SpawnPoint
36 {
37 public float Yaw;
38 public float Pitch;
39 public float Distance;
40
41 public void SetLocation(Vector3 pos, Quaternion rot, Vector3 point)
42 {
43 // The point is an absolute position, so we need the relative
44 // location to the spawn point
45 Vector3 offset = point - pos;
46 Distance = Vector3.Mag(offset);
47
48 // Next we need to rotate this vector into the spawn point's
49 // coordinate system
50 rot.W = -rot.W;
51 offset = offset * rot;
52
53 Vector3 dir = Vector3.Normalize(offset);
54
55 // Get the bearing (yaw)
56 Yaw = (float)Math.Atan2(dir.Y, dir.X);
57
58 // Get the elevation (pitch)
59 Pitch = (float)-Math.Atan2(dir.Z, Math.Sqrt(dir.X * dir.X + dir.Y * dir.Y));
60 }
61
62 public Vector3 GetLocation(Vector3 pos, Quaternion rot)
63 {
64 Quaternion y = Quaternion.CreateFromEulers(0, 0, Yaw);
65 Quaternion p = Quaternion.CreateFromEulers(0, Pitch, 0);
66
67 Vector3 dir = new Vector3(1, 0, 0) * p * y;
68 Vector3 offset = dir * (float)Distance;
69
70 offset *= rot;
71
72 return pos + offset;
73 }
74 }
75
34 public class RegionSettings 76 public class RegionSettings
35 { 77 {
36 public delegate void SaveDelegate(RegionSettings rs); 78 public delegate void SaveDelegate(RegionSettings rs);
@@ -397,5 +439,49 @@ namespace OpenSim.Framework
397 set { m_LoadedCreationID = value; } 439 set { m_LoadedCreationID = value; }
398 } 440 }
399 441
442 // Connected Telehub object
443 private UUID m_TelehubObject;
444 public UUID TelehubObject
445 {
446 get
447 {
448 return m_TelehubObject;
449 }
450 set
451 {
452 m_TelehubObject = value;
453 }
454 }
455
456 // Our Connected Telehub's SpawnPoints
457 public List<SpawnPoint> l_SpawnPoints = new List<SpawnPoint>();
458
459 // Add a SpawnPoint
460 // ** These are not region coordinates **
461 // They are relative to the Telehub coordinates
462 //
463 public void AddSpawnPoint(SpawnPoint point)
464 {
465 l_SpawnPoints.Add(point);
466 }
467
468 // Remove a SpawnPoint
469 public void RemoveSpawnPoint(int point_index)
470 {
471 l_SpawnPoints.RemoveAt(point_index);
472 }
473
474 // Return the List of SpawnPoints
475 public List<SpawnPoint> SpawnPoints()
476 {
477 return l_SpawnPoints;
478
479 }
480
481 // Clear the SpawnPoints List of all entries
482 public void ClearSpawnPoints()
483 {
484 l_SpawnPoints.Clear();
485 }
400 } 486 }
401} 487}