Package com.jme3.math

Examples of com.jme3.math.ColorRGBA


            }
        }else if (keyword.equals("emissive")){
            emissive = readColor(split[1]);
        }else if (keyword.equals("specular")){
            String[] subsplit = split[1].split("\\s");
            specular = new ColorRGBA();
            specular.r = Float.parseFloat(subsplit[0]);
            specular.g = Float.parseFloat(subsplit[1]);
            specular.b = Float.parseFloat(subsplit[2]);
            float unknown = Float.parseFloat(subsplit[3]);
            if (subsplit.length >= 5){
View Full Code Here


            // reading acceleration
            DynamicArray<Number> acc = (DynamicArray<Number>) particleSettings.getFieldValue("acc");
            result.setGravity(-acc.get(0).floatValue(), -acc.get(1).floatValue(), -acc.get(2).floatValue());

            // setting the colors
            result.setEndColor(new ColorRGBA(1f, 1f, 1f, 1f));
            result.setStartColor(new ColorRGBA(1f, 1f, 1f, 1f));

            // reading size
            float sizeFactor = nameSuffix == 'B' ? 1.0f : 0.3f;
            float size = ((Number) particleSettings.getFieldValue("size")).floatValue() * sizeFactor;
            result.setStartSize(size);
View Full Code Here

       
        resetMaterial();
    }

    protected ColorRGBA readColor(){
        ColorRGBA v = new ColorRGBA();
        v.set(scan.nextFloat(), scan.nextFloat(), scan.nextFloat(), 1.0f);
        return v;
    }
View Full Code Here

            } else {
                checkTopNode("environment");
            }
        } else if (qName.equals("colourAmbient") || qName.equals("colorAmbient")) {
            if (elementStack.peek().equals("environment")) {
                ColorRGBA color = parseColor(attribs);
                if (!color.equals(ColorRGBA.Black) && !color.equals(ColorRGBA.BlackNoAlpha)) {
                    // Lets add an ambient light to the scene.
                    AmbientLight al = new AmbientLight();
                    al.setColor(color);
                    root.addLight(al);
                }
View Full Code Here

        float ambr = ((Number) worldStructure.getFieldValue("ambr")).floatValue();
        float ambg = ((Number) worldStructure.getFieldValue("ambg")).floatValue();
        float ambb = ((Number) worldStructure.getFieldValue("ambb")).floatValue();
        if (ambr > 0 || ambg > 0 || ambb > 0) {
            ambientLight = new AmbientLight();
            ColorRGBA ambientLightColor = new ColorRGBA(ambr, ambg, ambb, 0.0f);
            ambientLight.setColor(ambientLightColor);
            LOGGER.log(Level.FINE, "Loaded ambient light: {0}.", ambientLightColor);
        } else {
            LOGGER.finer("Ambient light is set to BLACK which means: no ambient light! The ambient light node will not be included in the result.");
        }
View Full Code Here

     */
    public ColorRGBA toBackgroundColor(Structure worldStructure) {
        float horr = ((Number) worldStructure.getFieldValue("horr")).floatValue();
        float horg = ((Number) worldStructure.getFieldValue("horg")).floatValue();
        float horb = ((Number) worldStructure.getFieldValue("horb")).floatValue();
        return new ColorRGBA(horr, horg, horb, 1);
    }
View Full Code Here

        if (skytype == 0) {
            return null;
        }

        LOGGER.fine("Loading sky.");
        ColorRGBA horizontalColor = this.toBackgroundColor(worldStructure);

        float zenr = ((Number) worldStructure.getFieldValue("zenr")).floatValue();
        float zeng = ((Number) worldStructure.getFieldValue("zeng")).floatValue();
        float zenb = ((Number) worldStructure.getFieldValue("zenb")).floatValue();
        ColorRGBA zenithColor = new ColorRGBA(zenr, zeng, zenb, 1);

        // jutr for this case load generated textures wheather user had set it or not because those might be needed to properly load the sky
        boolean loadGeneratedTextures = blenderContext.getBlenderKey().isLoadGeneratedTextures();
        blenderContext.getBlenderKey().setLoadGeneratedTextures(true);
View Full Code Here

        }

        // copying glow color
        MatParam glowColor = material.getParam("GlowColor");
        if (glowColor != null) {
            ColorRGBA color = (ColorRGBA) glowColor.getValue();
            result.setParam("GlowColor", VarType.Vector3, color);
        }
        return result;
    }
View Full Code Here

            float r = ((Number) structure.getFieldValue("r")).floatValue();
            float g = ((Number) structure.getFieldValue("g")).floatValue();
            float b = ((Number) structure.getFieldValue("b")).floatValue();
            float alpha = ((Number) structure.getFieldValue("alpha")).floatValue();

            diffuseColor = new ColorRGBA(r, g, b, alpha);
            specularShader = null;
            specularColor = null;
            shininess = 0.0f;
        } else {
            diffuseColor = this.readDiffuseColor(structure, diffuseShader);
View Full Code Here

            material.setBoolean("WardIso", specularShader == SpecularShader.WARDISO);
            material.setColor("Specular", specularColor);
            material.setFloat("Shininess", shininess);

            material.setColor("Ambient", new ColorRGBA(ambientFactor, ambientFactor, ambientFactor, 1f));
        }

        // applying textures
        if (loadedTextures != null && loadedTextures.size() > 0) {
            int textureIndex = 0;
View Full Code Here

TOP

Related Classes of com.jme3.math.ColorRGBA

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.