/** * Enables or disables lighting for this appearance component object. * @param state true or false to enable or disable lighting * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setLightingEnable(boolean state) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Material15")); if (isLive()) ((MaterialRetained)this.retained).setLightingEnable(state); else ((MaterialRetained)this.retained).initLightingEnable(state); }
/** * Sets this material's shininess. * This specifies a material specular scattering exponent, or * shininess. It takes a floating point number in the range [1.0, 128.0] * with 1.0 being not shiny and 128.0 being very shiny. * Values outside this range are clamped. * @param shininess the material's shininess * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setShininess(float shininess) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Material0")); if (isLive()) ((MaterialRetained)this.retained).setShininess(shininess); else ((MaterialRetained)this.retained).initShininess(shininess); }
/** * Sets this material's emissive color. * This is the color of light, if any, that the material emits. * The emissive color in this Material object may be overridden by * per-vertex colors in some cases. If vertex colors are present * in the geometry, and lighting is enabled, and the colorTarget * is EMISSIVE, and vertex colors are * not being ignored, then the vertex colors are used in place of * this Material's emissive color in the lighting equation. * * @param color the new emissive color * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see RenderingAttributes#setIgnoreVertexColors * @see #setColorTarget */ public void setEmissiveColor(Color3f color) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Material0")); if (isLive()) ((MaterialRetained)this.retained).setEmissiveColor(color); else ((MaterialRetained)this.retained).initEmissiveColor(color); }
/** * Sets this material's emissive color. * This is the color of light, if any, that the material emits. * The emissive color in this Material object may be overridden by * per-vertex colors in some cases. If vertex colors are present * in the geometry, and lighting is enabled, and the colorTarget * is EMISSIVE, and vertex colors are * not being ignored, then the vertex colors are used in place of * this Material's emissive color in the lighting equation. * * @param r the new emissive color's red component * @param g the new emissive color's green component * @param b the new emissive color's blue component * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see RenderingAttributes#setIgnoreVertexColors * @see #setColorTarget */ public void setEmissiveColor(float r, float g, float b) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Material0")); if (isLive()) ((MaterialRetained)this.retained).setEmissiveColor(r,g,b); else ((MaterialRetained)this.retained).initEmissiveColor(r,g,b); }
/** * Sets this material's diffuse color. * This is the color of the material when illuminated by a light source. * The diffuse color in this Material object may be overridden by * per-vertex colors in some cases. If vertex colors are present * in the geometry, and lighting is enabled, and the colorTarget * is either DIFFUSE or AMBIENT_AND_DIFFUSE, and vertex colors are * not being ignored, then the vertex colors are used in place of * this Material's diffuse color in the lighting equation. * * @param r the new diffuse color's red component * @param g the new diffuse color's green component * @param b the new diffuse color's blue component * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see RenderingAttributes#setIgnoreVertexColors * @see #setColorTarget */ public void setDiffuseColor(float r, float g, float b) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Material0")); if (isLive()) ((MaterialRetained)this.retained).setDiffuseColor(r,g,b); else ((MaterialRetained)this.retained).initDiffuseColor(r,g,b); }
/** * Sets this material's diffuse color plus alpha. * This is the color of the material when illuminated by a light source. * The diffuse color in this Material object may be overridden by * per-vertex colors in some cases. If vertex colors are present * in the geometry, and lighting is enabled, and the colorTarget * is either DIFFUSE or AMBIENT_AND_DIFFUSE, and vertex colors are * not being ignored, then the vertex colors are used in place of * this Material's diffuse color in the lighting equation. * * @param r the new diffuse color's red component * @param g the new diffuse color's green component * @param b the new diffuse color's blue component * @param a the alpha component used to set transparency * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see RenderingAttributes#setIgnoreVertexColors * @see #setColorTarget */ public void setDiffuseColor(float r, float g, float b, float a) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Material0")); if (isLive()) ((MaterialRetained)this.retained).setDiffuseColor(r,g,b,a); else ((MaterialRetained)this.retained).initDiffuseColor(r,g,b,a); }
/** * Sets this material's diffuse color. * This is the color of the material when illuminated by a light source. * The diffuse color in this Material object may be overridden by * per-vertex colors in some cases. If vertex colors are present * in the geometry, and lighting is enabled, and the colorTarget * is either DIFFUSE or AMBIENT_AND_DIFFUSE, and vertex colors are * not being ignored, then the vertex colors are used in place of * this Material's diffuse color in the lighting equation. * * @param color the new diffuse color * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see RenderingAttributes#setIgnoreVertexColors * @see #setColorTarget */ public void setDiffuseColor(Color3f color) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Material0")); if (isLive()) ((MaterialRetained)this.retained).setDiffuseColor(color); else ((MaterialRetained)this.retained).initDiffuseColor(color); }
/** * Sets this material's specular color. * This is the specular highlight color of the material. * The specular color in this Material object may be overridden by * per-vertex colors in some cases. If vertex colors are present * in the geometry, and lighting is enabled, and the colorTarget * is SPECULAR, and vertex colors are * not being ignored, then the vertex colors are used in place of * this Material's specular color in the lighting equation. * * @param color the new specular color * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see RenderingAttributes#setIgnoreVertexColors * @see #setColorTarget */ public void setSpecularColor(Color3f color) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Material0")); if (isLive()) ((MaterialRetained)this.retained).setSpecularColor(color); else ((MaterialRetained)this.retained).initSpecularColor(color); }
if (!this.getCapability(ALLOW_COMPONENT_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Material0")); if (isLive()) { ((MaterialRetained)this.retained).setAmbientColor(r,g,b);
throw new CapabilityNotSetException(J3dI18N.getString("Material3")); if (isLive()) ((MaterialRetained)this.retained).setColorTarget(colorTarget); else
/** * Sets this material's specular color. * This is the specular highlight color of the material. * The specular color in this Material object may be overridden by * per-vertex colors in some cases. If vertex colors are present * in the geometry, and lighting is enabled, and the colorTarget * is SPECULAR, and vertex colors are * not being ignored, then the vertex colors are used in place of * this Material's specular color in the lighting equation. * * @param r the new specular color's red component * @param g the new specular color's green component * @param b the new specular color's blue component * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see RenderingAttributes#setIgnoreVertexColors * @see #setColorTarget */ public void setSpecularColor(float r, float g, float b) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Material0")); if (isLive()) ((MaterialRetained)this.retained).setSpecularColor(r,g,b); else ((MaterialRetained)this.retained).initSpecularColor(r,g,b); }
/** * Sets this material's ambient color. * This specifies how much ambient light is reflected by * the surface. * The ambient color in this Material object may be overridden by * per-vertex colors in some cases. If vertex colors are present * in the geometry, and lighting is enabled, and the colorTarget * is either AMBIENT or AMBIENT_AND_DIFFUSE, and vertex colors are * not being ignored, then the vertex colors are used in place of * this Material's ambient color in the lighting equation. * * @param color the material's ambient color * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @see RenderingAttributes#setIgnoreVertexColors * @see #setColorTarget */ public void setAmbientColor(Color3f color) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Material0")); if (isLive()) { ((MaterialRetained)this.retained).setAmbientColor(color); } else { ((MaterialRetained)this.retained).initAmbientColor(color); } }