aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-08-07 18:40:56 -0400
committerTeravus Ovares (Dan Olivares)2009-08-07 18:40:56 -0400
commitc8a68fb3fbac0d99b53a62bb062232c0d5695d3c (patch)
treebb010e480b095e48cd80fce04305f5e8cd290a3b /OpenSim/Region/Physics/OdePlugin
parentSilly error, simple fix (diff)
downloadopensim-SC-c8a68fb3fbac0d99b53a62bb062232c0d5695d3c.zip
opensim-SC-c8a68fb3fbac0d99b53a62bb062232c0d5695d3c.tar.gz
opensim-SC-c8a68fb3fbac0d99b53a62bb062232c0d5695d3c.tar.bz2
opensim-SC-c8a68fb3fbac0d99b53a62bb062232c0d5695d3c.tar.xz
* Remove hard coded 256 limitations from various places. There's no more 256m limitation within the OpenSimulator framework, however, the LLClient ClientView does not support regions larger then 256 meters so, if you try and make your region larger by setting Constants.RegionSize = 512; in OpenSim.Framework.Constants.cs, the terrain will not display on clients using the LLUDP protocol
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs4
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs47
-rw-r--r--OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs4
3 files changed, 42 insertions, 13 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index b8af77d..b556395 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -1096,8 +1096,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1096 // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!) 1096 // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!)
1097 if (vec.X < 0.0f) vec.X = 0.0f; 1097 if (vec.X < 0.0f) vec.X = 0.0f;
1098 if (vec.Y < 0.0f) vec.Y = 0.0f; 1098 if (vec.Y < 0.0f) vec.Y = 0.0f;
1099 if (vec.X > 255.95f) vec.X = 255.95f; 1099 if (vec.X > (int)Constants.RegionSize - 0.05f) vec.X = (int)Constants.RegionSize - 0.05f;
1100 if (vec.Y > 255.95f) vec.Y = 255.95f; 1100 if (vec.Y > (int)Constants.RegionSize - 0.05f) vec.Y = (int)Constants.RegionSize - 0.05f;
1101 1101
1102 _position.X = vec.X; 1102 _position.X = vec.X;
1103 _position.Y = vec.Y; 1103 _position.Y = vec.Y;
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 9805ff5..50dc91d 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -304,6 +304,13 @@ namespace OpenSim.Region.Physics.OdePlugin
304 public d.Vector3 xyz = new d.Vector3(128.1640f, 128.3079f, 25.7600f); 304 public d.Vector3 xyz = new d.Vector3(128.1640f, 128.3079f, 25.7600f);
305 public d.Vector3 hpr = new d.Vector3(125.5000f, -17.0000f, 0.0000f); 305 public d.Vector3 hpr = new d.Vector3(125.5000f, -17.0000f, 0.0000f);
306 306
307 private uint heightmapWidth = m_regionWidth + 1;
308 private uint heightmapHeight = m_regionHeight + 1;
309
310 private uint heightmapWidthSamples;
311
312 private uint heightmapHeightSamples;
313
307 private volatile int m_global_contactcount = 0; 314 private volatile int m_global_contactcount = 0;
308 315
309 private ODERayCastRequestManager m_rayCastManager; 316 private ODERayCastRequestManager m_rayCastManager;
@@ -3271,27 +3278,49 @@ namespace OpenSim.Region.Physics.OdePlugin
3271 // this._heightmap[i] = (double)heightMap[i]; 3278 // this._heightmap[i] = (double)heightMap[i];
3272 // dbm (danx0r) -- creating a buffer zone of one extra sample all around 3279 // dbm (danx0r) -- creating a buffer zone of one extra sample all around
3273 _origheightmap = heightMap; // Used for Fly height. Kitto Flora 3280 _origheightmap = heightMap; // Used for Fly height. Kitto Flora
3274 const uint heightmapWidth = m_regionWidth + 2; 3281 uint heightmapWidth = m_regionWidth + 1;
3275 const uint heightmapHeight = m_regionHeight + 2; 3282 uint heightmapHeight = m_regionHeight + 1;
3276 const uint heightmapWidthSamples = 2*m_regionWidth + 2; 3283
3277 const uint heightmapHeightSamples = 2*m_regionHeight + 2; 3284 uint heightmapWidthSamples;
3285
3286 uint heightmapHeightSamples;
3287 if (((int)Constants.RegionSize) == 256)
3288 {
3289 heightmapWidthSamples = 2*m_regionWidth + 2;
3290 heightmapHeightSamples = 2*m_regionHeight + 2;
3291 heightmapWidth++;
3292 heightmapHeight++;
3293 }
3294 else
3295 {
3296 heightmapWidthSamples = m_regionWidth + 1;
3297 heightmapHeightSamples = m_regionHeight + 1;
3298 }
3299
3278 const float scale = 1.0f; 3300 const float scale = 1.0f;
3279 const float offset = 0.0f; 3301 const float offset = 0.0f;
3280 const float thickness = 0.2f; 3302 const float thickness = 0.2f;
3281 const int wrap = 0; 3303 const int wrap = 0;
3304
3282 3305
3283 //Double resolution 3306 //Double resolution
3284 heightMap = ResizeTerrain512Interpolation(heightMap); 3307 if (((int)Constants.RegionSize) == 256)
3308 heightMap = ResizeTerrain512Interpolation(heightMap);
3309
3310 int regionsize = (int)Constants.RegionSize;
3311 if (regionsize == 256)
3312 regionsize = 512;
3313
3285 float hfmin = 2000; 3314 float hfmin = 2000;
3286 float hfmax = -2000; 3315 float hfmax = -2000;
3287 for (int x = 0; x < heightmapWidthSamples; x++) 3316 for (int x = 0; x < heightmapWidthSamples; x++)
3288 { 3317 {
3289 for (int y = 0; y < heightmapHeightSamples; y++) 3318 for (int y = 0; y < heightmapHeightSamples; y++)
3290 { 3319 {
3291 int xx = Util.Clip(x - 1, 0, 511); 3320 int xx = Util.Clip(x - 1, 0, regionsize - 1);
3292 int yy = Util.Clip(y - 1, 0, 511); 3321 int yy = Util.Clip(y - 1, 0, regionsize - 1);
3293 3322
3294 float val = heightMap[yy*512 + xx]; 3323 float val = heightMap[yy*regionsize + xx];
3295 _heightmap[x*heightmapHeightSamples + y] = val; 3324 _heightmap[x*heightmapHeightSamples + y] = val;
3296 hfmin = (val < hfmin) ? val : hfmin; 3325 hfmin = (val < hfmin) ? val : hfmin;
3297 hfmax = (val > hfmax) ? val : hfmax; 3326 hfmax = (val > hfmax) ? val : hfmax;
@@ -3332,7 +3361,7 @@ namespace OpenSim.Region.Physics.OdePlugin
3332 3361
3333 d.RFromAxisAndAngle(out R, v3.X, v3.Y, v3.Z, angle); 3362 d.RFromAxisAndAngle(out R, v3.X, v3.Y, v3.Z, angle);
3334 d.GeomSetRotation(LandGeom, ref R); 3363 d.GeomSetRotation(LandGeom, ref R);
3335 d.GeomSetPosition(LandGeom, 128, 128, 0); 3364 d.GeomSetPosition(LandGeom, (int)Constants.RegionSize * 0.5f, (int)Constants.RegionSize * 0.5f, 0);
3336 } 3365 }
3337 } 3366 }
3338 3367
diff --git a/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs
index 7d748fd..b186175 100644
--- a/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs
+++ b/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs
@@ -56,8 +56,8 @@ namespace OpenSim.Region.Physics.OdePlugin
56 ps = cbt.GetScene("test"); 56 ps = cbt.GetScene("test");
57 // Initializing Physics Scene. 57 // Initializing Physics Scene.
58 ps.Initialise(imp.GetMesher(),null); 58 ps.Initialise(imp.GetMesher(),null);
59 float[] _heightmap = new float[256 * 256]; 59 float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize];
60 for (int i = 0; i<(256*256);i++) 60 for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++)
61 { 61 {
62 _heightmap[i] = 21f; 62 _heightmap[i] = 21f;
63 } 63 }