@Override
public void simpleInitApp() {
sin.init(TileTerrainManager.get());
cam.setLocation(new Vector3f(-9980f,50f,8450f));
cam.setFrustumFar(1000f);
cam.setFrustumNear(1f);
cam.lookAt(new Vector3f(-9980f,-50f,8450), Vector3f.UNIT_Y);
flyCam.setMoveSpeed(50f);
assetManager = sin.getAssetManager().getJmeAssetMan();
enm = sin.getNavManager();
enm.USE_OPTIMZED_PATH = true;
em = sin.getEntityManager();
tm = (TileTerrainManager) sin.getTerrainManager();
tm.setLoadedAtOrigin(true);//models not at world coords (all models != nav)
sm = sin.getSceneManager();
js = JmeUpdateSystem.get();
ps = sin.getPosSystem();
tm.update(cam.getLocation());
rootNode.attachChild(debugNodes);
rootNode.attachChild(bboxes);
rootNode.attachChild(navs);
DirectionalLight light = new DirectionalLight();
light.setDirection((new Vector3f(-0.5f, -1f, -0.5f)).normalize());
rootNode.addLight(light);
AmbientLight ambLight = new AmbientLight();
ambLight.setColor(new ColorRGBA(0.2f, 0.2f, 0.2f, 1f));
rootNode.addLight(ambLight);
rootNode.attachChild(scene);
sm.setRoot(scene);
// while(enm.getMeshCount()<4)
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
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;
}