* This update includes a wide range of changes to the ODEPlugin for avatar movement, including:

** - avatar can navigate stairs better now
** - avatar can land without shooting into the air
** - excessive collisions with the ground are tempered somewhat and should only shoot the avatar up 20m instead of 200m
** - Try Catched a TextureDownloadModule.cs array out of bounds error with a report that causes it not to crash the sim, however it reports a few important items for tracking it down.
afrisby
Teravus Ovares 2007-12-26 17:16:47 +00:00
parent b7170215ba
commit f852b64555
5 changed files with 86 additions and 43 deletions

View File

@ -319,7 +319,15 @@ namespace OpenSim.Region.Environment.Modules
int size = m_asset.Data.Length - 600 - (1000 * (PacketCounter - 1));
if (size > 1000) size = 1000;
im.ImageData.Data = new byte[size];
try
{
Array.Copy(m_asset.Data, 600 + (1000 * (PacketCounter - 1)), im.ImageData.Data, 0, size);
}
catch (System.ArgumentOutOfRangeException)
{
OpenSim.Framework.Console.MainLog.Instance.Warn("TEXTURE", "Unable to separate texture into multiple packets: Array bounds failure on asset:" + m_asset.FullID.ToString() + "- TextureDownloadModule.cs. line:328");
return;
}
RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
PacketCounter++;
}

View File

@ -999,17 +999,17 @@ namespace OpenSim.Region.Environment.Scenes
if (m_physicsActor.Flying)
{
direc *= 4;
bool controlland = (((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || ((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0));
bool colliding = (m_physicsActor.IsColliding==true);
if (controlland)
MainLog.Instance.Verbose("AGENT","landCommand");
if (colliding )
MainLog.Instance.Verbose("AGENT","colliding");
if (m_physicsActor.Flying && colliding && controlland)
{
StopFlying();
MainLog.Instance.Verbose("AGENT", "Stop FLying");
}
//bool controlland = (((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || ((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0));
//bool colliding = (m_physicsActor.IsColliding==true);
//if (controlland)
// MainLog.Instance.Verbose("AGENT","landCommand");
//if (colliding )
// MainLog.Instance.Verbose("AGENT","colliding");
//if (m_physicsActor.Flying && colliding && controlland)
//{
// StopFlying();
// MainLog.Instance.Verbose("AGENT", "Stop FLying");
//}
}
else
{

View File

@ -111,22 +111,22 @@ namespace OpenSim.Region.Physics.OdePlugin
Amotor = d.JointCreateAMotor(parent_scene.world, IntPtr.Zero);
d.JointAttach(Amotor, Body, IntPtr.Zero);
d.JointSetAMotorMode(Amotor, dAMotorEuler);
d.JointSetAMotorNumAxes(Amotor, 3);
d.JointSetAMotorAxis(Amotor, 0, 0, 1, 0, 0);
d.JointSetAMotorAxis(Amotor, 1, 0, 0, 1, 0);
d.JointSetAMotorAxis(Amotor, 2, 0, 0, 0, 1);
d.JointSetAMotorAngle(Amotor, 0, 0);
d.JointSetAMotorAngle(Amotor, 1, 0);
d.JointSetAMotorAngle(Amotor, 2, 0);
d.JointSetAMotorParam(Amotor, 0, -0);
d.JointSetAMotorParam(Amotor, 0x200, -0);
d.JointSetAMotorParam(Amotor, 0x100, -0);
d.JointSetAMotorParam(Amotor, 0, 0);
d.JointSetAMotorParam(Amotor, 3, 0);
d.JointSetAMotorParam(Amotor, 2, 0);
//Amotor = d.JointCreateAMotor(parent_scene.world, IntPtr.Zero);
//d.JointAttach(Amotor, Body, IntPtr.Zero);
//d.JointSetAMotorMode(Amotor, dAMotorEuler);
//d.JointSetAMotorNumAxes(Amotor, 3);
//d.JointSetAMotorAxis(Amotor, 0, 0, 1, 0, 0);
//d.JointSetAMotorAxis(Amotor, 1, 0, 0, 1, 0);
///d.JointSetAMotorAxis(Amotor, 2, 0, 0, 0, 1);
//d.JointSetAMotorAngle(Amotor, 0, 0);
//d.JointSetAMotorAngle(Amotor, 1, 0);
//d.JointSetAMotorAngle(Amotor, 2, 0);
//d.JointSetAMotorParam(Amotor, 0, -0);
//d.JointSetAMotorParam(Amotor, 0x200, -0);
//d.JointSetAMotorParam(Amotor, 0x100, -0);
// d.JointSetAMotorParam(Amotor, 0, 0);
// d.JointSetAMotorParam(Amotor, 3, 0);
// d.JointSetAMotorParam(Amotor, 2, 0);
@ -269,7 +269,10 @@ namespace OpenSim.Region.Physics.OdePlugin
m_pidControllerActive = true;
}
}
public void SetPidStatus(bool status)
{
m_pidControllerActive = status;
}
public override PhysicsVector Position
{
get { return _position; }
@ -583,7 +586,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{
lock (OdeScene.OdeLock)
{
d.JointDestroy(Amotor);
// d.JointDestroy(Amotor);
d.GeomDestroy(Shell);
_parent_scene.geom_name_map.Remove(Shell);
d.BodyDestroy(Body);

View File

@ -375,14 +375,6 @@ namespace OpenSim.Region.Physics.OdePlugin
{
string primScenAvatarIn = _parent_scene.whichspaceamIin(_position);
int[] arrayitem = _parent_scene.calculateSpaceArrayItemFromPos(_position);
if (primScenAvatarIn == "0")
{
MainLog.Instance.Verbose("Physics", "Prim " + m_primName + " in space with no prim: " + primScenAvatarIn + ". Expected to be at: " + m_targetSpace.ToString() + " . Arr:': " + arrayitem[0].ToString() + "," + arrayitem[1].ToString());
}
else
{
MainLog.Instance.Verbose("Physics", "Prim " + m_primName + " in Prim space with prim: " + primScenAvatarIn + ". Expected to be at: " + m_targetSpace.ToString() + ". Arr:" + arrayitem[0].ToString() + "," + arrayitem[1].ToString());
}
m_targetSpace = _parent_scene.recalculateSpaceForGeom(prim_geom, _position, m_targetSpace);
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
d.SpaceAdd(m_targetSpace, prim_geom);

View File

@ -136,7 +136,7 @@ namespace OpenSim.Region.Physics.OdePlugin
TerrainContact.surface.soft_erp = 0.1025f;
AvatarMovementprimContact.surface.mu = 150.0f;
AvatarMovementprimContact.surface.bounce = 0.2f;
AvatarMovementprimContact.surface.bounce = 0.1f;
AvatarMovementTerrainContact.surface.mode |= d.ContactFlags.SoftERP;
AvatarMovementTerrainContact.surface.mu = 150.0f;
@ -297,7 +297,9 @@ namespace OpenSim.Region.Physics.OdePlugin
{
p2.CollidingObj = true;
//contacts[i].depth = 0.003f;
//p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 2.5f);
p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 2.5f);
OdeCharacter character = (OdeCharacter)p2;
character.SetPidStatus(true);
//contacts[i].pos = new d.Vector3(contacts[i].pos.X + (p1.Size.X / 2), contacts[i].pos.Y + (p1.Size.Y / 2), contacts[i].pos.Z + (p1.Size.Z / 2));
}
@ -309,8 +311,10 @@ namespace OpenSim.Region.Physics.OdePlugin
{
p1.CollidingObj = true;
//contacts[i].depth = 0.003f;
//p1.Velocity = p1.Velocity + new PhysicsVector(0, 0, 2.5f);
p1.Velocity = p1.Velocity + new PhysicsVector(0, 0, 2.5f);
//contacts[i].pos = new d.Vector3(contacts[i].pos.X + (p2.Size.X / 2), contacts[i].pos.Y + (p2.Size.Y / 2), contacts[i].pos.Z + (p2.Size.Z / 2));
OdeCharacter character = (OdeCharacter)p2;
character.SetPidStatus(true);
}
else
{
@ -321,12 +325,48 @@ namespace OpenSim.Region.Physics.OdePlugin
if (p1.PhysicsActorType == (int)ActorTypes.Prim && p2.PhysicsActorType == (int)ActorTypes.Prim)
{
// Don't collide, one or both prim will explode.
contacts[i].depth = 0.0f;
contacts[i].depth = -1f;
}
if (contacts[i].depth >= 1.00f)
{
if ((p2.PhysicsActorType == (int)ActorTypes.Agent && p1.PhysicsActorType == (int)ActorTypes.Unknown) || (p1.PhysicsActorType == (int)ActorTypes.Agent && p2.PhysicsActorType == (int)ActorTypes.Unknown))
{
if (p2.PhysicsActorType == (int)ActorTypes.Agent)
{
OdeCharacter character = (OdeCharacter)p2;
//p2.CollidingObj = true;
contacts[i].depth = 0.003f;
p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 0.5f);
contacts[i].pos = new d.Vector3(contacts[i].pos.X + (p1.Size.X / 2), contacts[i].pos.Y + (p1.Size.Y / 2), contacts[i].pos.Z + (p1.Size.Z / 2));
character.SetPidStatus(true);
}
else
{
}
if (p1.PhysicsActorType == (int)ActorTypes.Agent)
{
OdeCharacter character = (OdeCharacter)p2;
//p2.CollidingObj = true;
contacts[i].depth = 0.003f;
p2.Velocity = p2.Velocity + new PhysicsVector(0, 0, 0.5f);
contacts[i].pos = new d.Vector3(contacts[i].pos.X + (p1.Size.X / 2), contacts[i].pos.Y + (p1.Size.Y / 2), contacts[i].pos.Z + (p1.Size.Z / 2));
character.SetPidStatus(true);
}
else
{
//contacts[i].depth = 0.0000000f;
}
}
}
}
#endregion
if (contacts[i].depth > 0f)
if (contacts[i].depth >= 0f)
{
if (name1 == "Terrain" || name2 == "Terrain")
{