From 2f45134fd552dabcb6b76d4a41a38138be17c8f2 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sun, 20 Nov 2011 12:45:39 +0000 Subject: [PATCH] - fix TerrainPatch recognition in terrain compound generation git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8739 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../bullet/util/CollisionShapeFactory.java | 20 +++++++++---------- .../bullet/util/CollisionShapeFactory.java | 20 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/engine/src/bullet/com/jme3/bullet/util/CollisionShapeFactory.java b/engine/src/bullet/com/jme3/bullet/util/CollisionShapeFactory.java index 76b7ef12c..7357f10dc 100644 --- a/engine/src/bullet/com/jme3/bullet/util/CollisionShapeFactory.java +++ b/engine/src/bullet/com/jme3/bullet/util/CollisionShapeFactory.java @@ -101,6 +101,16 @@ public class CollisionShapeFactory { trans.getRotation().toRotationMatrix()); } else if (spatial instanceof Node) { createCompoundShape(realRootNode, (Node) spatial, shape, meshAccurate, dynamic); + } else if (spatial instanceof TerrainPatch) { + Boolean bool = spatial.getUserData(UserData.JME_PHYSICSIGNORE); + if (bool != null && bool.booleanValue()) { + continue; // go to the next child in the loop + } + TerrainPatch terrain = (TerrainPatch) spatial; + Transform trans = getTransform(spatial, realRootNode); + shape.addChildShape(new HeightfieldCollisionShape(terrain.getHeightMap(), terrain.getLocalScale()), + trans.getTranslation(), + trans.getRotation().toRotationMatrix()); } else if (spatial instanceof Geometry) { Boolean bool = spatial.getUserData(UserData.JME_PHYSICSIGNORE); if (bool != null && bool.booleanValue()) { @@ -123,16 +133,6 @@ public class CollisionShapeFactory { trans.getTranslation(), trans.getRotation().toRotationMatrix()); } - } else if (spatial instanceof TerrainPatch) { - Boolean bool = spatial.getUserData(UserData.JME_PHYSICSIGNORE); - if (bool != null && bool.booleanValue()) { - continue; // go to the next child in the loop - } - TerrainPatch terrain = (TerrainPatch) spatial; - Transform trans = getTransform(spatial, realRootNode); - shape.addChildShape(new HeightfieldCollisionShape(terrain.getHeightMap(), terrain.getLocalScale()), - trans.getTranslation(), - trans.getRotation().toRotationMatrix()); } } return shape; diff --git a/engine/src/jbullet/com/jme3/bullet/util/CollisionShapeFactory.java b/engine/src/jbullet/com/jme3/bullet/util/CollisionShapeFactory.java index 76b7ef12c..7357f10dc 100644 --- a/engine/src/jbullet/com/jme3/bullet/util/CollisionShapeFactory.java +++ b/engine/src/jbullet/com/jme3/bullet/util/CollisionShapeFactory.java @@ -101,6 +101,16 @@ public class CollisionShapeFactory { trans.getRotation().toRotationMatrix()); } else if (spatial instanceof Node) { createCompoundShape(realRootNode, (Node) spatial, shape, meshAccurate, dynamic); + } else if (spatial instanceof TerrainPatch) { + Boolean bool = spatial.getUserData(UserData.JME_PHYSICSIGNORE); + if (bool != null && bool.booleanValue()) { + continue; // go to the next child in the loop + } + TerrainPatch terrain = (TerrainPatch) spatial; + Transform trans = getTransform(spatial, realRootNode); + shape.addChildShape(new HeightfieldCollisionShape(terrain.getHeightMap(), terrain.getLocalScale()), + trans.getTranslation(), + trans.getRotation().toRotationMatrix()); } else if (spatial instanceof Geometry) { Boolean bool = spatial.getUserData(UserData.JME_PHYSICSIGNORE); if (bool != null && bool.booleanValue()) { @@ -123,16 +133,6 @@ public class CollisionShapeFactory { trans.getTranslation(), trans.getRotation().toRotationMatrix()); } - } else if (spatial instanceof TerrainPatch) { - Boolean bool = spatial.getUserData(UserData.JME_PHYSICSIGNORE); - if (bool != null && bool.booleanValue()) { - continue; // go to the next child in the loop - } - TerrainPatch terrain = (TerrainPatch) spatial; - Transform trans = getTransform(spatial, realRootNode); - shape.addChildShape(new HeightfieldCollisionShape(terrain.getHeightMap(), terrain.getLocalScale()), - trans.getTranslation(), - trans.getRotation().toRotationMatrix()); } } return shape;