Search in sources :

Example 86 with ColorRGBA

use of com.jme3.math.ColorRGBA in project jmonkeyengine by jMonkeyEngine.

the class WaterFilter method read.

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    speed = ic.readFloat("speed", 1f);
    lightDirection = (Vector3f) ic.readSavable("lightDirection", new Vector3f(0, -1, 0));
    lightColor = (ColorRGBA) ic.readSavable("lightColor", ColorRGBA.White);
    waterHeight = ic.readFloat("waterHeight", 0.0f);
    waterColor = (ColorRGBA) ic.readSavable("waterColor", new ColorRGBA(0.0078f, 0.3176f, 0.5f, 1.0f));
    deepWaterColor = (ColorRGBA) ic.readSavable("deepWaterColor", new ColorRGBA(0.0039f, 0.00196f, 0.145f, 1.0f));
    colorExtinction = (Vector3f) ic.readSavable("colorExtinction", new Vector3f(5.0f, 20.0f, 30.0f));
    waterTransparency = ic.readFloat("waterTransparency", 0.1f);
    maxAmplitude = ic.readFloat("maxAmplitude", 1.5f);
    shoreHardness = ic.readFloat("shoreHardness", 0.1f);
    useFoam = ic.readBoolean("useFoam", true);
    foamIntensity = ic.readFloat("foamIntensity", 0.5f);
    foamHardness = ic.readFloat("foamHardness", 1.0f);
    foamExistence = (Vector3f) ic.readSavable("foamExistence", new Vector3f(0.45f, 4.35f, 1.5f));
    waveScale = ic.readFloat("waveScale", 0.005f);
    sunScale = ic.readFloat("sunScale", 3.0f);
    shininess = ic.readFloat("shininess", 0.7f);
    windDirection = (Vector2f) ic.readSavable("windDirection", new Vector2f(0.0f, -1.0f));
    reflectionMapSize = ic.readInt("reflectionMapSize", 512);
    useRipples = ic.readBoolean("useRipples", true);
    normalScale = ic.readFloat("normalScale", 3.0f);
    useHQShoreline = ic.readBoolean("useHQShoreline", true);
    useSpecular = ic.readBoolean("useSpecular", true);
    useRefraction = ic.readBoolean("useRefraction", true);
    refractionStrength = ic.readFloat("refractionStrength", 0.0f);
    refractionConstant = ic.readFloat("refractionConstant", 0.5f);
    reflectionDisplace = ic.readFloat("reflectionDisplace", 30f);
    underWaterFogDistance = ic.readFloat("underWaterFogDistance", 120f);
    causticsIntensity = ic.readFloat("causticsIntensity", 0.5f);
    useCaustics = ic.readBoolean("useCaustics", true);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 87 with ColorRGBA

use of com.jme3.math.ColorRGBA in project jmonkeyengine by jMonkeyEngine.

the class FogFilter method read.

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule ic = im.getCapsule(this);
    fogColor = (ColorRGBA) ic.readSavable("fogColor", ColorRGBA.White.clone());
    fogDensity = ic.readFloat("fogDensity", 0.7f);
    fogDistance = ic.readFloat("fogDistance", 1000);
}
Also used : InputCapsule(com.jme3.export.InputCapsule)

Example 88 with ColorRGBA

use of com.jme3.math.ColorRGBA in project jmonkeyengine by jMonkeyEngine.

the class TestRagdollCharacter method setupLight.

private void setupLight() {
    DirectionalLight dl = new DirectionalLight();
    dl.setDirection(new Vector3f(-0.1f, -0.7f, -1).normalizeLocal());
    dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f));
    rootNode.addLight(dl);
}
Also used : ColorRGBA(com.jme3.math.ColorRGBA) DirectionalLight(com.jme3.light.DirectionalLight) Vector3f(com.jme3.math.Vector3f)

Example 89 with ColorRGBA

use of com.jme3.math.ColorRGBA in project jmonkeyengine by jMonkeyEngine.

the class TestAssetLinkNode method simpleInitApp.

