29 using System.Collections.Generic;
32 using System.Runtime.Serialization;
34 namespace OpenSim.Framework
42 public void SetLocation(Vector3 pos, Quaternion rot, Vector3 point)
46 Vector3 offset = point - pos;
47 Distance = Vector3.Mag(offset);
52 offset = offset * rot;
54 Vector3 dir = Vector3.Normalize(offset);
57 Yaw = (float)Math.Atan2(dir.Y, dir.X);
60 Pitch = (float)-Math.Atan2(dir.Z, Math.Sqrt(dir.X * dir.X + dir.Y * dir.Y));
65 Quaternion y = Quaternion.CreateFromEulers(0, 0, Yaw);
66 Quaternion p = Quaternion.CreateFromEulers(0, Pitch, 0);
68 Vector3 dir =
new Vector3(1, 0, 0) * p * y;
69 Vector3 offset = dir * (float)Distance;
82 return string.Format(
"{0},{1},{2}", Yaw, Pitch, Distance);
91 string[] parts = str.Split(
',');
92 if (parts.Length != 3)
93 throw new ArgumentException(
"Invalid string: " + str);
96 sp.Yaw = float.Parse(parts[0]);
97 sp.Pitch = float.Parse(parts[1]);
98 sp.Distance = float.Parse(parts[2]);
112 public static readonly UUID DEFAULT_TERRAIN_TEXTURE_1 =
new UUID(
"b8d3965a-ad78-bf43-699b-bff8eca6c975");
113 public static readonly UUID DEFAULT_TERRAIN_TEXTURE_2 =
new UUID(
"abb783e6-3e93-26c0-248a-247666855da3");
114 public static readonly UUID DEFAULT_TERRAIN_TEXTURE_3 =
new UUID(
"179cdabd-398a-9b6b-1391-4dc333ba321f");
115 public static readonly UUID DEFAULT_TERRAIN_TEXTURE_4 =
new UUID(
"beb169c7-11ea-fff2-efe5-0f24dc881df2");
123 private UUID m_RegionUUID = UUID.Zero;
125 public UUID RegionUUID
127 get {
return m_RegionUUID; }
128 set { m_RegionUUID = value; }
131 private bool m_BlockTerraform =
false;
133 public bool BlockTerraform
135 get {
return m_BlockTerraform; }
136 set { m_BlockTerraform = value; }
139 private bool m_BlockFly =
false;
143 get {
return m_BlockFly; }
144 set { m_BlockFly = value; }
147 private bool m_AllowDamage =
false;
149 public bool AllowDamage
151 get {
return m_AllowDamage; }
152 set { m_AllowDamage = value; }
155 private bool m_RestrictPushing =
false;
157 public bool RestrictPushing
159 get {
return m_RestrictPushing; }
160 set { m_RestrictPushing = value; }
163 private bool m_AllowLandResell =
true;
165 public bool AllowLandResell
167 get {
return m_AllowLandResell; }
168 set { m_AllowLandResell = value; }
171 private bool m_AllowLandJoinDivide =
true;
173 public bool AllowLandJoinDivide
175 get {
return m_AllowLandJoinDivide; }
176 set { m_AllowLandJoinDivide = value; }
179 private bool m_BlockShowInSearch =
false;
181 public bool BlockShowInSearch
183 get {
return m_BlockShowInSearch; }
184 set { m_BlockShowInSearch = value; }
187 private int m_AgentLimit = 40;
189 public int AgentLimit
191 get {
return m_AgentLimit; }
192 set { m_AgentLimit = value; }
195 private double m_ObjectBonus = 1.0;
197 public double ObjectBonus
199 get {
return m_ObjectBonus; }
200 set { m_ObjectBonus = value; }
203 private int m_Maturity = 0;
207 get {
return m_Maturity; }
208 set { m_Maturity = value; }
211 private bool m_DisableScripts =
false;
213 public bool DisableScripts
215 get {
return m_DisableScripts; }
216 set { m_DisableScripts = value; }
219 private bool m_DisableCollisions =
false;
221 public bool DisableCollisions
223 get {
return m_DisableCollisions; }
224 set { m_DisableCollisions = value; }
227 private bool m_DisablePhysics =
false;
229 public bool DisablePhysics
231 get {
return m_DisablePhysics; }
232 set { m_DisablePhysics = value; }
235 private UUID m_TerrainTexture1 = UUID.Zero;
237 public UUID TerrainTexture1
239 get {
return m_TerrainTexture1; }
242 if (value == UUID.Zero)
243 m_TerrainTexture1 = DEFAULT_TERRAIN_TEXTURE_1;
245 m_TerrainTexture1 = value;
249 private UUID m_TerrainTexture2 = UUID.Zero;
251 public UUID TerrainTexture2
253 get {
return m_TerrainTexture2; }
256 if (value == UUID.Zero)
257 m_TerrainTexture2 = DEFAULT_TERRAIN_TEXTURE_2;
259 m_TerrainTexture2 = value;
263 private UUID m_TerrainTexture3 = UUID.Zero;
265 public UUID TerrainTexture3
267 get {
return m_TerrainTexture3; }
270 if (value == UUID.Zero)
271 m_TerrainTexture3 = DEFAULT_TERRAIN_TEXTURE_3;
273 m_TerrainTexture3 = value;
277 private UUID m_TerrainTexture4 = UUID.Zero;
279 public UUID TerrainTexture4
281 get {
return m_TerrainTexture4; }
284 if (value == UUID.Zero)
285 m_TerrainTexture4 = DEFAULT_TERRAIN_TEXTURE_4;
287 m_TerrainTexture4 = value;
291 private double m_Elevation1NW = 10;
293 public double Elevation1NW
295 get {
return m_Elevation1NW; }
296 set { m_Elevation1NW = value; }
299 private double m_Elevation2NW = 60;
301 public double Elevation2NW
303 get {
return m_Elevation2NW; }
304 set { m_Elevation2NW = value; }
307 private double m_Elevation1NE = 10;
309 public double Elevation1NE
311 get {
return m_Elevation1NE; }
312 set { m_Elevation1NE = value; }
315 private double m_Elevation2NE = 60;
317 public double Elevation2NE
319 get {
return m_Elevation2NE; }
320 set { m_Elevation2NE = value; }
323 private double m_Elevation1SE = 10;
325 public double Elevation1SE
327 get {
return m_Elevation1SE; }
328 set { m_Elevation1SE = value; }
331 private double m_Elevation2SE = 60;
333 public double Elevation2SE
335 get {
return m_Elevation2SE; }
336 set { m_Elevation2SE = value; }
339 private double m_Elevation1SW = 10;
341 public double Elevation1SW
343 get {
return m_Elevation1SW; }
344 set { m_Elevation1SW = value; }
347 private double m_Elevation2SW = 60;
349 public double Elevation2SW
351 get {
return m_Elevation2SW; }
352 set { m_Elevation2SW = value; }
355 private double m_WaterHeight = 20;
357 public double WaterHeight
359 get {
return m_WaterHeight; }
360 set { m_WaterHeight = value; }
363 private double m_TerrainRaiseLimit = 100;
365 public double TerrainRaiseLimit
367 get {
return m_TerrainRaiseLimit; }
368 set { m_TerrainRaiseLimit = value; }
371 private double m_TerrainLowerLimit = -100;
373 public double TerrainLowerLimit
375 get {
return m_TerrainLowerLimit; }
376 set { m_TerrainLowerLimit = value; }
379 private bool m_UseEstateSun =
true;
381 public bool UseEstateSun
383 get {
return m_UseEstateSun; }
384 set { m_UseEstateSun = value; }
387 private bool m_Sandbox =
false;
391 get {
return m_Sandbox; }
392 set { m_Sandbox = value; }
395 private Vector3 m_SunVector;
397 public Vector3 SunVector
399 get {
return m_SunVector; }
400 set { m_SunVector = value; }
403 private UUID m_ParcelImageID;
405 public UUID ParcelImageID
407 get {
return m_ParcelImageID; }
408 set { m_ParcelImageID = value; }
411 private UUID m_TerrainImageID;
413 public UUID TerrainImageID
415 get {
return m_TerrainImageID; }
416 set { m_TerrainImageID = value; }
419 private bool m_FixedSun =
false;
423 get {
return m_FixedSun; }
424 set { m_FixedSun = value; }
427 private double m_SunPosition = 0.0;
429 public double SunPosition
431 get {
return m_SunPosition; }
432 set { m_SunPosition = value; }
435 private UUID m_Covenant = UUID.Zero;
439 get {
return m_Covenant; }
440 set { m_Covenant = value; }
443 private int m_CovenantChanged = 0;
445 public int CovenantChangedDateTime
447 get {
return m_CovenantChanged; }
448 set { m_CovenantChanged = value; }
451 private int m_LoadedCreationDateTime;
452 public int LoadedCreationDateTime
454 get {
return m_LoadedCreationDateTime; }
455 set { m_LoadedCreationDateTime = value; }
458 public String LoadedCreationDate
462 TimeSpan ts =
new TimeSpan(0, 0, LoadedCreationDateTime);
463 DateTime stamp =
new DateTime(1970, 1, 1) + ts;
464 return stamp.ToLongDateString();
468 public String LoadedCreationTime
472 TimeSpan ts =
new TimeSpan(0, 0, LoadedCreationDateTime);
473 DateTime stamp =
new DateTime(1970, 1, 1) + ts;
474 return stamp.ToLongTimeString();
478 private String m_LoadedCreationID;
479 public String LoadedCreationID
481 get {
return m_LoadedCreationID; }
482 set { m_LoadedCreationID = value; }
485 private bool m_GodBlockSearch =
false;
486 public bool GodBlockSearch
488 get {
return m_GodBlockSearch; }
489 set { m_GodBlockSearch = value; }
492 private bool m_Casino =
false;
495 get {
return m_Casino; }
496 set { m_Casino = value; }
500 private bool m_TelehubEnabled =
false;
501 public bool HasTelehub
503 get {
return m_TelehubEnabled; }
504 set { m_TelehubEnabled = value; }
510 public UUID TelehubObject {
get; set; }
515 public List<SpawnPoint> l_SpawnPoints =
new List<SpawnPoint>();
523 l_SpawnPoints.Add(point);
529 l_SpawnPoints.RemoveAt(point_index);
535 return l_SpawnPoints;
542 l_SpawnPoints.Clear();
void RemoveSpawnPoint(int point_index)
static SpawnPoint Parse(string str)
Generate a SpawnPoint from a string
void SetLocation(Vector3 pos, Quaternion rot, Vector3 point)
void AddSpawnPoint(SpawnPoint point)
Vector3 GetLocation(Vector3 pos, Quaternion rot)
override string ToString()
Returns a string representation of this SpawnPoint.
List< SpawnPoint > SpawnPoints()