Package com.jme3.cinematic

Examples of com.jme3.cinematic.MotionPath


  public static void startApp(){
    app.startCanvas();
    app.enqueue(new Callable<Void>(){
      public Void call(){
        if (app instanceof SimpleApplication){
          SimpleApplication simpleApp = (SimpleApplication) app;
          simpleApp.getFlyByCamera().setDragToRotate(true);
          String assdir =  new File(workspace).getAbsolutePath();
          app.setAssetsPath(assdir);
        }
        return null;
      }
View Full Code Here


     * Attaches Statistics View to guiNode and displays it on the screen
     * above FPS statistics line.
     *
     */
    public void loadStatsView() {
        statsView = new StatsView("Statistics View", assetManager, renderer.getStatistics());
//         move it up so it appears above fps text
        statsView.setLocalTranslation(0, fpsText.getLineHeight(), 0);
        guiNode.attachChild(statsView);
    }
View Full Code Here

        listener = new Listener();
        ar.setListener(listener);
       
        // init StateManager ----------------------------
        stateManager = new AppStateManager(this);
       
        // simple Init ----------------------------------
        guiNode.setQueueBucket(Bucket.Gui);
        guiNode.setCullHint(CullHint.Never);
        //loadFPSText();
View Full Code Here

    private void setColor(Node node, ColorRGBA color){
  for(int i = 0; i < node.getQuantity(); i++){
      Spatial spatial = node.getChild(i);
      if(spatial instanceof Geometry){
                //Material material = new Material();
                AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
                Material material = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
                material.setColor("m_Color",color);
                //Material geomMaterial = ((Geometry)spatial).getMaterial();
                spatial.setMaterial(material);
                System.out.println("Spatial: "+spatial.getName());
View Full Code Here

     * Sets the color of the geometries of the children and home.
     * Note, this is a recursive method.
     * @param node the node that contains children
     **/
    private void setColor(Geometry geometry, ColorRGBA color){
        AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
        Material material = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
        material.setColor("m_Color",color);
        geometry.setMaterial(material);
        System.out.println("Spatial: "+geometry.getName());
    }
View Full Code Here

    //bgNode.attachChild(sky);

    sphere.updateModelBound();
    sphere.setQueueBucket(Bucket.Sky);
    Material sky = new Material(assetManager, "Common/MatDefs/Misc/Sky.j3md");
    TextureKey key = new TextureKey("Textures/Sky/Stars.dds", true);
    key.setGenerateMips(true);
    key.setAsCube(true);
    Texture tex = assetManager.loadTexture(key);
    sky.setTexture("m_Texture", tex);
    sky.setVector3("m_NormalScale", Vector3f.UNIT_XYZ);
    sphere.setMaterial(sky);
    sphere.setCullHint(Spatial.CullHint.Never);
View Full Code Here

        // init Audio ----------------------------------
        // edited by floh -- 31/10/2011
        ar = JmeSystem.newAudioRenderer(settings);
        ar.initialize();

        listener = new Listener();
        ar.setListener(listener);
       
        // init StateManager ----------------------------
        stateManager = new AppStateManager(this);
       
View Full Code Here

            Spatial spatial = assetManager.loadModel(obj);
            //Material mat = new Material(assetManager, "Common/MatDefs/Misc/ShowNormals.j3md");
            //spatial.setMaterial(mat);
            node.attachChild(spatial);

      node.setModelBound(new BoundingSphere());
      node.updateModelBound();
  } catch (Exception e) {
            e.printStackTrace();
      //logger.logp(Level.SEVERE, this.getClass().toString(),"loadNode()", "Exception", e);
      node = null;
View Full Code Here

    private void createCamMotionPath() {
        CameraNode seagull = cinematic.bindCamera("seagull", myApp.getCamera());
        seagull.setLocalTranslation(new Vector3f(-231.00694f, 269.15887f, 319.6499f));
        seagull.lookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y);
        //Motion1
        MotionPath path1 = new MotionPath();
        path1.addWayPoint(new Vector3f(-231.00694f, 269.15887f, 319.6499f));
        path1.addWayPoint(new Vector3f(-271.03436f, 274.78607f, 166.41858f));
        path1.addWayPoint(new Vector3f(-282.98575f, 198.66827f, -62.538017f));
        path1.addWayPoint(new Vector3f(-141.32166f, 241.95816f, -299.23657f));
        path1.addWayPoint(new Vector3f(69.37767f, 282.1654f, -395.867f));
        path1.setCurveTension(0.5f);
        seagullCamMotion1 = new MotionEvent(seagull, path1, 10f);
        seagullCamMotion1.setLookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y);
        seagullCamMotion1.setDirectionType(MotionEvent.Direction.LookAt);
        seagullCamMotion1.setLoopMode(LoopMode.DontLoop);

        //Motion2
        MotionPath path2 = new MotionPath();
        path2.addWayPoint(new Vector3f(69.37767f, 282.1654f, -395.867f));
        path2.addWayPoint(new Vector3f(49.096973f, 199.68199f, -280.14606f));
        path2.addWayPoint(new Vector3f(69.881424f, 80.421936f, -153.33533f));
        path2.addWayPoint(new Vector3f(92.93746f, 41.409966f, -79.42096f));
        path2.addWayPoint(new Vector3f(135.33469f, 37.869682f, -40.803993f));
        path2.addWayPoint(new Vector3f(232.73439f, 62.335537f, 4.7981267f));
        path2.addWayPoint(new Vector3f(151.06522f, 40.954773f, 108.32132f));
        path2.addWayPoint(new Vector3f(70.51622f, 30.993803f, 89.91843f));
        path2.addWayPoint(new Vector3f(-52.995872f, 27.911129f, 33.102673f));
        path2.addWayPoint(new Vector3f(-96.421425f, 27.326252f, -49.235554f));
        path2.addWayPoint(new Vector3f(-186.47707f, 19.662216f, -72.307915f));
        path2.addWayPoint(new Vector3f(-187f, 19.808556f, -72.36449f));

        path2.setCurveTension(0.6f);
        path2.setPathSplineType(SplineType.CatmullRom);
        seagullCamMotion2 = new MotionEvent(seagull, path2, 24f);
        seagullCamMotion2.setDirectionType(MotionEvent.Direction.Path);
        seagullCamMotion2.setLoopMode(LoopMode.DontLoop);
    }
View Full Code Here

    entities.add(entity);
    mapNode.attachChild(entity);
  }
 
  public CollisionResults getCollisions(Ray ray) {
    CollisionResults results = new CollisionResults();
    mapNode.collideWith(ray, results);
    return results;
  }
View Full Code Here

TOP

Related Classes of com.jme3.cinematic.MotionPath

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.