/** * Sets the colors of all ranges, overriding any color tags * that were in the original text. */ void setBaseColor( ColorRGBA color ) { // There are times when the alpha is directly modified // and the caller may have passed a constant... so we // should clone it. color = color.clone(); for( Range r : colors ) { r.color = color; } }
@Override public Light clone(){ try { Light l = (Light) super.clone(); l.color = color.clone(); return l; } catch (CloneNotSupportedException ex) { throw new AssertionError(); } }
@Override public StringBlock clone(){ try { StringBlock clone = (StringBlock) super.clone(); clone.color = color.clone(); if (textBox != null) clone.textBox = textBox.clone(); return clone; } catch (CloneNotSupportedException ex) { throw new AssertionError(); } }
@Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule oc = ex.getCapsule(this); oc.write(fogColor, "fogColor", ColorRGBA.White.clone()); oc.write(fogDensity, "fogDensity", 0.7f); oc.write(fogDistance, "fogDistance", 1000); }
@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); }
material.setColor("Color", diffuse.clone()); material.setTexture("ColorMap", diffuseMap); material = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md"); material.setBoolean("UseMaterialColors", true); material.setColor("Ambient", ambient.clone()); material.setColor("Diffuse", diffuse.clone()); material.setColor("Specular", specular.clone()); material.setFloat("Shininess", shininess); // prevents "premature culling" bug
public IrVertex deepClone() { IrVertex v = new IrVertex(); v.pos = pos != null ? pos.clone() : null; v.norm = norm != null ? norm.clone() : null; v.tang4d = tang4d != null ? tang4d.clone() : null; v.tang = tang != null ? tang.clone() : null; v.bitang = bitang != null ? bitang.clone() : null; v.uv0 = uv0 != null ? uv0.clone() : null; v.uv1 = uv1 != null ? uv1.clone() : null; v.color = color != null ? color.clone() : null; v.material = material; v.smoothing = smoothing; if (boneWeightsIndices != null) { v.boneWeightsIndices = new IrBoneWeightIndex[boneWeightsIndices.length]; for (int i = 0; i < boneWeightsIndices.length; i++) { v.boneWeightsIndices[i] = (IrBoneWeightIndex) boneWeightsIndices[i].clone(); } } return v; }
sun.setColor(ColorRGBA.White.clone().multLocal(2)); scene.addLight(sun);
public void setupFloor() { Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m"); mat.getTextureParam("DiffuseMap").getTextureValue().setWrap(WrapMode.Repeat); mat.getTextureParam("NormalMap").getTextureValue().setWrap(WrapMode.Repeat); mat.setBoolean("UseMaterialColors", true); mat.setColor("Diffuse", ColorRGBA.White.clone()); mat.setColor("Ambient", ColorRGBA.White.clone()); // mat.setColor("Specular", ColorRGBA.White.clone()); // mat.getTextureParam("ParallaxMap").getTextureValue().setWrap(WrapMode.Repeat); mat.setFloat("Shininess", 0); // mat.setBoolean("VertexLighting", true); Box floor = new Box(50, 1f, 50); TangentBinormalGenerator.generate(floor); floor.scaleTextureCoordinates(new Vector2f(5, 5)); Geometry floorGeom = new Geometry("Floor", floor); floorGeom.setMaterial(mat); floorGeom.setShadowMode(ShadowMode.Receive); rootNode.attachChild(floorGeom); }
Vector3f lightDir = new Vector3f(-0.37352666f, -0.50444174f, -0.7784704f); sun.setDirection(lightDir); sun.setColor(ColorRGBA.White.clone().multLocal(2)); scene.addLight(sun);
public void simpleInitApp() { this.flyCam.setMoveSpeed(50); Node mainScene=new Node(); cam.setLocation(new Vector3f(-34.74095f, 95.21318f, -287.4945f)); cam.setRotation(new Quaternion(0.023536969f, 0.9361278f, -0.016098259f, -0.35050195f)); // load sky mainScene.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", SkyFactory.EnvMapType.CubeMap)); createTerrain(mainScene); DirectionalLight sun = new DirectionalLight(); Vector3f lightDir=new Vector3f(-0.37352666f, -0.50444174f, -0.7784704f); sun.setDirection(lightDir); sun.setColor(ColorRGBA.White.clone().multLocal(2)); mainScene.addLight(sun); rootNode.attachChild(mainScene); fpp=new FilterPostProcessor(assetManager); //fpp.setNumSamples(4); int numSamples = getContext().getSettings().getSamples(); if( numSamples > 0 ) { fpp.setNumSamples(numSamples); } fog=new FogFilter(); fog.setFogColor(new ColorRGBA(0.9f, 0.9f, 0.9f, 1.0f)); fog.setFogDistance(155); fog.setFogDensity(1.0f); fpp.addFilter(fog); viewPort.addProcessor(fpp); initInputs(); }
Vector3f lightDir=new Vector3f(-0.37352666f, -0.50444174f, -0.7784704f); sun.setDirection(lightDir); sun.setColor(ColorRGBA.White.clone().multLocal(2)); scene.addLight(sun);
Vector3f lightDir = new Vector3f(-0.12f, -0.3729129f, 0.74847335f); sun.setDirection(lightDir); sun.setColor(ColorRGBA.White.clone().multLocal(2)); scene.addLight(sun);
sun.setColor(ColorRGBA.White.clone().multLocal(2)); rootNode.addLight(sun);
dl.setColor(ColorRGBA.White.clone().multLocal(2)); dl.setDirection(new Vector3f(-1, -1, -1).normalize()); rootNode.addLight(dl);
sun.setColor(ColorRGBA.White.clone().multLocal(2)); scene.addLight(sun);
mat[1].setBoolean("UseMaterialColors", true); mat[1].setColor("Ambient", ColorRGBA.White); mat[1].setColor("Diffuse", ColorRGBA.White.clone());
DirectionalLight sun = new DirectionalLight(); sun.setDirection(lightDir); sun.setColor(ColorRGBA.White.clone().multLocal(1.7f)); mainScene.addLight(sun);