|
|
@ -29,7 +29,6 @@ import com.jme3.terrain.heightmap.HeightMapGrid; |
|
|
|
public class TerrainGrid extends TerrainQuad { |
|
|
|
public class TerrainGrid extends TerrainQuad { |
|
|
|
|
|
|
|
|
|
|
|
private static final Logger log = Logger.getLogger(TerrainGrid.class.getCanonicalName()); |
|
|
|
private static final Logger log = Logger.getLogger(TerrainGrid.class.getCanonicalName()); |
|
|
|
|
|
|
|
|
|
|
|
private Vector3f currentCell; |
|
|
|
private Vector3f currentCell; |
|
|
|
private int quarterSize; |
|
|
|
private int quarterSize; |
|
|
|
private int quadSize; |
|
|
|
private int quadSize; |
|
|
@ -249,10 +248,11 @@ public class TerrainGrid extends TerrainQuad { |
|
|
|
this.updateModelBound(); |
|
|
|
this.updateModelBound(); |
|
|
|
|
|
|
|
|
|
|
|
if (control != null) { |
|
|
|
if (control != null) { |
|
|
|
int currentCollisionGroup = control.getCollideWithGroups(); |
|
|
|
int collisionGroupsCollideWith = control.getCollideWithGroups(); |
|
|
|
|
|
|
|
int collisionGroups = control.getCollisionGroup(); |
|
|
|
control = new RigidBodyControl(new HeightfieldCollisionShape(getHeightMap(), getLocalScale()), 0); |
|
|
|
control = new RigidBodyControl(new HeightfieldCollisionShape(getHeightMap(), getLocalScale()), 0); |
|
|
|
control.setCcdMotionThreshold(0.5f); |
|
|
|
control.setCollideWithGroups(collisionGroupsCollideWith); |
|
|
|
control.setCollisionGroup(currentCollisionGroup); |
|
|
|
control.setCollisionGroup(collisionGroups); |
|
|
|
this.addControl(control); |
|
|
|
this.addControl(control); |
|
|
|
space.add(this); |
|
|
|
space.add(this); |
|
|
|
} |
|
|
|
} |
|
|
|