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 PhysicsVector m_rotationalVelocity = PhysicsVector.Zero;
private bool flying; private bool flying;
private bool iscolliding; private bool iscolliding;
public BasicActor() public BasicActor()
{ {
_velocity = new PhysicsVector(); _velocity = new PhysicsVector();

View File

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

View File

@ -43,7 +43,7 @@ namespace OpenSim.Region.Physics.POSPlugin
private PhysicsVector _acceleration; private PhysicsVector _acceleration;
private PhysicsVector m_rotationalVelocity = PhysicsVector.Zero; private PhysicsVector m_rotationalVelocity = PhysicsVector.Zero;
private bool flying; private bool flying;
private bool iscolliding; private bool isColliding;
public POSCharacter() public POSCharacter()
{ {
@ -116,8 +116,8 @@ namespace OpenSim.Region.Physics.POSPlugin
public override bool IsColliding public override bool IsColliding
{ {
get { return iscolliding; } get { return isColliding; }
set { iscolliding = value; } set { isColliding = value; }
} }
public override bool CollidingGround 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); 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); 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)) || 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.Y) < (p.Size.Y*0.5 + Math.Abs(avatarSize.Y)) &&
Math.Abs(rotatedPos.Z) >= (p.Size.Z*0.5 + Math.Abs(avatarSize.Z))) Math.Abs(rotatedPos.Z) < (p.Size.Z*0.5 + Math.Abs(avatarSize.Z)));
{
return false;
}
return true;
} }
private bool isCollidingWithPrim(POSCharacter c) 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; return true;
} }