Package com.jme3.light

Examples of com.jme3.light.PointLight


  }
 
  public void setDirectionalLight(final boolean on) {
    if (dl == null) {
      Vector3f lightDir = new Vector3f(-0.8719428f, -0.46824604f, 0.14304268f);
      dl = new DirectionalLight();
      dl.setColor(new ColorRGBA(1.0f, 0.92f, 0.75f, 1f));
      dl.setDirection(lightDir);

      Vector3f lightDir2 = new Vector3f(0.70518064f, 0.5902297f, -0.39287305f);
      dl2 = new DirectionalLight();
      dl2.setColor(new ColorRGBA(0.7f, 0.85f, 1.0f, 1f));
      dl2.setDirection(lightDir2);
    }
    this.enqueue(new Callable<Integer>(){
      public Integer call() throws Exception {
View Full Code Here


      }
    });
  }
 
  private PointLight getPointLight() {
    PointLight ll = new PointLight();
    ll.setColor(new ColorRGBA(1.0f, 0.92f, 0.75f, 1f));
    ll.setRadius(20f);
    return ll;
  }
View Full Code Here

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

        pl = new PointLight();
        pl.setColor(ColorRGBA.White);
        //pl.setRadius(3f);
        rootNode.addLight(pl);
    }
View Full Code Here

    //marker = new QuadMarker(size);
    this.attachChild((Spatial)marker);
  }
 
  public PointLight getLight() {
    light = new PointLight();
    light.setColor(ColorRGBA.White);
    light.setRadius(400000f);
    light.setPosition(this.getLocalTranslation());
    return light;
  }
View Full Code Here

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

        // flourescent main light
        pl = new PointLight();
        pl.setColor(new ColorRGBA(0.88f, 0.92f, 0.95f, 1.0f));
        rootNode.addLight(pl);

        // sunset light
        DirectionalLight dl = new DirectionalLight();
View Full Code Here

   
        AmbientLight al = new AmbientLight();
        al.setColor(new ColorRGBA(.8f, .8f, .8f, 1.0f));
    Singleton.get().getSceneManager().changeRootLight(al,Action.ADD);

    pl = new PointLight();
    pl.setColor(ColorRGBA.White);
    pl.setRadius(15f);
    visible.addLight(pl);

    ArrayList<BaseUsable> acts = new ArrayList<BaseUsable>();
View Full Code Here

                    fb16.put(pos.x).put(pos.y).put(pos.z).put(0.0f).flip();
                    glLight(glLightIndex, GL_POSITION, fb16);
                    glLightf(glLightIndex, GL_SPOT_CUTOFF, 180);
                    break;
                case Point:
                    PointLight pLight = (PointLight) light;
     
                    fb16.clear();
                    fb16.put(col.r).put(col.g).put(col.b).put(col.a).flip();
                    glLight(glLightIndex, GL_DIFFUSE, fb16);
                    glLight(glLightIndex, GL_SPECULAR, fb16);

                    pos = pLight.getPosition();
                    fb16.clear();
                    fb16.put(pos.x).put(pos.y).put(pos.z).put(1.0f).flip();
                    glLight(glLightIndex, GL_POSITION, fb16);
                    glLightf(glLightIndex, GL_SPOT_CUTOFF, 180);

                    if (pLight.getRadius() > 0) {
                        // Note: this doesn't follow the same attenuation model
                        // as the one used in the lighting shader.
                        glLightf(glLightIndex, GL_CONSTANT_ATTENUATION,  1);
                        glLightf(glLightIndex, GL_LINEAR_ATTENUATION,    pLight.getInvRadius() * 2);
                        glLightf(glLightIndex, GL_QUADRATIC_ATTENUATION, pLight.getInvRadius() * pLight.getInvRadius());
                    }else{
                        glLightf(glLightIndex, GL_CONSTANT_ATTENUATION,  1);
                        glLightf(glLightIndex, GL_LINEAR_ATTENUATION,    0);
                        glLightf(glLightIndex, GL_QUADRATIC_ATTENUATION, 0);
                    }
View Full Code Here

    private void lightToSpatial(Light light) {
        TempVars vars = TempVars.get();
        if (light instanceof PointLight) {

            PointLight pLight = (PointLight) light;

            Vector3f vecDiff = vars.vect1.set(pLight.getPosition()).subtractLocal(spatial.getWorldTranslation());
            spatial.setLocalTranslation(vecDiff.addLocal(spatial.getLocalTranslation()));
        }

        if (light instanceof DirectionalLight) {
            DirectionalLight dLight = (DirectionalLight) light;
View Full Code Here

        }
        Light light = null;
        int type = ((Number) structure.getFieldValue("type")).intValue();
        switch (type) {
            case 0:// Lamp
                light = new PointLight();
                float distance = ((Number) structure.getFieldValue("dist")).floatValue();
                ((PointLight) light).setRadius(distance);
                break;
            case 1:// Sun
                LOGGER.log(Level.WARNING, "'Sun' lamp is not supported in jMonkeyEngine.");
View Full Code Here

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

    pl = new PointLight();
    pl.setColor(ColorRGBA.White);
    pl.setPosition(new Vector3f(0f, 0f, 4f));
    rootNode.addLight(pl);

    // DirectionalLight dl = new DirectionalLight();
View Full Code Here

TOP

Related Classes of com.jme3.light.PointLight

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.