Applied ScenePresence movement patch from Darok.
parent
bee543300f
commit
e1ebfaef63
81
OpenSim.sln
81
OpenSim.sln
|
@ -1,5 +1,5 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
# Visual C# Express 2005
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim", "OpenSim\Region\Application\OpenSim.csproj", "{438A9556-0000-0000-0000-000000000000}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework", "OpenSim\Framework\General\OpenSim.Framework.csproj", "{8ACA2445-0000-0000-0000-000000000000}"
|
||||
|
@ -57,85 +57,6 @@ Global
|
|||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectDependencies) = postSolution
|
||||
({438A9556-0000-0000-0000-000000000000}).3 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).4 = ({CB52B7E7-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).5 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).6 = ({C74E4A30-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).7 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).8 = ({586E2916-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).9 = ({61FCCDB3-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).10 = ({DC3698B2-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).11 = ({BFB5D807-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).12 = ({4806E378-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).13 = ({DCBA491C-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).14 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
({438A9556-0000-0000-0000-000000000000}).15 = ({C9E0F891-0000-0000-0000-000000000000})
|
||||
({8ACA2445-0000-0000-0000-000000000000}).2 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({CB52B7E7-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({CB52B7E7-0000-0000-0000-000000000000}).2 = ({36B72A9B-0000-0000-0000-000000000000})
|
||||
({FD2D303D-0000-0000-0000-000000000000}).2 = ({36B72A9B-0000-0000-0000-000000000000})
|
||||
({C74E4A30-0000-0000-0000-000000000000}).0 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({2CC71860-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({2CC71860-0000-0000-0000-000000000000}).2 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({586E2916-0000-0000-0000-000000000000}).2 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({586E2916-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({586E2916-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000})
|
||||
({586E2916-0000-0000-0000-000000000000}).5 = ({C74E4A30-0000-0000-0000-000000000000})
|
||||
({586E2916-0000-0000-0000-000000000000}).6 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({61FCCDB3-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({39038E85-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({39038E85-0000-0000-0000-000000000000}).2 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({39038E85-0000-0000-0000-000000000000}).3 = ({61FCCDB3-0000-0000-0000-000000000000})
|
||||
({DC3698B2-0000-0000-0000-000000000000}).3 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({DC3698B2-0000-0000-0000-000000000000}).4 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({DC3698B2-0000-0000-0000-000000000000}).5 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({DC3698B2-0000-0000-0000-000000000000}).6 = ({61FCCDB3-0000-0000-0000-000000000000})
|
||||
({DC3698B2-0000-0000-0000-000000000000}).7 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
({DC3698B2-0000-0000-0000-000000000000}).8 = ({C9E0F891-0000-0000-0000-000000000000})
|
||||
({BFB5D807-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({BFB5D807-0000-0000-0000-000000000000}).2 = ({CB52B7E7-0000-0000-0000-000000000000})
|
||||
({BFB5D807-0000-0000-0000-000000000000}).3 = ({36B72A9B-0000-0000-0000-000000000000})
|
||||
({BFB5D807-0000-0000-0000-000000000000}).4 = ({586E2916-0000-0000-0000-000000000000})
|
||||
({4806E378-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({4806E378-0000-0000-0000-000000000000}).2 = ({CB52B7E7-0000-0000-0000-000000000000})
|
||||
({4806E378-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({4806E378-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000})
|
||||
({4806E378-0000-0000-0000-000000000000}).5 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).4 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).5 = ({CB52B7E7-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).6 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).7 = ({C74E4A30-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).8 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).9 = ({61FCCDB3-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).10 = ({39038E85-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).11 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
({DCBA491C-0000-0000-0000-000000000000}).12 = ({C9E0F891-0000-0000-0000-000000000000})
|
||||
({241A8CDD-0000-0000-0000-000000000000}).2 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({241A8CDD-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({98C7B681-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({98C7B681-0000-0000-0000-000000000000}).2 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({15B4FEF3-0000-0000-0000-000000000000}).1 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
({F4FF31EB-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({F4FF31EB-0000-0000-0000-000000000000}).2 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({90620634-0000-0000-0000-000000000000}).2 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
({A6D191D8-0000-0000-0000-000000000000}).1 = ({F4FF31EB-0000-0000-0000-000000000000})
|
||||
({A4691E59-0000-0000-0000-000000000000}).3 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({A4691E59-0000-0000-0000-000000000000}).4 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({43DB702D-0000-0000-0000-000000000000}).2 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({43DB702D-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({477B9270-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({477B9270-0000-0000-0000-000000000000}).2 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).1 = ({8ACA2445-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).2 = ({CB52B7E7-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).4 = ({2CC71860-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).5 = ({61FCCDB3-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).6 = ({DC3698B2-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).7 = ({BFB5D807-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).8 = ({DCBA491C-0000-0000-0000-000000000000})
|
||||
({24B12448-0000-0000-0000-000000000000}).9 = ({241A8CDD-0000-0000-0000-000000000000})
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
|
|
|
@ -73,7 +73,6 @@ namespace OpenSim.Region.Capabilities
|
|||
}
|
||||
else
|
||||
{
|
||||
//Console.WriteLine("LLSD field name" + fields[i].Name + " , " + fields[i].GetValue(obj).GetType());
|
||||
writer.WriteStartElement(String.Empty, "key", String.Empty);
|
||||
writer.WriteString(fields[i].Name);
|
||||
writer.WriteEndElement();
|
||||
|
@ -86,12 +85,15 @@ namespace OpenSim.Region.Capabilities
|
|||
// LLSDArray arrayObject = obj as LLSDArray;
|
||||
// ArrayList a = arrayObject.Array;
|
||||
ArrayList a = (ArrayList)obj.GetType().GetField("Array").GetValue(obj);
|
||||
if (a != null)
|
||||
{
|
||||
writer.WriteStartElement(String.Empty, "array", String.Empty);
|
||||
foreach (object item in a)
|
||||
{
|
||||
SerializeLLSDType(writer, item);
|
||||
}
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,6 +66,17 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
protected RegionInfo m_regionInfo;
|
||||
|
||||
private Vector3[] Dir_Vectors = new Vector3[6];
|
||||
private enum Dir_ControlFlags
|
||||
{
|
||||
DIR_CONTROL_FLAG_FOWARD = MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS,
|
||||
DIR_CONTROL_FLAG_BACK = MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG,
|
||||
DIR_CONTROL_FLAG_LEFT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_POS,
|
||||
DIR_CONTROL_FLAG_RIGHT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_NEG,
|
||||
DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS,
|
||||
DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG
|
||||
}
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -125,6 +136,13 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
// ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
|
||||
//ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
|
||||
|
||||
Dir_Vectors[0] = new Vector3(1, 0, 0); //FOWARD
|
||||
Dir_Vectors[1] = new Vector3(-1, 0, 0); //BACK
|
||||
Dir_Vectors[2] = new Vector3(0, 1, 0); //LEFT
|
||||
Dir_Vectors[3] = new Vector3(0, -1, 0); //RIGHT
|
||||
Dir_Vectors[4] = new Vector3(0, 0, 1); //UP
|
||||
Dir_Vectors[5] = new Vector3(0, 0, -1); //DOWN
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -217,40 +235,47 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// <param name="pack"></param>
|
||||
public void HandleAgentUpdate(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation)
|
||||
{
|
||||
if ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS) != 0)
|
||||
{
|
||||
int i = 0;
|
||||
bool update_movementflag = false;
|
||||
bool update_rotation = false;
|
||||
bool DCFlagKeyPressed = false;
|
||||
Vector3 agent_control_v3 = new Vector3(0, 0, 0);
|
||||
Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z);
|
||||
if (((movementflag & 1) == 0) || (q != this.bodyRot))
|
||||
|
||||
|
||||
// this.PhysActor.Flying = ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0);
|
||||
|
||||
if (q != this.bodyRot)
|
||||
{
|
||||
Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0);
|
||||
this.AddNewMovement(v3, q);
|
||||
movementflag = 1;
|
||||
this.bodyRot = q;
|
||||
update_rotation = true;
|
||||
}
|
||||
}
|
||||
else if ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG) != 0)
|
||||
foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof(Dir_ControlFlags)))
|
||||
{
|
||||
Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z);
|
||||
if (((movementflag & 2) == 0) || (q != this.bodyRot))
|
||||
if ((flags & (uint)DCF) != 0)
|
||||
{
|
||||
Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(-1, 0, 0);
|
||||
this.AddNewMovement(v3, q);
|
||||
movementflag = 2;
|
||||
this.bodyRot = q;
|
||||
DCFlagKeyPressed = true;
|
||||
agent_control_v3 += Dir_Vectors[i];
|
||||
if ((movementflag & (uint)DCF) == 0)
|
||||
{
|
||||
movementflag += (byte)(uint)DCF;
|
||||
update_movementflag = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((movementflag) != 0)
|
||||
if ((movementflag & (uint)DCF) != 0)
|
||||
{
|
||||
NewForce newVelocity = new NewForce();
|
||||
newVelocity.X = 0;
|
||||
newVelocity.Y = 0;
|
||||
newVelocity.Z = 0;
|
||||
this.forcesList.Add(newVelocity);
|
||||
movementflag = 0;
|
||||
movementflag -= (byte)(uint)DCF;
|
||||
update_movementflag = true;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if ((update_movementflag) || (update_rotation && DCFlagKeyPressed))
|
||||
{
|
||||
this.AddNewMovement(agent_control_v3, q);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue