mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 19:36:07 +08:00
Revolution is on the roll again! :)
Fixes: Undo, T-pose of others on login, modifiedBulletX works again, feet now stand on the ground instead of in the ground, adds checks to CombatModule. Adds: Redo, Land Undo, checks to agentUpdate (so one can not fall off of a region), more vehicle parts. Finishes almost all of LSL (1 function left, 2 events). Direct flames and kudos to Revolution, please Signed-off-by: Melanie <melanie@t-data.com>
This commit is contained in:
@@ -164,6 +164,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
private Quaternion m_bodyRot= Quaternion.Identity;
|
||||
|
||||
private Quaternion m_bodyRotPrevious = Quaternion.Identity;
|
||||
|
||||
private const int LAND_VELOCITYMAG_MAX = 12;
|
||||
|
||||
public bool IsRestrictedToRegion;
|
||||
@@ -508,6 +510,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
set { m_bodyRot = value; }
|
||||
}
|
||||
|
||||
public Quaternion PreviousRotation
|
||||
{
|
||||
get { return m_bodyRotPrevious; }
|
||||
set { m_bodyRotPrevious = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If this is true, agent doesn't have a representation in this scene.
|
||||
/// this is an agent 'looking into' this scene from a nearby scene(region)
|
||||
@@ -824,6 +832,31 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (pos.X < 0 || pos.Y < 0 || pos.Z < 0)
|
||||
{
|
||||
Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128);
|
||||
|
||||
if (pos.X < 0)
|
||||
{
|
||||
emergencyPos.X = (int)Constants.RegionSize + pos.X;
|
||||
if (!(pos.Y < 0))
|
||||
emergencyPos.Y = pos.Y;
|
||||
if (!(pos.Z < 0))
|
||||
emergencyPos.X = pos.X;
|
||||
}
|
||||
if (pos.Y < 0)
|
||||
{
|
||||
emergencyPos.Y = (int)Constants.RegionSize + pos.Y;
|
||||
if (!(pos.X < 0))
|
||||
emergencyPos.X = pos.X;
|
||||
if (!(pos.Z < 0))
|
||||
emergencyPos.Z = pos.Z;
|
||||
}
|
||||
if (pos.Z < 0)
|
||||
{
|
||||
if (!(pos.X < 0))
|
||||
emergencyPos.X = pos.X;
|
||||
if (!(pos.Y < 0))
|
||||
emergencyPos.Y = pos.Y;
|
||||
//Leave as 128
|
||||
}
|
||||
|
||||
m_log.WarnFormat(
|
||||
"[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
|
||||
@@ -1193,6 +1226,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_pos.X < 0)
|
||||
m_pos.X = 128;
|
||||
if (m_pos.Y < 0)
|
||||
m_pos.Y = 128;
|
||||
if (m_pos.X > Scene.WestBorders[0].BorderLine.X)
|
||||
m_pos.X = 128;
|
||||
if (m_pos.Y > Scene.NorthBorders[0].BorderLine.Y)
|
||||
m_pos.Y = 128;
|
||||
m_LastFinitePos = m_pos;
|
||||
}
|
||||
|
||||
@@ -2704,36 +2745,72 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
// Checks if where it's headed exists a region
|
||||
|
||||
bool needsTransit = false;
|
||||
if (m_scene.TestBorderCross(pos2, Cardinals.W))
|
||||
{
|
||||
if (m_scene.TestBorderCross(pos2, Cardinals.S))
|
||||
{
|
||||
needsTransit = true;
|
||||
neighbor = HaveNeighbor(Cardinals.SW, ref fix);
|
||||
}
|
||||
else if (m_scene.TestBorderCross(pos2, Cardinals.N))
|
||||
{
|
||||
needsTransit = true;
|
||||
neighbor = HaveNeighbor(Cardinals.NW, ref fix);
|
||||
}
|
||||
else
|
||||
{
|
||||
needsTransit = true;
|
||||
neighbor = HaveNeighbor(Cardinals.W, ref fix);
|
||||
}
|
||||
}
|
||||
else if (m_scene.TestBorderCross(pos2, Cardinals.E))
|
||||
{
|
||||
if (m_scene.TestBorderCross(pos2, Cardinals.S))
|
||||
{
|
||||
needsTransit = true;
|
||||
neighbor = HaveNeighbor(Cardinals.SE, ref fix);
|
||||
}
|
||||
else if (m_scene.TestBorderCross(pos2, Cardinals.N))
|
||||
{
|
||||
needsTransit = true;
|
||||
neighbor = HaveNeighbor(Cardinals.NE, ref fix);
|
||||
}
|
||||
else
|
||||
{
|
||||
needsTransit = true;
|
||||
neighbor = HaveNeighbor(Cardinals.E, ref fix);
|
||||
}
|
||||
}
|
||||
else if (m_scene.TestBorderCross(pos2, Cardinals.S))
|
||||
{
|
||||
needsTransit = true;
|
||||
neighbor = HaveNeighbor(Cardinals.S, ref fix);
|
||||
}
|
||||
else if (m_scene.TestBorderCross(pos2, Cardinals.N))
|
||||
{
|
||||
needsTransit = true;
|
||||
neighbor = HaveNeighbor(Cardinals.N, ref fix);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Makes sure avatar does not end up outside region
|
||||
if (neighbor < 0)
|
||||
AbsolutePosition = new Vector3(
|
||||
AbsolutePosition.X + 3*fix[0],
|
||||
AbsolutePosition.Y + 3*fix[1],
|
||||
AbsolutePosition.Z);
|
||||
if (neighbor <= 0)
|
||||
{
|
||||
if (!needsTransit)
|
||||
{
|
||||
Vector3 pos = AbsolutePosition;
|
||||
if (AbsolutePosition.X < 0)
|
||||
pos.X += Velocity.Y;
|
||||
else if (AbsolutePosition.X > Constants.RegionSize)
|
||||
pos.X -= Velocity.Y;
|
||||
if (AbsolutePosition.Y < 0)
|
||||
pos.Y += Velocity.Y;
|
||||
else if (AbsolutePosition.Y > Constants.RegionSize)
|
||||
pos.Y -= Velocity.Y;
|
||||
AbsolutePosition = pos;
|
||||
}
|
||||
}
|
||||
else if (neighbor > 0)
|
||||
CrossToNewRegion();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user