System.out.println("EntityNavManager finished");
Box b2 = new Box(.3f, 1.3f, .3f);
Geometry g2 = new Geometry("tgt", b2);
Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat2.setColor("Color", ColorRGBA.Green);
g2.setMaterial(mat2);
Vector3f p = new Vector3f(-9979.581f, 28.097652f, 8380.083f);
enm.snapToGround(p);
g2.setLocalTranslation(p);
rootNode.attachChild(g2);
System.out.println("Target placed at:"+p);
Box b = new Box(.5f,1f,.5f);
Geometry walker = new Geometry("wakler", b);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Red);
walker.setMaterial(mat);
// 269.5173, -284.07605, 87.175156 to 476.54184, -171.21466, 454.62576
//Entity e = placeObject(new Vector3f(-9969.057f, 15.097652f, 8429.296f), new Vector3f(-9979.581f, 28.097652f, 8420.083f));
Entity e = placeObject(new Vector3f(-9890.341f, 14.610833f, 8302.891f), p.clone());
if(e != null){
e.attachChild(walker);
rootNode.attachChild(e);
this.walker = e;
}
System.out.println("Entity placed");
inputManager.addListener(this, "print_scenegraph", "print_cam_location", "print_bboxes", "toggle_navmesh");
inputManager.addMapping("print_scenegraph", new KeyTrigger(KeyInput.KEY_F6));
inputManager.addMapping("print_cam_location", new KeyTrigger(KeyInput.KEY_F1));
inputManager.addMapping("print_bboxes", new KeyTrigger(KeyInput.KEY_F7));
inputManager.addMapping("toggle_navmesh", new KeyTrigger(KeyInput.KEY_F8));
if(pc.path != null)
NavTestHelper.debugShowPath(assetManager, debugNodes, pc.path);
for(TiledNavMesh mesh : enm.getNavMeshes()){
NavTestHelper.debugShowBox(assetManager, debugNodes, mesh.getPosition(), ColorRGBA.White, 128f,0.5f,128f);
}
matWireframe = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
matWireframe.setColor("Color", ColorRGBA.Green);
matWireframe.getAdditionalRenderState().setWireframe(true);
}