Package com.ardor3d.math

Examples of com.ardor3d.math.ColorRGBA


            area = new Mesh("a");
            area.getMeshData().setVertexBuffer(BufferUtils.createVector3Buffer(maxSamples * 2));
            area.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
            area.getMeshData().setIndexMode(IndexMode.LineStrip);

            area.setDefaultColor(getColorConfig(type, ConfigKeys.Color.name(), new ColorRGBA(ColorRGBA.LIGHT_GRAY)));
            if (!getBooleanConfig(type, ConfigKeys.ShowAreas.name(), true)) {
                area.getSceneHints().setCullHint(CullHint.Always);
            }
        }
View Full Code Here


        _defBlendState.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        _defBlendState.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
        _graphRoot.setRenderState(_defBlendState);

        _bgQuad.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
        _bgQuad.setDefaultColor(new ColorRGBA(ColorRGBA.BLACK));
        _graphRoot.getSceneHints().setCullHint(CullHint.Never);
    }
View Full Code Here

                // See if we have a defained color for this type, otherwise use
                // the corresponding color from a linked line grapher, or if
                // none, use white.
                entry.text.setTextColor(getColorConfig(type, ConfigKeys.TextColor.name(),
                        _linkedGraph != null ? _linkedGraph.getColorConfig(type, LineGrapher.ConfigKeys.Color.name(),
                                new ColorRGBA(ColorRGBA.WHITE)) : new ColorRGBA(ColorRGBA.WHITE)));

                // Update text placement.
                final double labelHeight = entry.text.getHeight();
                if (maxY < labelHeight) {
                    maxY = labelHeight;
                }
                entry.text.setTranslation(colSize * col, lastY, 0);

                // Update line key as needed
                if (_linkedGraph != null && _linkedGraph.hasConfig(type) && _linkedGraph instanceof TableLinkable) {
                    // add line keys
                    entry.lineKey = ((TableLinkable) _linkedGraph).updateLineKey(type, entry.lineKey);
                    if (entry.lineKey.getParent() != _graphRoot) {
                        _graphRoot.attachChild(entry.lineKey);
                    }
                    final ReadOnlyVector3 tLoc = entry.text.getTranslation();
                    entry.lineKey.setTranslation((float) (tLoc.getX() + entry.text.getWidth() + 15), (float) (tLoc
                            .getY() + (.5 * entry.text.getHeight())), 0);
                }

                // update column / row variables
                col++;
                col %= getColumns();
                if (col == 0) {
                    lastY -= maxY;
                    maxY = 0;
                }
            }

            for (final Iterator<StatType> i = _entries.keySet().iterator(); i.hasNext();) {
                final LabelEntry entry = _entries.get(i.next());
                // - Go through the entries list and remove any that were not
                // visited.
                if (!entry.visited) {
                    entry.text.removeFromParent();
                    if (entry.lineKey != null) {
                        entry.lineKey.removeFromParent();
                    }
                    i.remove();
                }
            }
        }

        _graphRoot.updateGeometricState(0, true);

        final ColorRGBA bgColor = ColorRGBA.fetchTempInstance().set(_textureRenderer.getBackgroundColor());
        if (_minimalBackground) {
            bgColor.setAlpha(0);
            _textureRenderer.setBackgroundColor(bgColor);

            lastY -= 3;
            if (col != 0) {
                lastY -= maxY;
            }
            _bgQuad.resize(texWidth, texHeight - lastY);
            _bgQuad.setRenderState(_defBlendState);
            _bgQuad.setTranslation(texWidth / 2f, texHeight - (texHeight - lastY) / 2f, 0);
            _bgQuad.updateGeometricState(0, true);

            // - Draw our bg quad
            _textureRenderer.render(_bgQuad, _texture, Renderer.BUFFER_COLOR_AND_DEPTH);

            // - Now, draw to texture via a TextureRenderer
            _textureRenderer.render(_graphRoot, _texture, Renderer.BUFFER_NONE);
        } else {
            bgColor.setAlpha(1);
            _textureRenderer.setBackgroundColor(bgColor);

            // - Now, draw to texture via a TextureRenderer
            _textureRenderer.render(_graphRoot, _texture, Renderer.BUFFER_COLOR_AND_DEPTH);
        }
