Package com.jme3.math

Examples of com.jme3.math.ColorRGBA


        float r = ((Number) materialStructure.getFieldValue("r")).floatValue();
        float g = ((Number) materialStructure.getFieldValue("g")).floatValue();
        float b = ((Number) materialStructure.getFieldValue("b")).floatValue();
        float alpha = ((Number) materialStructure.getFieldValue("alpha")).floatValue();
        if ((commonMapto & 0x01) == 0x01) {// Col
            return new ColorRGBA(r, g, b, alpha);
        } else {
            switch (diffuseShader) {
                case FRESNEL:
                case ORENNAYAR:
                case TOON:
                    break;// TODO: find what is the proper modification
                case MINNAERT:
                case LAMBERT:// TODO: check if that is correct
                    float ref = ((Number) materialStructure.getFieldValue("ref")).floatValue();
                    r *= ref;
                    g *= ref;
                    b *= ref;
                    break;
                default:
                    throw new IllegalStateException("Unknown diffuse shader type: " + diffuseShader.toString());
            }
            return new ColorRGBA(r, g, b, alpha);
        }
    }
View Full Code Here


        float specularIntensity = ((Number) materialStructure.getFieldValue("spec")).floatValue();
        float r = ((Number) materialStructure.getFieldValue("specr")).floatValue() * specularIntensity;
        float g = ((Number) materialStructure.getFieldValue("specg")).floatValue() * specularIntensity;
        float b = ((Number) materialStructure.getFieldValue("specb")).floatValue() * specularIntensity;
        float alpha = ((Number) materialStructure.getFieldValue("alpha")).floatValue();
        return new ColorRGBA(r, g, b, alpha);
    }
View Full Code Here

        String[] vals = value.split("\\s");
        if (vals.length != 3 && vals.length != 4) {
            throw new SAXException("Color value must contain 3 or 4 components");
        }

        ColorRGBA color = new ColorRGBA();
        color.r = parseFloat(vals[0]);
        color.g = parseFloat(vals[1]);
        color.b = parseFloat(vals[2]);
        if (vals.length == 3) {
            color.a = 1f;
View Full Code Here

    bulletAppState = new BulletAppState();
    stateManager.attach(bulletAppState);
    // bulletAppState.getPhysicsSpace().enableDebug(assetManager);

    viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f));
    flyCam.setMoveSpeed(100);
    // flyCam.setEnabled(false);
    setUpKeys();
    setUpLight();
View Full Code Here

    ParticleEmitter fire = new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 50);
    Material mat_red = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat_red.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png"));
    fire.setMaterial(mat_red);
    fire.setImagesX(15);
    fire.setEndColor(new ColorRGBA(0f, 0f, 1f, 1f));
    fire.setStartColor(new ColorRGBA(0f, 1f, 1f, 0.5f));
    fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0, .5f, 0));
    fire.setGravity(0, 0, 0);
    fire.setLowLife(1f);
    fire.setHighLife(1.1f);
    fire.getParticleInfluencer().setVelocityVariation(1f);
View Full Code Here

    {
        log.trace("Population scene with debug objects");
       
        //friend
        final Material friendMat = new Material(GlobalObjectStore.<AssetManager>getObject(AssetManager.class), "Common/MatDefs/Misc/Unshaded.j3md");
        friendMat.setColor("Color", new ColorRGBA(0, .5f, 0, 1));
        final Material friendMat2 = new Material(GlobalObjectStore.<AssetManager>getObject(AssetManager.class), "Common/MatDefs/Misc/Unshaded.j3md");
        friendMat2.setColor("Color", new ColorRGBA(.5f, .99f, .5f, 1));
        //foe
        final Material foeMat = new Material(GlobalObjectStore.<AssetManager>getObject(AssetManager.class), "Common/MatDefs/Misc/Unshaded.j3md");
        foeMat.setColor("Color", new ColorRGBA(.5f, 0, 0, 1));
        final Material foeMat2 = new Material(GlobalObjectStore.<AssetManager>getObject(AssetManager.class), "Common/MatDefs/Misc/Unshaded.j3md");
        foeMat2.setColor("Color", new ColorRGBA(.99f, .5f, .5f, 1));

        for(int i = 0; i< 10; ++i)
          createDebugFighter("Friend " + i,friendMat, friendMat2, new Vector3f((float)Math.random()*10, (float)Math.random()*10, (float)Math.random() * 10 + 15));

        for(int i = 0; i< 10; ++i)
View Full Code Here

    ParticleEmitter fire = new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 1);
      Material mat_red = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
      mat_red.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/shockwave.png"));
      fire.setMaterial(mat_red);
      fire.setImagesX(1); fire.setImagesY(1); // 2x2 texture animation
      fire.setEndColornew ColorRGBA(0f, 0f, 0.1f, 1f));  
      fire.setStartColor(new ColorRGBA(0f, 0f, 0.6f, 1f));
      fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0,0,-25f));
      fire.setStartSize(1.5f);
      fire.setEndSize(0.05f);
      fire.setGravity(0,0,0);
//      fire.setLowLife(6f);
View Full Code Here

    setShowSettings(false);
  }

  public void simpleInitApp() {

    viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f));

    LACam = new NoRollLACam(cam){{CanJavaDoThis="IndeedItCan";}};
   
    setUpKeys();
    setUpLight();
View Full Code Here

    material.setTexture("Texture",
        assetManager.loadTexture("effects/smoketrail.png"));
    emitter.setMaterial(material);
    emitter.setImagesX(1);
    emitter.setImagesY(3);
    emitter.setEndColor(new ColorRGBA(0.1f, 0.1f, 0.1f, 0.1f));
    emitter.setStartColor(new ColorRGBA(0.1f, 0.1f, 0.1f, 0.9f));
    emitter.getParticleInfluencer().setInitialVelocity(
        new Vector3f(0f, 0f, 0f));
    emitter.setStartSize(0.3f);
    emitter.setEndSize(0.1f);
    emitter.setGravity(0, 0, 0);
View Full Code Here

    material.setTexture("Texture",
        assetManager.loadTexture("effects/Dust.png"));
    emitter.setMaterial(material);
    emitter.setImagesX(1);
    emitter.setImagesY(1);
    emitter.setEndColor(new ColorRGBA(1f, 1f, 1f, 0.2f));
    emitter.setStartColor(new ColorRGBA(1f, 1f, 1f, 0.1f));
    emitter.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 0, 5f));
    emitter.setStartSize(0.2f);
    emitter.setEndSize(10f);
    emitter.setGravity(0, 0, 0);
    emitter.setLowLife(0.1f);
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.