Formatting cleanup, minor refactoring.

remotes/origin/0.6.7-post-fixes
Jeff Ames 2009-08-26 12:58:37 +09:00
parent 5f794d3e59
commit 256624566f
4 changed files with 9 additions and 16 deletions

View File

@ -43,6 +43,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
private PhysicsVector m_rotationalVelocity = PhysicsVector.Zero;
private bool flying;
private bool iscolliding;
public BasicActor()
{
_velocity = new PhysicsVector();

View File

@ -1025,7 +1025,6 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
if (flying)
{
vec.Z = (_target_velocity.Z - vel.Z) * (PID_D);
@ -1044,7 +1043,6 @@ namespace OpenSim.Region.Physics.OdePlugin
vec.Z += (target_altitude - _position.Z) * PID_P * 5.0f;
}
// end add Kitto Flora
}
if (PhysicsVector.isFinite(vec))
{
@ -1080,8 +1078,6 @@ namespace OpenSim.Region.Physics.OdePlugin
_parent_scene.geom_name_map.Remove(Shell);
Shell = IntPtr.Zero;
}
return;
}
}

View File

@ -43,7 +43,7 @@ namespace OpenSim.Region.Physics.POSPlugin
private PhysicsVector _acceleration;
private PhysicsVector m_rotationalVelocity = PhysicsVector.Zero;
private bool flying;
private bool iscolliding;
private bool isColliding;
public POSCharacter()
{
@ -116,8 +116,8 @@ namespace OpenSim.Region.Physics.POSPlugin
public override bool IsColliding
{
get { return iscolliding; }
set { iscolliding = value; }
get { return isColliding; }
set { isColliding = value; }
}
public override bool CollidingGround

View File

@ -113,20 +113,16 @@ namespace OpenSim.Region.Physics.POSPlugin
c.Position.Z - p.Position.Z) * Quaternion.Inverse(p.Orientation);
Vector3 avatarSize = new Vector3(c.Size.X, c.Size.Y, c.Size.Z) * Quaternion.Inverse(p.Orientation);
if (Math.Abs(rotatedPos.X) >= (p.Size.X*0.5 + Math.Abs(avatarSize.X)) ||
Math.Abs(rotatedPos.Y) >= (p.Size.Y*0.5 + Math.Abs(avatarSize.Y)) ||
Math.Abs(rotatedPos.Z) >= (p.Size.Z*0.5 + Math.Abs(avatarSize.Z)))
{
return false;
}
return true;
return (Math.Abs(rotatedPos.X) < (p.Size.X*0.5 + Math.Abs(avatarSize.X)) &&
Math.Abs(rotatedPos.Y) < (p.Size.Y*0.5 + Math.Abs(avatarSize.Y)) &&
Math.Abs(rotatedPos.Z) < (p.Size.Z*0.5 + Math.Abs(avatarSize.Z)));
}
private bool isCollidingWithPrim(POSCharacter c)
{
for (int i = 0; i < _prims.Count; ++i)
foreach (POSPrim p in _prims)
{
if (isColliding(c, _prims[i]))
if (isColliding(c, p))
{
return true;
}