aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs')
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs36
1 files changed, 32 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
index cf7c1d7..b5b30ee 100644
--- a/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
@@ -1736,6 +1736,23 @@ namespace OpenSim.Region.Physics.OdePlugin
1736 return newPrim; 1736 return newPrim;
1737 } 1737 }
1738 1738
1739 private PhysicsActor AddPrim(String name, Vector3 position, PhysicsActor parent,
1740 PrimitiveBaseShape pbs, uint localid, byte[] sdata)
1741 {
1742 Vector3 pos = position;
1743
1744 OdePrim newPrim;
1745 lock (OdeLock)
1746 {
1747 newPrim = new OdePrim(name, this, pos, parent, pbs, ode, localid, sdata);
1748 lock (_prims)
1749 _prims.Add(newPrim);
1750 }
1751
1752 return newPrim;
1753 }
1754
1755
1739 public void addActivePrim(OdePrim activatePrim) 1756 public void addActivePrim(OdePrim activatePrim)
1740 { 1757 {
1741 // adds active prim.. (ones that should be iterated over in collisions_optimized 1758 // adds active prim.. (ones that should be iterated over in collisions_optimized
@@ -1762,6 +1779,17 @@ namespace OpenSim.Region.Physics.OdePlugin
1762 return result; 1779 return result;
1763 } 1780 }
1764 1781
1782 public override PhysicsActor AddPrimShape(string primName, PhysicsActor parent, PrimitiveBaseShape pbs, Vector3 position,
1783 uint localid, byte[] sdata)
1784 {
1785 PhysicsActor result;
1786
1787 result = AddPrim(primName, position, parent,
1788 pbs, localid, sdata);
1789
1790 return result;
1791 }
1792
1765 public override float TimeDilation 1793 public override float TimeDilation
1766 { 1794 {
1767 get { return m_timeDilation; } 1795 get { return m_timeDilation; }
@@ -3412,15 +3440,15 @@ namespace OpenSim.Region.Physics.OdePlugin
3412 3440
3413 int regionsize = (int) Constants.RegionSize; // visible region size eg. 256(M) 3441 int regionsize = (int) Constants.RegionSize; // visible region size eg. 256(M)
3414 3442
3415 int heightmapWidth = regionsize + 2; // ODE map size 257 x 257 (Meters) (1 extra 3443 int heightmapWidth = regionsize + 2; // ODE map size 258 x 258 (Meters) (1 extra each side)
3416 int heightmapHeight = regionsize + 2; 3444 int heightmapHeight = regionsize + 2;
3417 3445
3418 int heightmapWidthSamples = (int)regionsize + 2; // Sample file size, 258 x 258 samples 3446 int heightmapWidthSamples = (int)regionsize + 3; // to have 258m we need 259 samples
3419 int heightmapHeightSamples = (int)regionsize + 2; 3447 int heightmapHeightSamples = (int)regionsize + 3;
3420 3448
3421 // Array of height samples for ODE 3449 // Array of height samples for ODE
3422 float[] _heightmap; 3450 float[] _heightmap;
3423 _heightmap = new float[(heightmapWidthSamples * heightmapHeightSamples)]; // loaded samples 258 x 258 3451 _heightmap = new float[(heightmapWidthSamples * heightmapHeightSamples)]; // loaded samples 259 x 259
3424 3452
3425 // Other ODE parameters 3453 // Other ODE parameters
3426 const float scale = 1.0f; 3454 const float scale = 1.0f;