In ScenePresence, removed several private variables used to store public parameters. They were only used by the get/set and make code harder to refactor.

xassetservice
Dan Lake 2012-03-01 19:22:05 -08:00
parent ec48a2f32b
commit e8779cd9e5
1 changed files with 44 additions and 108 deletions

View File

@ -341,15 +341,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary> /// <summary>
/// Position of agent's camera in world (region cordinates) /// Position of agent's camera in world (region cordinates)
/// </summary> /// </summary>
protected Vector3 m_lastCameraPosition; protected Vector3 m_lastCameraPosition;
protected Vector3 m_CameraPosition; public Vector3 CameraPosition { get; set; }
public Vector3 CameraPosition
{
get { return m_CameraPosition; }
private set { m_CameraPosition = value; }
}
public Quaternion CameraRotation public Quaternion CameraRotation
{ {
@ -358,29 +352,10 @@ namespace OpenSim.Region.Framework.Scenes
// Use these three vectors to figure out what the agent is looking at // Use these three vectors to figure out what the agent is looking at
// Convert it to a Matrix and/or Quaternion // Convert it to a Matrix and/or Quaternion
// //
protected Vector3 m_CameraAtAxis; public Vector3 CameraAtAxis { get; set; }
protected Vector3 m_CameraLeftAxis; public Vector3 CameraLeftAxis { get; set; }
protected Vector3 m_CameraUpAxis; public Vector3 CameraUpAxis { get; set; }
public Vector3 CameraAtAxis
{
get { return m_CameraAtAxis; }
private set { m_CameraAtAxis = value; }
}
public Vector3 CameraLeftAxis
{
get { return m_CameraLeftAxis; }
private set { m_CameraLeftAxis = value; }
}
public Vector3 CameraUpAxis
{
get { return m_CameraUpAxis; }
private set { m_CameraUpAxis = value; }
}
public Vector3 Lookat public Vector3 Lookat
{ {
@ -396,33 +371,15 @@ namespace OpenSim.Region.Framework.Scenes
} }
#endregion #endregion
public readonly string Firstname; public string Firstname { get; private set; }
public readonly string Lastname; public string Lastname { get; private set; }
public string Grouptitle { get; set; }
private string m_grouptitle; // Agent's Draw distance.
public float DrawDistance { get; set; }
public string Grouptitle
{ public bool AllowMovement { get; set; }
get { return m_grouptitle; }
set { m_grouptitle = value; }
}
// Agent's Draw distance.
protected float m_DrawDistance;
public float DrawDistance
{
get { return m_DrawDistance; }
private set { m_DrawDistance = value; }
}
protected bool m_allowMovement = true;
public bool AllowMovement
{
get { return m_allowMovement; }
set { m_allowMovement = value; }
}
private bool m_setAlwaysRun; private bool m_setAlwaysRun;
@ -447,15 +404,9 @@ namespace OpenSim.Region.Framework.Scenes
PhysicsActor.SetAlwaysRun = value; PhysicsActor.SetAlwaysRun = value;
} }
} }
} }
private byte m_state; public byte State { get; set; }
public byte State
{
get { return m_state; }
set { m_state = value; }
}
private AgentManager.ControlFlags m_AgentControlFlags; private AgentManager.ControlFlags m_AgentControlFlags;
@ -463,31 +414,16 @@ namespace OpenSim.Region.Framework.Scenes
{ {
get { return (uint)m_AgentControlFlags; } get { return (uint)m_AgentControlFlags; }
set { m_AgentControlFlags = (AgentManager.ControlFlags)value; } set { m_AgentControlFlags = (AgentManager.ControlFlags)value; }
} }
/// <summary> public IClientAPI ControllingClient { get; set; }
/// This works out to be the ClientView object associated with this avatar, or it's client connection manager
/// </summary>
private IClientAPI m_controllingClient;
public IClientAPI ControllingClient
{
get { return m_controllingClient; }
private set { m_controllingClient = value; }
}
public IClientCore ClientView public IClientCore ClientView
{ {
get { return (IClientCore) m_controllingClient; } get { return (IClientCore)ControllingClient; }
} }
protected Vector3 m_parentPosition; public Vector3 ParentPosition { get; set; }
public Vector3 ParentPosition
{
get { return m_parentPosition; }
set { m_parentPosition = value; }
}
/// <summary> /// <summary>
/// Position of this avatar relative to the region the avatar is in /// Position of this avatar relative to the region the avatar is in
@ -825,18 +761,18 @@ namespace OpenSim.Region.Framework.Scenes
private Vector3[] GetWalkDirectionVectors() private Vector3[] GetWalkDirectionVectors()
{ {
Vector3[] vector = new Vector3[11]; Vector3[] vector = new Vector3[11];
vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD
vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK vector[1] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK
vector[2] = Vector3.UnitY; //LEFT vector[2] = Vector3.UnitY; //LEFT
vector[3] = -Vector3.UnitY; //RIGHT vector[3] = -Vector3.UnitY; //RIGHT
vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP
vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN
vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE
vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE vector[7] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK_NUDGE
vector[8] = Vector3.UnitY; //LEFT_NUDGE vector[8] = Vector3.UnitY; //LEFT_NUDGE
vector[9] = -Vector3.UnitY; //RIGHT_NUDGE vector[9] = -Vector3.UnitY; //RIGHT_NUDGE
vector[10] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_NUDGE vector[10] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN_NUDGE
return vector; return vector;
} }
@ -1333,7 +1269,7 @@ namespace OpenSim.Region.Framework.Scenes
// Convert it to a Matrix and/or Quaternion // Convert it to a Matrix and/or Quaternion
CameraAtAxis = agentData.CameraAtAxis; CameraAtAxis = agentData.CameraAtAxis;
CameraLeftAxis = agentData.CameraLeftAxis; CameraLeftAxis = agentData.CameraLeftAxis;
m_CameraUpAxis = agentData.CameraUpAxis; CameraUpAxis = agentData.CameraUpAxis;
// The Agent's Draw distance setting // The Agent's Draw distance setting
// When we get to the point of re-computing neighbors everytime this // When we get to the point of re-computing neighbors everytime this
@ -1343,9 +1279,9 @@ namespace OpenSim.Region.Framework.Scenes
DrawDistance = Scene.DefaultDrawDistance; DrawDistance = Scene.DefaultDrawDistance;
// Check if Client has camera in 'follow cam' or 'build' mode. // Check if Client has camera in 'follow cam' or 'build' mode.
Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation); Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation);
m_followCamAuto = ((m_CameraUpAxis.Z > 0.959f && m_CameraUpAxis.Z < 0.98f) m_followCamAuto = ((CameraUpAxis.Z > 0.959f && CameraUpAxis.Z < 0.98f)
&& (Math.Abs(camdif.X) < 0.4f && Math.Abs(camdif.Y) < 0.4f)) ? true : false; && (Math.Abs(camdif.X) < 0.4f && Math.Abs(camdif.Y) < 0.4f)) ? true : false;
m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0; m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0;
@ -3077,8 +3013,8 @@ namespace OpenSim.Region.Framework.Scenes
cAgent.Velocity = m_velocity; cAgent.Velocity = m_velocity;
cAgent.Center = CameraPosition; cAgent.Center = CameraPosition;
cAgent.AtAxis = CameraAtAxis; cAgent.AtAxis = CameraAtAxis;
cAgent.LeftAxis = CameraLeftAxis; cAgent.LeftAxis = CameraLeftAxis;
cAgent.UpAxis = m_CameraUpAxis; cAgent.UpAxis = CameraUpAxis;
cAgent.Far = DrawDistance; cAgent.Far = DrawDistance;
@ -3163,8 +3099,8 @@ namespace OpenSim.Region.Framework.Scenes
m_velocity = cAgent.Velocity; m_velocity = cAgent.Velocity;
CameraPosition = cAgent.Center; CameraPosition = cAgent.Center;
CameraAtAxis = cAgent.AtAxis; CameraAtAxis = cAgent.AtAxis;
CameraLeftAxis = cAgent.LeftAxis; CameraLeftAxis = cAgent.LeftAxis;
m_CameraUpAxis = cAgent.UpAxis; CameraUpAxis = cAgent.UpAxis;
// When we get to the point of re-computing neighbors everytime this // When we get to the point of re-computing neighbors everytime this
// changes, then start using the agent's drawdistance rather than the // changes, then start using the agent's drawdistance rather than the