diff options
author | Adam Frisby | 2007-07-29 06:23:07 +0000 |
---|---|---|
committer | Adam Frisby | 2007-07-29 06:23:07 +0000 |
commit | c33b29a105c2491f7c2e9f6747499ea7213ed4a5 (patch) | |
tree | acea08f555b31e0827acbcf8c46a9738a9b3a0f0 | |
parent | * Applying issue#238 - Console help is incomplete. (Thanks CutterRubio) (diff) | |
download | opensim-SC-c33b29a105c2491f7c2e9f6747499ea7213ed4a5.zip opensim-SC-c33b29a105c2491f7c2e9f6747499ea7213ed4a5.tar.gz opensim-SC-c33b29a105c2491f7c2e9f6747499ea7213ed4a5.tar.bz2 opensim-SC-c33b29a105c2491f7c2e9f6747499ea7213ed4a5.tar.xz |
* Applying issue#230 - Avatar stuck at region edge (Thanks Babblefrog!)
* Fix for issue #237 - Sim startup cannot read a terrain file (Reported by CutterRubio)
-rw-r--r-- | OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 62 | ||||
-rw-r--r-- | OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs | 2 |
2 files changed, 29 insertions, 35 deletions
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 | |||
99 | { | 99 | { |
100 | foreach (BasicActor actor in _actors) | 100 | foreach (BasicActor actor in _actors) |
101 | { | 101 | { |
102 | if ((actor.Position.Y > 0 && actor.Position.Y < 256) && (actor.Position.X > 0 && actor.Position.X < 256)) | 102 | float height = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 1.2f; |
103 | { | 103 | actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep); |
104 | float height = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 1.2f; | 104 | actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep); |
105 | actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep); | 105 | if (actor.Flying) |
106 | actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep); | ||
107 | if (actor.Flying) | ||
108 | { | 106 | { |
109 | if (actor.Position.Z + (actor.Velocity.Z * timeStep) < | 107 | if (actor.Position.Z + (actor.Velocity.Z * timeStep) < _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 2) |
110 | _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 2) | ||
111 | { | ||
112 | actor.Position.Z = height; | ||
113 | actor.Velocity.Z = 0; | ||
114 | } | ||
115 | else | ||
116 | { | ||
117 | actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); | ||
118 | } | ||
119 | } | ||
120 | else | ||
121 | { | 108 | { |
122 | actor.Position.Z = height; | 109 | actor.Position.Z = height; |
123 | actor.Velocity.Z = 0; | 110 | actor.Velocity.Z = 0; |
124 | } | 111 | } |
112 | else | ||
113 | { | ||
114 | actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); | ||
115 | } | ||
125 | } | 116 | } |
126 | else | 117 | else |
127 | { | 118 | { |
128 | if (actor.Position.Y < 0) | 119 | actor.Position.Z = height; |
129 | { | 120 | actor.Velocity.Z = 0; |
130 | actor.Position.Y = 0; | 121 | } |
131 | } | ||
132 | else if (actor.Position.Y > 256) | ||
133 | { | ||
134 | actor.Position.Y = 256; | ||
135 | } | ||
136 | 122 | ||
137 | if (actor.Position.X < 0) | 123 | if (actor.Position.Y < 0) |
138 | { | 124 | { |
139 | actor.Position.X = 0; | 125 | actor.Position.Y = 0; |
140 | } | 126 | } |
141 | if (actor.Position.X > 256) | 127 | else if (actor.Position.Y > 256) |
142 | { | 128 | { |
143 | actor.Position.X = 256; | 129 | actor.Position.Y = 256; |
144 | } | 130 | } |
131 | |||
132 | if (actor.Position.X < 0) | ||
133 | { | ||
134 | actor.Position.X = 0; | ||
135 | } | ||
136 | if (actor.Position.X > 256) | ||
137 | { | ||
138 | actor.Position.X = 256; | ||
145 | } | 139 | } |
146 | } | 140 | } |
147 | } | 141 | } |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs index f52d25a..f37d625 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs | |||
@@ -1010,7 +1010,7 @@ namespace OpenSim.Region.Terrain | |||
1010 | for (int y = 0; y < copy.h; y++) | 1010 | for (int y = 0; y < copy.h; y++) |
1011 | { | 1011 | { |
1012 | // 512 is the largest possible height before colours clamp | 1012 | // 512 is the largest possible height before colours clamp |
1013 | int colorindex = (int)(Math.Max(Math.Min(1.0, copy.Get(copy.h - y, x) / 512.0), 0.0) * pallete); | 1013 | int colorindex = (int)(Math.Max(Math.Min(1.0, copy.Get(copy.h - y, x) / 512.0), 0.0) * (pallete - 1)); |
1014 | bmp.SetPixel(x, y, colours[colorindex]); | 1014 | bmp.SetPixel(x, y, colours[colorindex]); |
1015 | } | 1015 | } |
1016 | } | 1016 | } |