Package com.jme3.math

Examples of com.jme3.math.ColorRGBA


        Singleton.get().getAnimSystem().callAction(CallActions.Wounded, defend);
      else
        Singleton.get().getAnimSystem().callAction(CallActions.Defend, defend);
      if(damage != 0){
        VisualComponent comp = (VisualComponent) Singleton.get().getEntityManager().getComponent(defend, VisualComponent.class);
        ColorRGBA color;
        switch(type){
        case 1:color = ColorRGBA.Orange;break;
        case 2:color = ColorRGBA.Yellow;break;
        default:color = ColorRGBA.Red;
        }
View Full Code Here


        size = imageWidth;
        ImageRaster raster = getImageRaster();

        heightData = new float[(imageWidth * imageHeight)];

        ColorRGBA colorStore = new ColorRGBA();
       
        int index = 0;
        if (flipY) {
            for (int h = 0; h < imageHeight; ++h) {
                if (flipX) {
View Full Code Here

        guiNode.attachChild(statsView);
    }
       
    public void loadDarken() {
        Material mat = new Material(app.assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", new ColorRGBA(0,0,0,0.5f));
        mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
       
        darkenFps = new Geometry("StatsDarken", new Quad(200, fpsText.getLineHeight()));
        darkenFps.setMaterial(mat);
        darkenFps.setLocalTranslation(0, 0, -1);
View Full Code Here

    class Range {
        int start;
        ColorRGBA color;
        Range(int start, String colorStr) {
            this.start = start;
            this.color = new ColorRGBA();
            if (colorStr.length() >= 6) {
                color.set(Integer.parseInt(colorStr.subSequence(0,2).toString(), 16) / 255f,
                          Integer.parseInt(colorStr.subSequence(2,4).toString(), 16) / 255f,
                          Integer.parseInt(colorStr.subSequence(4,6).toString(), 16) / 255f,
                          1);
View Full Code Here

    public static ColorRGBA parseColor(Attributes attribs) throws SAXException{
        float r = parseFloat(attribs.getValue("r"));
        float g = parseFloat(attribs.getValue("g"));
        float b = parseFloat(attribs.getValue("b"));
        return new ColorRGBA(r, g, b, 1f);
    }
View Full Code Here

                glDisable(GL_COLOR_MATERIAL);
            }
        } else {
            // Ignore other values as they have no effect when
            // GL_LIGHTING is disabled.
            ColorRGBA color = context.color;
            if (color != null) {
                glColor4f(color.r, color.g, color.b, color.a);
            } else {
                glColor4f(1, 1, 1, 1);
            }
View Full Code Here

       
        for (int i = 0; i < lightList.size(); i++){
            int glLightIndex = GL_LIGHT0 + i;
            Light light = lightList.get(i);
            Light.Type lightType = light.getType();
            ColorRGBA col = light.getColor();
            Vector3f pos;
           
            // Enable the light
            glEnable(glLightIndex);
           
View Full Code Here

        rangeCheck(x, y);
       
        // Check flags for grayscale
        if (codec.isGray) {
            float gray = color.r * 0.27f + color.g * 0.67f + color.b * 0.06f;
            color = new ColorRGBA(gray, gray, gray, color.a);
        }

        switch (codec.type) {
            case ImageCodec.FLAG_F16:
                components[0] = (int) FastMath.convertFloatToHalf(color.a);
View Full Code Here

    public ColorRGBA getPixel(int x, int y, ColorRGBA store) {
        rangeCheck(x, y);
       
        codec.readComponents(getBuffer(), x, y, width, components, temp);
        if (store == null) {
            store = new ColorRGBA();
        }
        switch (codec.type) {
            case ImageCodec.FLAG_F16:
                store.set(FastMath.convertHalfToFloat((short)components[1]),
                          FastMath.convertHalfToFloat((short)components[2]),
View Full Code Here

  public void constructArm() {

    // Material for Robotic Arm
    Material matRoboticArm = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
    matRoboticArm.setBoolean("UseMaterialColors", true);
    matRoboticArm.setColor("Diffuse", new ColorRGBA(.7f, 1.0f, .7f, 1f));
    matRoboticArm.setColor("Specular", new ColorRGBA(.7f, 1.0f, .7f, 1f));
    matRoboticArm.setFloat("Shininess", 50); // [1,128] lower is shinier

    // elongated box for arm sections
    Box box = new Box(new Vector3f(0, 0, SECTION_LENGTH), SECTION_CROSS_DIM, SECTION_CROSS_DIM, SECTION_LENGTH);
    Sphere sphereJoint = new Sphere(20, 20, JOINT_RADIUS);
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.