Examples of Spatial


Examples of com.jme3.scene.Spatial

        geom.updateModelBound();
        ground = geom;
    }
   
    private void createClouds(String cloudTexture) {
        Spatial geom = createSphere();
        geom.scale(getCloudRadius());
        Material mClouds = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
        mClouds.setTexture("DiffuseMap", assetManager.loadTexture(cloudTexture));
        mClouds.setFloat("Shininess", 0.01f); // [1,128]
        mClouds.getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);
        geom.setMaterial(mClouds);
        geom.setLocalTranslation(getPosition());
        TangentBinormalGenerator.generate(geom);
        geom.updateModelBound();
        clouds = geom;
    }
View Full Code Here

Examples of com.jme3.scene.Spatial

       
        atmosphere.setMaterial(mAtmosphere);
    }
   
    private Spatial createSphere() {
      Spatial sphere = assetManager.loadModel(MESH_SPHERE);
      sphere.scale(0.25f);
        return sphere;
    }
View Full Code Here

Examples of com.jme3.scene.Spatial

        if (spatial == null || event.getNodeA() == null || event.getNodeB() == null) {
            return;
        }

        PhysicsCollisionObject object = null;
        Spatial target = null;
        if (event.getNodeA().equals(spatial)) {
            object = event.getObjectA();
            target = event.getNodeB();
        }
        if (event.getNodeB().equals(spatial)) {
View Full Code Here

Examples of com.jme3.scene.Spatial

        Texture north = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_north.jpg");
        Texture south = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_south.jpg");
        Texture up = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_up.jpg");
        Texture down = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_down.jpg");

        Spatial sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down);
        rootNode.attachChild(sky);
    }
View Full Code Here

Examples of com.jme3.scene.Spatial

          NavTestHelper.debugShowMesh(assetManager, debugNodes,(TiledNavMesh) a.getBaseAsset());
       
        Asset b = new Asset("/tile/121_177/121_177.j3o", "/tile/121_177/121_177.j3o");
        sin.getAssetManager().loadAsset(b, true);
        if(b.getBaseAsset() instanceof Spatial ) {
          Spatial n = (Spatial)b.getBaseAsset();
//      Material mat = new Material(Singleton.get().getAssetManager().getJmeAssetMan(), "Common/MatDefs/Misc/Unshaded.j3md");
//          mat.setColor("Color", ColorRGBA.randomColor());
        Material mat = new Material(Singleton.get().getAssetManager().getJmeAssetMan(), "Common/MatDefs/Light/Lighting.j3md");
        mat.setBoolean("UseMaterialColors",true);   
        mat.setColor("Diffuse",ColorRGBA.randomColor());
        n.setLocalTranslation(Tile.getWorldPositionOfXTile(121)+IArea.TERRAIN_SIZE_HALF, 0f,Tile.getWorldPositionOfZTile(177)-IArea.TERRAIN_SIZE_HALF);
          n.setMaterial(mat);
          rootNode.attachChild(n);
        }
        /*       System.out.println("tile x=121 should be world -9984:"+getWorldPositionOfXTile(121));
       System.out.println("tile x=122 should be world -9728:"+getWorldPositionOfXTile(122));
       System.out.println("tile z=176 should be world 8192:"+getWorldPositionOfZTile(176));
View Full Code Here

Examples of com.jme3.scene.Spatial

    @Override
    public void simpleInitApp() {
        viewPort.setBackgroundColor(ColorRGBA.DarkGray);

        Spatial bumpy = (Spatial) assetManager.loadModel("Models/MonkeyHead/MonkeyHead.mesh.xml");
        rootNode.attachChild(bumpy);

        lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
        lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
        rootNode.attachChild(lightMdl);
View Full Code Here

Examples of com.jme3.scene.Spatial

        0.32999992f, 0.6059958f);
    fpp.addFilter(ssaoFilter);
    SSAOUI ui = new SSAOUI(inputManager, ssaoFilter);
    viewPort.addProcessor(fpp);
   
    Spatial n = assetManager
        .loadModel("scenes/create/create.j3o");
    rootNode.attachChild(n);

    for(Light l :n.getLocalLightList())
      if(l instanceof AmbientLight)
        l.setColor(new ColorRGBA(0.5f,0.5f,0.5f,1.0f));
   
    PartSetManager man = PartSetManager.get();
    man.loadParts("dwarf.csv");
    Spatial n2 = Assembler2.getModel3("DwarfWarriorM");
//    n.setLocalTranslation(.126f,-.1224f, 5.76f);
    n2.setLocalTranslation(.126f, -0.1224f, 7.76f);
    ((Node)n).attachChild(n2);
   
    /**
     * Camera Position: (2.1353703, 0.10786462, 14.364603)
Camera Rotation: (0.0127822235, 0.98611915, 0.13812076, -0.091258995)
View Full Code Here

Examples of com.jme3.scene.Spatial

        Texture north = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_north.jpg");
        Texture south = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_south.jpg");
        Texture up = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_up.jpg");
        Texture down = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_down.jpg");

        Spatial sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down);
        rootNode.attachChild(sky);

    }
View Full Code Here

Examples of com.jme3.scene.Spatial

  /**
   * Returns an item model
   */
  protected Node createVisuals() {
    if (vis == null) { 
      Spatial s = Singleton.get().getAssetManager().getJmeAssetMan().loadModel("items/bottle/HealthFlask.j3o");
      if(s instanceof Node ){
        vis = (Node) s.clone(false);
        vis.setName(name);
//        vis.setLocalTranslation(0f, 1f, 0f);
      }
    }
   
View Full Code Here

Examples of com.jme3.scene.Spatial

    try {
      Geometry g;
      // need to load vial loadModel, JME does not see obj, etc as
      // Assets..
      t.reset();
      Spatial n = (Spatial) assetMan.loadModel(from.getAbsolutePath());
      time = t.getTimeInSeconds();
      System.out.println("File " + from.getAbsolutePath() + " loaded in "
          + time + " seconds");
      if (n instanceof Geometry) {
        g = (Geometry) n;
        n = new Node(g.getName());
        ((Node)n).attachChild(g);
      } else if (n instanceof Node) {
        if (((Node) n).getChildren().size() > 1)
          throw new Throwable(
              "Mesh with more children detected than one on "
                  + from.getName());
        g = (Geometry) ((Node) n).getChild(0);
      } else
        throw new Throwable("Spatial loaded was unexpected type "
            + n.getClass());
      // jme fucked up the model names, and ignores any object name
      // entries so we fix a bit
      String fName = from.getName().substring(0,
          from.getName().length() - fileEnding.length());// without .nav
      g.setName(fName.toLowerCase());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.