Examples of Spatial


Examples of com.jme.scene.Spatial

        // for collision. These are hardcoded values for now.
        Vector3f origin = new Vector3f(0f, 0.57f, 0.0f);
        float radius = 0.25f;

        if (selectedForInput) {      
            Spatial collisionGraph = new Sphere("AvatarCollision", origin, 10, 10, radius);
           
            collisionGraph.setModelBound(new BoundingBox());
            collisionGraph.updateModelBound();

            // Fetch the JME Collision system using the server manager of the Cell
            // to which this renderer is attached.
            ServerSessionManager manager =
                    cell.getCellCache().getSession().getSessionManager();
View Full Code Here

Examples of com.jme3.scene.Spatial

     * @param obj the path to the object.
     **/
    public Node loadNode(String obj){
  Node node = new Node();
  try{
            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());
View Full Code Here

Examples of com.jme3.scene.Spatial

        app.start();
    }

    @Override
    public void simpleInitApp() {
        Spatial teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");
      
        teapot.setLocalScale(2f);
        Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
        mat.setFloat("m_Shininess", 32f);
        mat.setBoolean("m_UseMaterialColors", true);

        mat.setColor("m_Ambient",  ColorRGBA.Black);
        mat.setColor("m_Diffuse",  ColorRGBA.Green);
        mat.setColor("m_Specular", ColorRGBA.Red);
       
        teapot.setMaterial(mat);
        rootNode.attachChild(teapot);

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

Examples of com.jme3.scene.Spatial

  private Node loadWord(String text) {
    Node word = new Node("word");
    int i = 0;
    float size = 0.65f;
    for (char c : text.toCharArray()) {
      Spatial letter = loadLetter(String.valueOf(c));
      letter.setLocalTranslation(size*i, 0, 0);
      word.attachChild(letter);
      i++;
    }
    return word;
  }
View Full Code Here

Examples of com.jme3.scene.Spatial

    }
    return word;
  }
 
  private Spatial loadLetter(String letter) {
        Spatial sletter = (Spatial) assetManager.loadModel("Text/"+letter+".mesh.xml");
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
    mat.setColor("Color", ColorRGBA.Blue);
    mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
    sletter.setMaterial(mat);
    return sletter;
  }
View Full Code Here

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

Examples of com.jme3.scene.Spatial

        }
    }

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

Examples of com.jme3.scene.Spatial

        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

Examples of com.jme3.scene.Spatial

        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

Examples of com.jme3.scene.Spatial

        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
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.