public void onAction(String name, boolean value, float tpf) { if (!value) { return; } if (name.equals(INPUT_MAPPING_CAMERA_POS)) { Camera cam = app.getCamera(); if (cam != null) { Vector3f loc = cam.getLocation(); Quaternion rot = cam.getRotation(); System.out.println("Camera Position: (" + loc.x + ", " + loc.y + ", " + loc.z + ")"); System.out.println("Camera Rotation: " + rot); System.out.println("Camera Direction: " + cam.getDirection()); System.out.println("cam.setLocation(new Vector3f(" + loc.x + "f, " + loc.y + "f, " + loc.z + "f));"); System.out.println("cam.setRotation(new Quaternion(" + rot.getX() + "f, " +rot.getY()+ "f, " + rot.getZ() + "f, " + rot.getW() + "f));"); } } else if (name.equals(INPUT_MAPPING_MEMORY)) { BufferUtils.printCurrentDirectMemory(null); } } }
public void onAction(String name, boolean value, float tpf) { if (!value) { return; } if (name.equals(INPUT_MAPPING_EXIT)) { stop(); } else if (name.equals(INPUT_MAPPING_CAMERA_POS)) { if (cam != null) { Vector3f loc = cam.getLocation(); Quaternion rot = cam.getRotation(); System.out.println("Camera Position: (" + loc.x + ", " + loc.y + ", " + loc.z + ")"); System.out.println("Camera Rotation: " + rot); System.out.println("Camera Direction: " + cam.getDirection()); } } else if (name.equals(INPUT_MAPPING_MEMORY)) { BufferUtils.printCurrentDirectMemory(null); }else if (name.equals(INPUT_MAPPING_HIDE_STATS)){ boolean show = showFps; setDisplayFps(!show); setDisplayStatView(!show); } } }
public void onAction(String name, boolean value, float tpf) { if (!value) { return; } if (name.equals(INPUT_MAPPING_CAMERA_POS)) { Camera cam = app.getCamera(); if (cam != null) { Vector3f loc = cam.getLocation(); Quaternion rot = cam.getRotation(); System.out.println("Camera Position: (" + loc.x + ", " + loc.y + ", " + loc.z + ")"); System.out.println("Camera Rotation: " + rot); System.out.println("Camera Direction: " + cam.getDirection()); System.out.println("cam.setLocation(new Vector3f(" + loc.x + "f, " + loc.y + "f, " + loc.z + "f));"); System.out.println("cam.setRotation(new Quaternion(" + rot.getX() + "f, " +rot.getY()+ "f, " + rot.getZ() + "f, " + rot.getW() + "f));"); } } else if (name.equals(INPUT_MAPPING_MEMORY)) { BufferUtils.printCurrentDirectMemory(null); } } }