Package com.jme3.scene

Examples of com.jme3.scene.Spatial


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

        Spatial nodeA = event.getNodeA();
        Spatial nodeB = event.getNodeB();

        if (nodeA.equals(spatial) && nodeB.getName().equals("mainCharacter")
                || nodeB.equals(spatial) && nodeA.getName().equals("mainCharacter")) {

            //successful collision
            //rigidBodyControl.setEnabled(false);

            System.out.println("gerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr");
View Full Code Here


        }
    }

    private void loadGraphics(Graphics[] graphics) {
        for (Graphics graphic : graphics) {
            Spatial s = createSpatial(graphic);
            preloadManager.preload(s);
            graphicMap.put(graphic, s);
        }
    }
View Full Code Here

        DirectionalLight sun = new DirectionalLight();
        sun.setDirection(lightDir);
        sun.setColor(ColorRGBA.White.clone().multLocal(1.7f));
        rootNode.addLight(sun);
       
        Spatial sky = SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", false);
        sky.setLocalScale(350);
       
        mainScene.attachChild(sky);
       
        water = new WaterFilter(rootNode, lightDir);
       
View Full Code Here

        island.getChild("SpawningPoints").setCullHint(Spatial.CullHint.Always);

        Node mainScene = new Node("Main Scene");
        rootNode.attachChild(mainScene);

        Spatial sky = SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", false);
        sky.setLocalScale(350);

        mainScene.attachChild(sky);

        water = new WaterFilter(rootNode, lightDir);
View Full Code Here

        invWavelength4.y = 1.0f / FastMath.pow(wavelength.y, 4.0f);
        invWavelength4.z = 1.0f / FastMath.pow(wavelength.z, 4.0f);
    }
   
    private void createGround(String groundTexture) {
        Spatial geom = createSphere();
        geom.scale(getInnerRadius());
        mPlanetGround = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
        mPlanetGround.setTexture("DiffuseMap", assetManager.loadTexture(groundTexture));
        mPlanetGround.setTexture("GlowMap", assetManager.loadTexture("Textures/Planets/Earth/Earthlights2_1280.jpg"));
        mPlanetGround.setFloat("Shininess", 0.01f); // [1,128]
        geom.setMaterial(mPlanetGround);
        geom.setLocalTranslation(getPosition());
        TangentBinormalGenerator.generate(geom);
        geom.updateModelBound();
        ground = geom;
    }
View Full Code Here

        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

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

        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

        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

          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

TOP

Related Classes of com.jme3.scene.Spatial

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.