From c33b29a105c2491f7c2e9f6747499ea7213ed4a5 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 29 Jul 2007 06:23:07 +0000 Subject: * Applying issue#230 - Avatar stuck at region edge (Thanks Babblefrog!) * Fix for issue #237 - Sim startup cannot read a terrain file (Reported by CutterRubio) --- .../BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 62 ++++++++++------------ 1 file changed, 28 insertions(+), 34 deletions(-) (limited to 'OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs') diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index 81e2ea3..4d0699b 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs @@ -99,49 +99,43 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin { foreach (BasicActor actor in _actors) { - if ((actor.Position.Y > 0 && actor.Position.Y < 256) && (actor.Position.X > 0 && actor.Position.X < 256)) - { - float height = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 1.2f; - actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep); - actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep); - if (actor.Flying) + float height = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 1.2f; + actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep); + actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep); + if (actor.Flying) { - if (actor.Position.Z + (actor.Velocity.Z * timeStep) < - _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 2) - { - actor.Position.Z = height; - actor.Velocity.Z = 0; - } - else - { - actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); - } - } - else + if (actor.Position.Z + (actor.Velocity.Z * timeStep) < _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 2) { actor.Position.Z = height; actor.Velocity.Z = 0; } + else + { + actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); + } } else { - if (actor.Position.Y < 0) - { - actor.Position.Y = 0; - } - else if (actor.Position.Y > 256) - { - actor.Position.Y = 256; - } + actor.Position.Z = height; + actor.Velocity.Z = 0; + } - if (actor.Position.X < 0) - { - actor.Position.X = 0; - } - if (actor.Position.X > 256) - { - actor.Position.X = 256; - } + if (actor.Position.Y < 0) + { + actor.Position.Y = 0; + } + else if (actor.Position.Y > 256) + { + actor.Position.Y = 256; + } + + if (actor.Position.X < 0) + { + actor.Position.X = 0; + } + if (actor.Position.X > 256) + { + actor.Position.X = 256; } } } -- cgit v1.1