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.
parent
ec48a2f32b
commit
e8779cd9e5
|
@ -343,13 +343,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// </summary>
|
||||
protected Vector3 m_lastCameraPosition;
|
||||
|
||||
protected Vector3 m_CameraPosition;
|
||||
|
||||
public Vector3 CameraPosition
|
||||
{
|
||||
get { return m_CameraPosition; }
|
||||
private set { m_CameraPosition = value; }
|
||||
}
|
||||
public Vector3 CameraPosition { get; set; }
|
||||
|
||||
public Quaternion CameraRotation
|
||||
{
|
||||
|
@ -359,28 +353,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// Use these three vectors to figure out what the agent is looking at
|
||||
// Convert it to a Matrix and/or Quaternion
|
||||
//
|
||||
protected Vector3 m_CameraAtAxis;
|
||||
protected Vector3 m_CameraLeftAxis;
|
||||
protected Vector3 m_CameraUpAxis;
|
||||
|
||||
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 CameraAtAxis { get; set; }
|
||||
public Vector3 CameraLeftAxis { get; set; }
|
||||
public Vector3 CameraUpAxis { get; set; }
|
||||
|
||||
public Vector3 Lookat
|
||||
{
|
||||
|
@ -396,33 +371,15 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
#endregion
|
||||
|
||||
public readonly string Firstname;
|
||||
public readonly string Lastname;
|
||||
public string Firstname { get; private set; }
|
||||
public string Lastname { get; private set; }
|
||||
|
||||
private string m_grouptitle;
|
||||
|
||||
public string Grouptitle
|
||||
{
|
||||
get { return m_grouptitle; }
|
||||
set { m_grouptitle = value; }
|
||||
}
|
||||
public string Grouptitle { get; set; }
|
||||
|
||||
// Agent's Draw distance.
|
||||
protected float m_DrawDistance;
|
||||
public float DrawDistance { get; set; }
|
||||
|
||||
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; }
|
||||
}
|
||||
public bool AllowMovement { get; set; }
|
||||
|
||||
private bool m_setAlwaysRun;
|
||||
|
||||
|
@ -449,13 +406,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
private byte m_state;
|
||||
|
||||
public byte State
|
||||
{
|
||||
get { return m_state; }
|
||||
set { m_state = value; }
|
||||
}
|
||||
public byte State { get; set; }
|
||||
|
||||
private AgentManager.ControlFlags m_AgentControlFlags;
|
||||
|
||||
|
@ -465,29 +416,14 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
set { m_AgentControlFlags = (AgentManager.ControlFlags)value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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 IClientAPI ControllingClient { get; set; }
|
||||
|
||||
public IClientCore ClientView
|
||||
{
|
||||
get { return (IClientCore) m_controllingClient; }
|
||||
get { return (IClientCore)ControllingClient; }
|
||||
}
|
||||
|
||||
protected Vector3 m_parentPosition;
|
||||
|
||||
public Vector3 ParentPosition
|
||||
{
|
||||
get { return m_parentPosition; }
|
||||
set { m_parentPosition = value; }
|
||||
}
|
||||
public Vector3 ParentPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Position of this avatar relative to the region the avatar is in
|
||||
|
@ -826,17 +762,17 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
private Vector3[] GetWalkDirectionVectors()
|
||||
{
|
||||
Vector3[] vector = new Vector3[11];
|
||||
vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD
|
||||
vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK
|
||||
vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD
|
||||
vector[1] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK
|
||||
vector[2] = Vector3.UnitY; //LEFT
|
||||
vector[3] = -Vector3.UnitY; //RIGHT
|
||||
vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP
|
||||
vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN
|
||||
vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE
|
||||
vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE
|
||||
vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP
|
||||
vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN
|
||||
vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE
|
||||
vector[7] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK_NUDGE
|
||||
vector[8] = Vector3.UnitY; //LEFT_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;
|
||||
}
|
||||
|
||||
|
@ -1333,7 +1269,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// Convert it to a Matrix and/or Quaternion
|
||||
CameraAtAxis = agentData.CameraAtAxis;
|
||||
CameraLeftAxis = agentData.CameraLeftAxis;
|
||||
m_CameraUpAxis = agentData.CameraUpAxis;
|
||||
CameraUpAxis = agentData.CameraUpAxis;
|
||||
|
||||
// The Agent's Draw distance setting
|
||||
// When we get to the point of re-computing neighbors everytime this
|
||||
|
@ -1345,7 +1281,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// Check if Client has camera in 'follow cam' or 'build' mode.
|
||||
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;
|
||||
|
||||
m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0;
|
||||
|
@ -3078,7 +3014,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
cAgent.Center = CameraPosition;
|
||||
cAgent.AtAxis = CameraAtAxis;
|
||||
cAgent.LeftAxis = CameraLeftAxis;
|
||||
cAgent.UpAxis = m_CameraUpAxis;
|
||||
cAgent.UpAxis = CameraUpAxis;
|
||||
|
||||
cAgent.Far = DrawDistance;
|
||||
|
||||
|
@ -3164,7 +3100,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
CameraPosition = cAgent.Center;
|
||||
CameraAtAxis = cAgent.AtAxis;
|
||||
CameraLeftAxis = cAgent.LeftAxis;
|
||||
m_CameraUpAxis = cAgent.UpAxis;
|
||||
CameraUpAxis = cAgent.UpAxis;
|
||||
|
||||
// When we get to the point of re-computing neighbors everytime this
|
||||
// changes, then start using the agent's drawdistance rather than the
|
||||
|
|
Loading…
Reference in New Issue