@Override
public void simpleInitApp() {
    AssetLinkNode loaderNode = new AssetLinkNode();
    loaderNode.addLinkedChild(new ModelKey("Models/MonkeyHead/MonkeyHead.mesh.xml"));
    //save and load the loaderNode
    try {
        //export to byte array
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        BinaryExporter.getInstance().save(loaderNode, bout);
        //import from byte array, automatically loads the monkeyhead from file
        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
        BinaryImporter imp = BinaryImporter.getInstance();
        imp.setAssetManager(assetManager);
        Node newLoaderNode = (Node) imp.load(bin);
        //attach to rootNode
        rootNode.attachChild(newLoaderNode);
    } catch (IOException ex) {
        Logger.getLogger(TestAssetLinkNode.class.getName()).log(Level.SEVERE, null, ex);
    }
    rootNode.attachChild(loaderNode);
    lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
    lightMdl.setMaterial((Material) assetManager.loadAsset(new AssetKey("Common/Materials/RedColor.j3m")));
    rootNode.attachChild(lightMdl);
    // flourescent main light
    pl = new PointLight();
    pl.setColor(new ColorRGBA(0.88f, 0.92f, 0.95f, 1.0f));
    rootNode.addLight(pl);
    // sunset light
    DirectionalLight dl = new DirectionalLight();
    dl.setDirection(new Vector3f(-0.1f, -0.7f, 1).normalizeLocal());
    dl.setColor(new ColorRGBA(0.44f, 0.30f, 0.20f, 1.0f));
    rootNode.addLight(dl);
    // skylight
    dl = new DirectionalLight();
    dl.setDirection(new Vector3f(-0.6f, -1, -0.6f).normalizeLocal());
    dl.setColor(new ColorRGBA(0.10f, 0.22f, 0.44f, 1.0f));
    rootNode.addLight(dl);
    // white ambient light
    dl = new DirectionalLight();
    dl.setDirection(new Vector3f(1, -0.5f, -0.1f).normalizeLocal());
    dl.setColor(new ColorRGBA(0.50f, 0.40f, 0.50f, 1.0f));
    rootNode.addLight(dl);
}
Also used : ModelKey(com.jme3.asset.ModelKey) AssetLinkNode(com.jme3.scene.AssetLinkNode) Node(com.jme3.scene.Node) AssetLinkNode(com.jme3.scene.AssetLinkNode) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException) Geometry(com.jme3.scene.Geometry) Sphere(com.jme3.scene.shape.Sphere) BinaryImporter(com.jme3.export.binary.BinaryImporter) AssetKey(com.jme3.asset.AssetKey) ColorRGBA(com.jme3.math.ColorRGBA) ByteArrayInputStream(java.io.ByteArrayInputStream) DirectionalLight(com.jme3.light.DirectionalLight) Vector3f(com.jme3.math.Vector3f) PointLight(com.jme3.light.PointLight)

Example 90 with ColorRGBA

use of com.jme3.math.ColorRGBA in project jmonkeyengine by jMonkeyEngine.

the class CubeField method simpleInitApp.

/**
     * Initializes game 
     */
@Override
public void simpleInitApp() {
    Logger.getLogger("com.jme3").setLevel(Level.WARNING);
    flyCam.setEnabled(false);
    setDisplayStatView(false);
    Keys();
    defaultFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
    pressStart = new BitmapText(defaultFont, false);
    fpsScoreText = new BitmapText(defaultFont, false);
    loadText(fpsScoreText, "Current Score: 0", defaultFont, 0, 2, 0);
    loadText(pressStart, "PRESS ENTER", defaultFont, 0, 5, 0);
    player = createPlayer();
    rootNode.attachChild(player);
    cubeField = new ArrayList<Geometry>();
    obstacleColors = new ArrayList<ColorRGBA>();
    gameReset();
}
Also used : Geometry(com.jme3.scene.Geometry) BitmapText(com.jme3.font.BitmapText) ColorRGBA(com.jme3.math.ColorRGBA)

Aggregations

ColorRGBA (com.jme3.math.ColorRGBA)98 Vector3f (com.jme3.math.Vector3f)65 Material (com.jme3.material.Material)44 DirectionalLight (com.jme3.light.DirectionalLight)42 Geometry (com.jme3.scene.Geometry)23 ParticleEmitter (com.jme3.effect.ParticleEmitter)14 PointLight (com.jme3.light.PointLight)14 Quaternion (com.jme3.math.Quaternion)14 Spatial (com.jme3.scene.Spatial)14 AmbientLight (com.jme3.light.AmbientLight)13 Sphere (com.jme3.scene.shape.Sphere)12 Node (com.jme3.scene.Node)11 KeyTrigger (com.jme3.input.controls.KeyTrigger)10 FilterPostProcessor (com.jme3.post.FilterPostProcessor)10 Texture (com.jme3.texture.Texture)9 BulletAppState (com.jme3.bullet.BulletAppState)8 RigidBodyControl (com.jme3.bullet.control.RigidBodyControl)7 Quad (com.jme3.scene.shape.Quad)7 TextureCubeMap (com.jme3.texture.TextureCubeMap)7 EmitterSphereShape (com.jme3.effect.shapes.EmitterSphereShape)6