View Full Code Here

    public void write(final OutputCapsule capsule) throws IOException {
        if (_storeImage) {
            capsule.write(_image, "image", null);
        }
        capsule.write(_constantColor, "constantColor", new ColorRGBA(ColorRGBA.BLACK_NO_ALPHA));
        capsule.write(_borderColor, "borderColor", new ColorRGBA(ColorRGBA.BLACK_NO_ALPHA));
        capsule.write(_texMatrix, "texMatrix", new Matrix4(Matrix4.IDENTITY));
        capsule.write(_hasBorder, "hasBorder", false);
        capsule.write(_anisotropicFilterPercent, "anisotropicFilterPercent", 0.0f);
        capsule.write(_lodBias, "lodBias", 0.0f);
        capsule.write(_minificationFilter, "minificationFilter", MinificationFilter.NearestNeighborNoMipMaps);
View Full Code Here

        // pull texture image from resource, if possible.
        if (_image == null && _key != null && _key.getSource() != null) {
            TextureManager.loadFromKey(_key, null, this);
        }

        _constantColor.set((ColorRGBA) capsule.readSavable("constantColor", new ColorRGBA(ColorRGBA.BLACK_NO_ALPHA)));
        _borderColor.set((ColorRGBA) capsule.readSavable("borderColor", new ColorRGBA(ColorRGBA.BLACK_NO_ALPHA)));
        _texMatrix.set((Matrix4) capsule.readSavable("texMatrix", new Matrix4(Matrix4.IDENTITY)));
        _hasBorder = capsule.readBoolean("hasBorder", false);
        _anisotropicFilterPercent = capsule.readFloat("anisotropicFilterPercent", 0.0f);
        _lodBias = capsule.readFloat("lodBias", 0.0f);
        _magnificationFilter = capsule.readEnum("magnificationFilter", MagnificationFilter.class,
View Full Code Here

    public void setName(final String name) {
        this._name = name;
    }

    public void write(final OutputCapsule capsule) throws IOException {
        capsule.write(_ambient, "ambient", new ColorRGBA(DEFAULT_AMBIENT));
        capsule.write(_diffuse, "diffuse", new ColorRGBA(DEFAULT_DIFFUSE));
        capsule.write(_specular, "specular", new ColorRGBA(DEFAULT_SPECULAR));
        capsule.write(_attenuate, "attenuate", false);
        capsule.write(_constant, "constant", 1);
        capsule.write(_linear, "linear", 0);
        capsule.write(_quadratic, "quadratic", 0);
        capsule.write(_lightMask, "lightMask", 0);
View Full Code Here

        capsule.write(_shadowCaster, "shadowCaster", false);
        capsule.write(_name, "name", null);
    }

    public void read(final InputCapsule capsule) throws IOException {
        _ambient.set((ColorRGBA) capsule.readSavable("ambient", new ColorRGBA(DEFAULT_AMBIENT)));
        _diffuse.set((ColorRGBA) capsule.readSavable("diffuse", new ColorRGBA(DEFAULT_DIFFUSE)));
        _specular.set((ColorRGBA) capsule.readSavable("specular", new ColorRGBA(DEFAULT_SPECULAR)));
        _attenuate = capsule.readBoolean("attenuate", false);
        _constant = capsule.readFloat("constant", 1);
        _linear = capsule.readFloat("linear", 0);
        _quadratic = capsule.readFloat("quadratic", 0);
        _lightMask = capsule.readInt("lightMask", 0);
View Full Code Here

    public void write(final OutputCapsule capsule) throws IOException {
        super.write(capsule);
        capsule.write(start, "start", 0);
        capsule.write(end, "end", 0);
        capsule.write(density, "density", 0);
        capsule.write(color, "color", new ColorRGBA(ColorRGBA.WHITE));
        capsule.write(densityFunction, "densityFunction", DensityFunction.Exponential);
        capsule.write(quality, "applyFunction", Quality.PerPixel);
        capsule.write(source, "source", CoordinateSource.Depth);
    }
View Full Code Here

    public void read(final InputCapsule capsule) throws IOException {
        super.read(capsule);
        start = capsule.readFloat("start", 0);
        end = capsule.readFloat("end", 0);
        density = capsule.readFloat("density", 0);
        color.set((ColorRGBA) capsule.readSavable("color", new ColorRGBA(ColorRGBA.WHITE)));
        densityFunction = capsule.readEnum("densityFunction", DensityFunction.class, DensityFunction.Exponential);
        quality = capsule.readEnum("applyFunction", Quality.class, Quality.PerPixel);
        source = capsule.readEnum("source", CoordinateSource.class, CoordinateSource.Depth);
    }
View Full Code Here

        super.write(capsule);
        capsule.writeSavableList(lightList, "lightList", new ArrayList<Light>());
        capsule.write(lightMask, "lightMask", 0);
        capsule.write(backLightMask, "backLightMask", 0);
        capsule.write(twoSidedOn, "twoSidedOn", false);
        capsule.write(_globalAmbient, "globalAmbient", new ColorRGBA(DEFAULT_GLOBAL_AMBIENT));
        capsule.write(localViewerOn, "localViewerOn", false);
        capsule.write(separateSpecularOn, "separateSpecularOn", false);
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.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.