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);
}
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);
}
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);
}
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);
}
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();
}
Aggregations