Search in sources :

Example 1 with CameraNode

use of com.ardor3d.scenegraph.extension.CameraNode in project energy3d by concord-consortium.

the class SceneManager method initCamera.

public void initCamera() {
    System.out.println("initCamera()");
    final Camera camera = getCamera();
    cameraNode = new CameraNode("Camera Node", camera);
    root.attachChild(cameraNode);
    cameraNode.updateFromCamera();
    Scene.getInstance().updateEditShapes();
    setCameraControl(CameraMode.ORBIT);
    resetCamera(ViewMode.NORMAL);
    SceneManager.getInstance().getCameraControl().reset();
    taskManager.update(new Callable<Object>() {

        @Override
        public Object call() throws Exception {
            final Spatial compass = createCompass();
            compass.setScale(0.1);
            compass.setTranslation(-1, -0.7, 2);
            cameraNode.attachChild(compass);
            final Spatial earth = createEarth();
            earth.setScale(0.00012);
            earth.setTranslation(-1, -0.67, 2);
            cameraNode.attachChild(earth);
            Scene.getInstance().updateEditShapes();
            return null;
        }
    });
}
Also used : Spatial(com.ardor3d.scenegraph.Spatial) CameraNode(com.ardor3d.scenegraph.extension.CameraNode) Camera(com.ardor3d.renderer.Camera) IOException(java.io.IOException)

Aggregations

Camera (com.ardor3d.renderer.Camera)1 Spatial (com.ardor3d.scenegraph.Spatial)1 CameraNode (com.ardor3d.scenegraph.extension.CameraNode)1 IOException (java.io.IOException)1