Package com.jme3.math

Examples of com.jme3.math.ColorRGBA


        shadowFB = new FrameBuffer[nbSplits];
        shadowMaps = new Texture2D[nbSplits];
        dispPic = new Picture[nbSplits];
        lightViewProjectionsMatrices = new Matrix4f[nbSplits];
        splits = new ColorRGBA();
        splitsArray = new float[nbSplits + 1];

        //DO NOT COMMENT THIS (it prevent the OSX incomplete read buffer crash)
        dummyTex = new Texture2D(size, size, Format.RGBA8);
View Full Code Here


        }
        if (light != null) {
            float r = ((Number) structure.getFieldValue("r")).floatValue();
            float g = ((Number) structure.getFieldValue("g")).floatValue();
            float b = ((Number) structure.getFieldValue("b")).floatValue();
            light.setColor(new ColorRGBA(r, g, b, 1.0f));
            result = new LightNode(null, light);
        }
        return result;
    }
View Full Code Here

    private void init(int nbSplits, int shadowMapSize) {
        nbShadowMaps = Math.max(Math.min(nbSplits, 4), 1);
        if (nbShadowMaps != nbSplits) {
            throw new IllegalArgumentException("Number of splits must be between 1 and 4. Given value : " + nbSplits);
        }
        splits = new ColorRGBA();
        splitsArray = new float[nbSplits + 1];
        shadowCam = new Camera(shadowMapSize, shadowMapSize);
        shadowCam.setParallelProjection(true);
        for (int i = 0; i < points.length; i++) {
            points[i] = new Vector3f();
View Full Code Here

    /** A cube with base color "leaking" through a partially transparent texture */
    Box boxshape4 = new Box(new Vector3f(3f, -1f, 0f), 1f, 1f, 1f);
    Geometry cube_leak = new Geometry("Leak-through color cube", boxshape4);
    Material mat_tl = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat_tl.setTexture("ColorMap", assetManager.loadTexture("Textures/ColoredTex/Monkey.png"));
    mat_tl.setColor("Color", new ColorRGBA(1f, 0f, 1f, 1f)); // purple
    cube_leak.setMaterial(mat_tl);
    rootNode.attachChild(cube_leak);

    /** A bumpy rock with a shiny light effect */
    Sphere rock = new Sphere(32, 32, 2f);
View Full Code Here

    stateManager.attach(bulletAppState);

    // bulletAppState.getPhysicsSpace().enableDebug(assetManager);

    // We re-use the flyby camera for rotation, while positioning is handled by physics
    viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f));
    flyCam.setMoveSpeed(100);
    setUpKeys();
    setUpLight();

    // We load the scene from the zip file and adjust its size.
View Full Code Here

    if (time > 1f) {
      time -= 1f;
      prevColor = nextColor;
      nextColor = ColorRGBA.randomColor();
    }
    ColorRGBA currentColor = new ColorRGBA();
    currentColor.interpolate(prevColor, nextColor, time);

    mat.setColor("Color", currentColor);
  }
View Full Code Here

                                                               Float.parseFloat(split[2]));
                case Vector4:
                    if (split.length != 4){
                        throw new IOException("Vector4 value parameter must have 4 entries: " + value);
                    }
                    return new ColorRGBA(Float.parseFloat(split[0]),
                                                                Float.parseFloat(split[1]),
                                                                Float.parseFloat(split[2]),
                                                                Float.parseFloat(split[3]));
                case Int:
                    if (split.length != 1){
View Full Code Here

   
    public static Mesh genNormalLines(Mesh mesh, float scale) {
        FloatBuffer vertexBuffer = (FloatBuffer) mesh.getBuffer(Type.Position).getData();
        FloatBuffer normalBuffer = (FloatBuffer) mesh.getBuffer(Type.Normal).getData();
       
        ColorRGBA originColor = ColorRGBA.White;
        ColorRGBA normalColor = ColorRGBA.Blue;
       
        Mesh lineMesh = new Mesh();
        lineMesh.setMode(Mesh.Mode.Lines);
       
        Vector3f origin = new Vector3f();
View Full Code Here

        FloatBuffer binormalBuffer = null;
        if (mesh.getBuffer(Type.Binormal) != null) {
            binormalBuffer = (FloatBuffer) mesh.getBuffer(Type.Binormal).getData();
        }
       
        ColorRGBA originColor = ColorRGBA.White;
        ColorRGBA tangentColor = ColorRGBA.Red;
        ColorRGBA binormalColor = ColorRGBA.Green;
        ColorRGBA normalColor = ColorRGBA.Blue;
       
        Mesh lineMesh = new Mesh();
        lineMesh.setMode(Mesh.Mode.Lines);
       
        Vector3f origin = new Vector3f();
View Full Code Here

    private int texUnit = 0;

    private ColorRGBA readColor(String content){
        String[] split = content.split("\\s");
       
        ColorRGBA color = new ColorRGBA();
        color.r = Float.parseFloat(split[0]);
        color.g = Float.parseFloat(split[1]);
        color.b = Float.parseFloat(split[2]);
        if (split.length >= 4){
            color.a = Float.parseFloat(split[3]);
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.