Hello ,I’m developed a game,but now I try to do a simple test for the AI of character( just move it ), so I wonder:
If I 've the algorithm logic of minimal path, how to know the coordinates of terrain for set the position character for every step ? Or in general for position an object in a point of the scene?
[java]
private void createTerrain() {
Texture heightMapImage = assetManager.loadTexture(“Textures/Terrain/splat/road_normal.png”);
AbstractHeightMap heightmap = null;
try {
heightmap =
new ImageBasedHeightMap(heightMapImage.getImage(), 0.25f);
heightmap.load();
} catch (Exception e) {
}
terrain = new TerrainQuad("terrain", 65, 513, heightmap.getHeightMap());
terrain.setLocalScale(new Vector3f(2, 2, 2));
terrainPhysicsNode = new RigidBodyControl(CollisionShapeFactory.createMeshShape(terrain), 0);
terrain.addControl(terrainPhysicsNode);
rootNode.attachChild(terrain);
getPhysicsSpace().add(terrainPhysicsNode);
}
[/java]