diff options
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs index 8244f02..d7e800d 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs | |||
@@ -96,7 +96,7 @@ public sealed class BSTerrainMesh : BSTerrainPhys | |||
96 | { | 96 | { |
97 | // DISASTER!! | 97 | // DISASTER!! |
98 | PhysicsScene.DetailLog("{0},BSTerrainMesh.create,failedCreationOfShape", ID); | 98 | PhysicsScene.DetailLog("{0},BSTerrainMesh.create,failedCreationOfShape", ID); |
99 | physicsScene.Logger.ErrorFormat("{0} Failed creation of terrain mesh! base={1}", LogHeader, TerrainBase); | 99 | PhysicsScene.Logger.ErrorFormat("{0} Failed creation of terrain mesh! base={1}", LogHeader, TerrainBase); |
100 | // Something is very messed up and a crash is in our future. | 100 | // Something is very messed up and a crash is in our future. |
101 | return; | 101 | return; |
102 | } | 102 | } |
@@ -108,7 +108,7 @@ public sealed class BSTerrainMesh : BSTerrainPhys | |||
108 | if (!m_terrainBody.HasPhysicalBody) | 108 | if (!m_terrainBody.HasPhysicalBody) |
109 | { | 109 | { |
110 | // DISASTER!! | 110 | // DISASTER!! |
111 | physicsScene.Logger.ErrorFormat("{0} Failed creation of terrain body! base={1}", LogHeader, TerrainBase); | 111 | PhysicsScene.Logger.ErrorFormat("{0} Failed creation of terrain body! base={1}", LogHeader, TerrainBase); |
112 | // Something is very messed up and a crash is in our future. | 112 | // Something is very messed up and a crash is in our future. |
113 | return; | 113 | return; |
114 | } | 114 | } |
@@ -131,6 +131,12 @@ public sealed class BSTerrainMesh : BSTerrainPhys | |||
131 | m_terrainBody.collisionType = CollisionType.Terrain; | 131 | m_terrainBody.collisionType = CollisionType.Terrain; |
132 | m_terrainBody.ApplyCollisionMask(PhysicsScene); | 132 | m_terrainBody.ApplyCollisionMask(PhysicsScene); |
133 | 133 | ||
134 | if (BSParam.UseSingleSidedMeshes) | ||
135 | { | ||
136 | PhysicsScene.DetailLog("{0},BSTerrainMesh.settingCustomMaterial", id); | ||
137 | PhysicsScene.PE.AddToCollisionFlags(m_terrainBody, CollisionFlags.CF_CUSTOM_MATERIAL_CALLBACK); | ||
138 | } | ||
139 | |||
134 | // Make it so the terrain will not move or be considered for movement. | 140 | // Make it so the terrain will not move or be considered for movement. |
135 | PhysicsScene.PE.ForceActivationState(m_terrainBody, ActivationState.DISABLE_SIMULATION); | 141 | PhysicsScene.PE.ForceActivationState(m_terrainBody, ActivationState.DISABLE_SIMULATION); |
136 | } | 142 | } |
@@ -176,8 +182,7 @@ public sealed class BSTerrainMesh : BSTerrainPhys | |||
176 | 182 | ||
177 | // Convert the passed heightmap to mesh information suitable for CreateMeshShape2(). | 183 | // Convert the passed heightmap to mesh information suitable for CreateMeshShape2(). |
178 | // Return 'true' if successfully created. | 184 | // Return 'true' if successfully created. |
179 | public static bool ConvertHeightmapToMesh( | 185 | public static bool ConvertHeightmapToMesh( BSScene physicsScene, |
180 | BSScene physicsScene, | ||
181 | float[] heightMap, int sizeX, int sizeY, // parameters of incoming heightmap | 186 | float[] heightMap, int sizeX, int sizeY, // parameters of incoming heightmap |
182 | float extentX, float extentY, // zero based range for output vertices | 187 | float extentX, float extentY, // zero based range for output vertices |
183 | Vector3 extentBase, // base to be added to all vertices | 188 | Vector3 extentBase, // base to be added to all vertices |