diff options
author | Justin Clark-Casey (justincc) | 2011-08-03 23:06:18 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-03 23:06:18 +0100 |
commit | 21d8a6b0e8f1480a5ac75ae4e76d01d4ae2fb13f (patch) | |
tree | ae6c73a8df0edc046c7af858db7e47ddd7682cfc /OpenSim/Region/Physics/BasicPhysicsPlugin | |
parent | Add passing but incomplete NPC move regression test (diff) | |
download | opensim-SC-21d8a6b0e8f1480a5ac75ae4e76d01d4ae2fb13f.zip opensim-SC-21d8a6b0e8f1480a5ac75ae4e76d01d4ae2fb13f.tar.gz opensim-SC-21d8a6b0e8f1480a5ac75ae4e76d01d4ae2fb13f.tar.bz2 opensim-SC-21d8a6b0e8f1480a5ac75ae4e76d01d4ae2fb13f.tar.xz |
extend move test to check one beat of the simulator without actually asking the npc to move.
Diffstat (limited to 'OpenSim/Region/Physics/BasicPhysicsPlugin')
-rw-r--r-- | OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs index 6c9d9ab..1ceed1a 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs | |||
@@ -123,11 +123,15 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
123 | actorPosition.X = ((int)Constants.RegionSize - 0.1f); | 123 | actorPosition.X = ((int)Constants.RegionSize - 0.1f); |
124 | } | 124 | } |
125 | 125 | ||
126 | float height = _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + actor.Size.Z; | 126 | float terrainHeight = 0; |
127 | if (_heightMap != null) | ||
128 | terrainHeight = _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X]; | ||
129 | |||
130 | float height = terrainHeight + actor.Size.Z; | ||
131 | |||
127 | if (actor.Flying) | 132 | if (actor.Flying) |
128 | { | 133 | { |
129 | if (actor.Position.Z + (actor.Velocity.Z*timeStep) < | 134 | if (actor.Position.Z + (actor.Velocity.Z * timeStep) < terrainHeight + 2) |
130 | _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + 2) | ||
131 | { | 135 | { |
132 | actorPosition.Z = height; | 136 | actorPosition.Z = height; |
133 | actorVelocity.Z = 0; | 137 | actorVelocity.Z = 0; |
@@ -135,7 +139,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
135 | } | 139 | } |
136 | else | 140 | else |
137 | { | 141 | { |
138 | actorPosition.Z += actor.Velocity.Z*timeStep; | 142 | actorPosition.Z += actor.Velocity.Z * timeStep; |
139 | actor.IsColliding = false; | 143 | actor.IsColliding = false; |
140 | } | 144 | } |
141 | } | 145 | } |