remove a odd floating offset on physical prims/terrain collisions

avinationmerge
UbitUmarov 2015-09-23 01:42:24 +01:00
parent ccfb561e8d
commit 43ca70655f
1 changed files with 8 additions and 15 deletions

View File

@ -2295,21 +2295,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde
// geom_name_map[GroundGeom] = "Terrain"; // geom_name_map[GroundGeom] = "Terrain";
d.Matrix3 R = new d.Matrix3(); d.Quaternion q = new d.Quaternion();
q.X = 0.5f;
q.Y = 0.5f;
q.Z = 0.5f;
q.W = 0.5f;
Quaternion q1 = Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), 1.5707f); d.GeomSetQuaternion(GroundGeom, ref q);
Quaternion q2 = Quaternion.CreateFromAxisAngle(new Vector3(0, 1, 0), 1.5707f); d.GeomSetPosition(GroundGeom, pOffset.X + m_regionWidth * 0.5f, pOffset.Y + m_regionHeight * 0.5f, 0.0f);
q1 = q1 * q2;
Vector3 v3;
float angle;
q1.GetAxisAngle(out v3, out angle);
d.RFromAxisAndAngle(out R, v3.X, v3.Y, v3.Z, angle);
d.GeomSetRotation(GroundGeom, ref R);
d.GeomSetPosition(GroundGeom, pOffset.X + m_regionWidth * 0.5f, pOffset.Y + m_regionHeight * 0.5f, 0);
RegionTerrain.Add(pOffset, GroundGeom); RegionTerrain.Add(pOffset, GroundGeom);
TerrainHeightFieldHeights.Add(GroundGeom, _heightmap); TerrainHeightFieldHeights.Add(GroundGeom, _heightmap);
TerrainHeightFieldHeightsHandlers.Add(GroundGeom, _heightmaphandler); TerrainHeightFieldHeightsHandlers.Add(GroundGeom, _heightmaphandler);
@ -2419,7 +2412,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
// geom_name_map[GroundGeom] = "Terrain"; // geom_name_map[GroundGeom] = "Terrain";
d.GeomSetPosition(GroundGeom, pOffset.X + m_regionWidth * 0.5f, pOffset.Y + m_regionHeight * 0.5f, 0); d.GeomSetPosition(GroundGeom, pOffset.X + m_regionWidth * 0.5f, pOffset.Y + m_regionHeight * 0.5f, 0.0f);
RegionTerrain.Add(pOffset, GroundGeom); RegionTerrain.Add(pOffset, GroundGeom);
TerrainHeightFieldHeights.Add(GroundGeom, _heightmap); TerrainHeightFieldHeights.Add(GroundGeom, _heightmap);
TerrainHeightFieldHeightsHandlers.Add(GroundGeom, _heightmaphandler); TerrainHeightFieldHeightsHandlers.Add(GroundGeom, _heightmaphandler);