Examples of PointLight


Examples of com.jme3.light.PointLight

        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

Examples of com.jme3.light.PointLight

   
        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

Examples of com.jme3.light.PointLight

                    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

Examples of com.jme3.light.PointLight

    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

Examples of com.jme3.light.PointLight

        }
        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

Examples of com.jme3.light.PointLight

    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

Examples of com.jme3.light.PointLight

        checkTopNode("node");

        String lightType = parseString(attribs.getValue("type"), "point");
        if (lightType.equals("point")) {
            light = new PointLight();
        } else if (lightType.equals("directional") || lightType.equals("sun")) {
            light = new DirectionalLight();
            // Assuming "normal" property is not provided
            ((DirectionalLight) light).setDirection(Vector3f.UNIT_Z);
        } else if (lightType.equals("spotLight") || lightType.equals("spot")) {
View Full Code Here

Examples of com.jme3.light.PointLight

                    Quaternion q = node.getWorldRotation();
                    Vector3f dir = dl.getDirection();
                    q.multLocal(dir);
                    dl.setDirection(dir);
                } else if (light instanceof PointLight) {
                    PointLight pl = (PointLight) light;
                    Vector3f pos = node.getWorldTranslation();
                    pl.setPosition(pos);
                } else if (light instanceof SpotLight) {
                    SpotLight sl = (SpotLight) light;

                    Vector3f pos = node.getWorldTranslation();
                    sl.setPosition(pos);
View Full Code Here

Examples of com.jme3.light.PointLight

  }

  @Override
  public void internalLoadSceneObject() {
    sceneObject = GlobalObjectStore.<AssetManager>getObject(AssetManager.class).loadModel("ship/glider/Hull.mesh.xml");
    sceneObject.addLight(new PointLight());
    sceneObject.setName("PlayerShip");

    // TODO: ship: Gr��e laden
    CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(1f, 2f);
    rbc = new RigidBodyControl(capsuleShape, 1f);
View Full Code Here

Examples of com.jme3.light.PointLight

        }
    }

    public Viewer() {
        super();
        this.cameraLight = new PointLight();
        this.cameraLight.setColor(ColorRGBA.White);
        this.cameraLight.setRadius(10f);
        this.sunLight = new DirectionalLight();
        this.sunLight.setColor(ColorRGBA.White);
        this.sunLight.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
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.