aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorlbsa712007-09-21 04:58:40 +0000
committerlbsa712007-09-21 04:58:40 +0000
commitb9808f831428876ec9ede8ce87a159566b97a850 (patch)
tree749ef670d6c4e6051a844d4c9c12073bebfe1e59 /OpenSim/Region/Environment/Scenes/ScenePresence.cs
parent* Continuing refactoring of presence (diff)
downloadopensim-SC-b9808f831428876ec9ede8ce87a159566b97a850.zip
opensim-SC-b9808f831428876ec9ede8ce87a159566b97a850.tar.gz
opensim-SC-b9808f831428876ec9ede8ce87a159566b97a850.tar.bz2
opensim-SC-b9808f831428876ec9ede8ce87a159566b97a850.tar.xz
* First example of moving stuff to a Region layer
* Also, changed RegionPresence to 'RegionSubscription' - let's just see where we land with this...
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs34
1 files changed, 12 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 23e1035..41e555a 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -69,8 +69,6 @@ namespace OpenSim.Region.Environment.Scenes
69 private readonly Vector3[] Dir_Vectors = new Vector3[6]; 69 private readonly Vector3[] Dir_Vectors = new Vector3[6];
70 private LLVector3 lastPhysPos = new LLVector3(); 70 private LLVector3 lastPhysPos = new LLVector3();
71 71
72 private RegionPresence m_regionPresence;
73
74 private enum Dir_ControlFlags 72 private enum Dir_ControlFlags
75 { 73 {
76 DIR_CONTROL_FLAG_FOWARD = MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS, 74 DIR_CONTROL_FLAG_FOWARD = MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS,
@@ -216,6 +214,13 @@ namespace OpenSim.Region.Environment.Scenes
216 set { m_isChildAgent = value; } 214 set { m_isChildAgent = value; }
217 } 215 }
218 216
217 private RegionSubscription m_regionSubscription;
218
219 public RegionSubscription RegionSubscription
220 {
221 get { return m_regionSubscription; }
222 }
223
219 #endregion 224 #endregion
220 225
221 #region Constructor(s) 226 #region Constructor(s)
@@ -229,7 +234,7 @@ namespace OpenSim.Region.Environment.Scenes
229 /// <param name="regionDat"></param> 234 /// <param name="regionDat"></param>
230 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) 235 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo)
231 { 236 {
232 m_regionPresence = new RegionPresence( client ); 237 m_regionSubscription = new RegionSubscription( client );
233 238
234 m_scene = world; 239 m_scene = world;
235 m_uuid = client.AgentId; 240 m_uuid = client.AgentId;
@@ -331,21 +336,6 @@ namespace OpenSim.Region.Environment.Scenes
331 336
332 #region Status Methods 337 #region Status Methods
333 338
334 /// <summary>
335 /// Not Used, most likely can be deleted
336 /// </summary>
337 /// <param name="status"></param>
338 public void ChildStatusChange(bool status)
339 {
340 m_isChildAgent = status;
341
342 if (m_isChildAgent == true)
343 {
344 Velocity = new LLVector3(0, 0, 0);
345 AbsolutePosition = new LLVector3(128, 128, 70);
346 }
347 }
348
349 public void MakeAvatarPhysical(LLVector3 pos, bool isFlying) 339 public void MakeAvatarPhysical(LLVector3 pos, bool isFlying)
350 { 340 {
351 newAvatar = true; 341 newAvatar = true;
@@ -425,7 +415,9 @@ namespace OpenSim.Region.Environment.Scenes
425 { 415 {
426 look = new LLVector3(0.99f, 0.042f, 0); 416 look = new LLVector3(0.99f, 0.042f, 0);
427 } 417 }
418
428 m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look); 419 m_controllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look);
420
429 if (m_isChildAgent) 421 if (m_isChildAgent)
430 { 422 {
431 m_isChildAgent = false; 423 m_isChildAgent = false;
@@ -434,10 +426,6 @@ namespace OpenSim.Region.Environment.Scenes
434 } 426 }
435 } 427 }
436 428
437 /// <summary>
438 ///
439 /// </summary>
440 /// <param name="pack"></param>
441 public void HandleAgentUpdate(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation) 429 public void HandleAgentUpdate(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation)
442 { 430 {
443 if (m_isChildAgent) 431 if (m_isChildAgent)
@@ -445,6 +433,7 @@ namespace OpenSim.Region.Environment.Scenes
445 Console.WriteLine("DEBUG: HandleAgentUpdate: child agent"); 433 Console.WriteLine("DEBUG: HandleAgentUpdate: child agent");
446 return; 434 return;
447 } 435 }
436
448 if(PhysicsActor==null) { 437 if(PhysicsActor==null) {
449 Console.WriteLine("DEBUG: HandleAgentUpdate: null PhysicsActor!"); 438 Console.WriteLine("DEBUG: HandleAgentUpdate: null PhysicsActor!");
450 return; 439 return;
@@ -526,6 +515,7 @@ namespace OpenSim.Region.Environment.Scenes
526 Console.WriteLine("DEBUG: AddNewMovement: child agent"); 515 Console.WriteLine("DEBUG: AddNewMovement: child agent");
527 return; 516 return;
528 } 517 }
518
529 NewForce newVelocity = new NewForce(); 519 NewForce newVelocity = new NewForce();
530 Vector3 direc = rotation*vec; 520 Vector3 direc = rotation*vec;
531 direc.Normalize(); 521 direc.Normalize();