Class OGLTwoSidedMaterial
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.shape.BaseTwoSidedMaterial
org.web3d.vrml.renderer.ogl.nodes.shape.OGLTwoSidedMaterial
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener,VRMLNode,FrameStateListener,VRMLAppearanceChildNodeType,VRMLMaterialNodeType,VRMLNodeType,VRMLSurfaceMaterialNodeType,VRMLVisualMaterialNodeType,OGLMaterialNodeType,OGLVRMLNode
public class OGLTwoSidedMaterial
extends BaseTwoSidedMaterial
implements OGLMaterialNodeType, org.j3d.aviatrix3d.NodeUpdateListener
OpenGL implementation of a material node.
- Version:
- $Revision: 1.3 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.shape.BaseTwoSidedMaterial
FIELD_AMBIENT_INTENSITY, FIELD_BACK_AMBIENT_INTENSITY, FIELD_BACK_DIFFUSE_COLOR, FIELD_BACK_EMISSIVE_COLOR, FIELD_BACK_SHININESS, FIELD_BACK_SPECULAR_COLOR, FIELD_BACK_TRANSPARENCY, FIELD_DIFFUSE_COLOR, FIELD_EMISSIVE_COLOR, FIELD_SEPARATE_BACK_COLOR, FIELD_SHININESS, FIELD_SPECULAR_COLOR, FIELD_TRANSPARENCY, ignoreDiffuse, NUM_FIELDS, vfAmbientIntensity, vfBackAmbientIntensity, vfBackDiffuseColor, vfBackEmissiveColor, vfBackShininess, vfBackSpecularColor, vfBackTransparency, vfDiffuseColor, vfEmissiveColor, vfSeparateBackColor, vfShininess, vfSpecularColor, vfTransparencyFields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
errorReporter, FIELD_METADATA, fieldLocalData, hasChanged, inSetup, isDEF, isStatic, LAST_NODE_INDEX, layerIds, nodeName, pMetadata, refCounts, removedLayerIds, stateManager, STATIC_SCENE_GRAPH, vfMetadata, vrmlMajorVersion, vrmlMinorVersion -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a default instance of the materialConstruct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionorg.j3d.aviatrix3d.MaterialRequest the OpenGL material node structure.org.j3d.aviatrix3d.SceneGraphObjectGet the OpenGL scene graph object representation of this node.voidsetAmbientIntensity(float newAmbientIntensity) Accessor method to set a new value for field attribute ambientIntensity.protected voidsetBackAmbientIntensity(float newAmbientIntensity) Accessor method to set a new value for field attribute ambientIntensity.protected voidsetBackDiffuseColor(float[] newDiffuseColor) Accessor method to set a new value for field attribute diffuseColor.protected voidsetBackEmissiveColor(float[] newEmissiveColor) Accessor method to set a new value for field attribute emissiveColor.protected voidsetBackShininess(float newShininess) Accessor method to set a new value for field attribute shininess.protected voidsetBackSpecularColor(float[] newSpecularColor) Accessor method to set a new value for field attribute specularColor.protected voidsetBackTransparency(float newTransparency) Accessor method to set a new value for field attribute transparency.voidsetDiffuseColor(float[] newDiffuseColor) Accessor method to set a new value for field attribute diffuseColor.voidsetEmissiveColor(float[] newEmissiveColor) Accessor method to set a new value for field attribute emissiveColor.voidsetIgnoreDiffuse(boolean ignore) Ignore the diffuseColor color term and use 1,1,1 for the diffuse color.voidsetLightingEnable(boolean enable) Set whether lighting will be used for this material.voidsetLocalColor(boolean enable, boolean hasAlpha) Set whether the geometry has local colors to override the diffuse color.protected voidsetSeparateBackColor(boolean state) Set a new value for the separated back face colour state.voidsetShininess(float newShininess) Accessor method to set a new value for field attribute shininess.voidsetSpecularColor(float[] newSpecularColor) Accessor method to set a new value for field attribute specularColor.voidsetTransparency(float newTransparency) Accessor method to set a new value for field attribute transparency.voidNotification that the construction phase of this node has finished.voidNotification that its safe to update the node now with any operations that could potentially effect the node's bounds.voidNotification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.Methods inherited from class org.web3d.vrml.renderer.common.nodes.shape.BaseTwoSidedMaterial
addMaterialColorListener, getAmbientIntensity, getDiffuseColor, getEmissiveColor, getFieldDeclaration, getFieldIndex, getFieldValue, getNodeFieldIndices, getNumFields, getPrimaryType, getShininess, getSpecularColor, getTransparency, removeMaterialColorListener, sendRoute, setValue, setValue, setValueMethods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, updateRefCount, updateRefsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsCompleteMethods inherited from interface org.web3d.vrml.nodes.VRMLMaterialNodeType
addMaterialColorListener, getAmbientIntensity, getDiffuseColor, getEmissiveColor, getShininess, getSpecularColor, getTransparency, removeMaterialColorListenerMethods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersionMethods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Constructor Details
-
OGLTwoSidedMaterial
public OGLTwoSidedMaterial()Construct a default instance of the material -
OGLTwoSidedMaterial
Construct a new instance of this node based on the details from the given node. If the node is not the right type, an exception will be thrown.- Parameters:
node- The node to copy- Throws:
IllegalArgumentException- The node is not a Group node
-
-
Method Details
-
getMaterial
public org.j3d.aviatrix3d.Material getMaterial()Request the OpenGL material node structure.- Specified by:
getMaterialin interfaceOGLMaterialNodeType- Returns:
- The material node
-
setLightingEnable
public void setLightingEnable(boolean enable) Set whether lighting will be used for this material. In general you should let the material node decide this. Needed to handle IndexedLineSets or other geometry that specifically declares lighting be turned off.- Specified by:
setLightingEnablein interfaceOGLMaterialNodeType- Parameters:
enable- Whether lighting is enabled
-
setLocalColor
public void setLocalColor(boolean enable, boolean hasAlpha) Set whether the geometry has local colors to override the diffuse color.- Specified by:
setLocalColorin interfaceOGLMaterialNodeType- Parameters:
enable- Whether local color is enabledhasAlpha- true with the local color also contains alpha values
-
setupFinished
public void setupFinished()Notification that the construction phase of this node has finished. If the node would like to do any internal processing, such as setting up geometry, then go for it now.- Specified by:
setupFinishedin interfaceVRMLNodeType- Overrides:
setupFinishedin classAbstractNode
-
setAmbientIntensity
Accessor method to set a new value for field attribute ambientIntensity. How much ambient omnidirectional light is reflected from all light sources.- Specified by:
setAmbientIntensityin interfaceVRMLMaterialNodeType- Overrides:
setAmbientIntensityin classBaseTwoSidedMaterial- Parameters:
newAmbientIntensity- The new intensity value- Throws:
InvalidFieldValueException
-
setDiffuseColor
Accessor method to set a new value for field attribute diffuseColor. How much direct, angle-dependent light is reflected from all light sources.- Specified by:
setDiffuseColorin interfaceVRMLMaterialNodeType- Overrides:
setDiffuseColorin classBaseTwoSidedMaterial- Parameters:
newDiffuseColor- The new value of diffuseColor- Throws:
InvalidFieldValueException
-
setIgnoreDiffuse
public void setIgnoreDiffuse(boolean ignore) Ignore the diffuseColor color term and use 1,1,1 for the diffuse color.- Specified by:
setIgnoreDiffusein interfaceVRMLMaterialNodeType- Overrides:
setIgnoreDiffusein classBaseTwoSidedMaterial- Parameters:
ignore- True to ignore the diffuse term
-
setEmissiveColor
Accessor method to set a new value for field attribute emissiveColor. How much glowing light is emitted from this object.- Specified by:
setEmissiveColorin interfaceVRMLMaterialNodeType- Overrides:
setEmissiveColorin classBaseTwoSidedMaterial- Parameters:
newEmissiveColor- The new value of EmissiveColor- Throws:
InvalidFieldValueException
-
setShininess
Accessor method to set a new value for field attribute shininess. Low values provide soft specular glows, high values provide sharper, smaller highlights.- Specified by:
setShininessin interfaceVRMLMaterialNodeType- Overrides:
setShininessin classBaseTwoSidedMaterial- Parameters:
newShininess- The new value of Shininess- Throws:
InvalidFieldValueException
-
setSpecularColor
Accessor method to set a new value for field attribute specularColor. Specular highlights are brightness reflections (example: shiny spots on an apple).- Specified by:
setSpecularColorin interfaceVRMLMaterialNodeType- Overrides:
setSpecularColorin classBaseTwoSidedMaterial- Parameters:
newSpecularColor- The new value of SpecularColor- Throws:
InvalidFieldValueException
-
setTransparency
Accessor method to set a new value for field attribute transparency. How "clear" an object is: 1.0 is completely transparent, 0.0 is completely opaque .- Specified by:
setTransparencyin interfaceVRMLMaterialNodeType- Overrides:
setTransparencyin classBaseTwoSidedMaterial- Parameters:
newTransparency- The new value of Transparency- Throws:
InvalidFieldValueException
-
getSceneGraphObject
public org.j3d.aviatrix3d.SceneGraphObject getSceneGraphObject()Get the OpenGL scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used. Default implementation returns null.- Specified by:
getSceneGraphObjectin interfaceOGLVRMLNode- Returns:
- The OpenGL representation.
-
updateNodeBoundsChanges
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.- Specified by:
updateNodeBoundsChangesin interfaceorg.j3d.aviatrix3d.NodeUpdateListener- Parameters:
src- The node or Node Component that is to be updated.
-
updateNodeDataChanges
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.- Specified by:
updateNodeDataChangesin interfaceorg.j3d.aviatrix3d.NodeUpdateListener- Parameters:
src- The node or Node Component that is to be updated.
-
setBackAmbientIntensity
Accessor method to set a new value for field attribute ambientIntensity. How much ambient omnidirectional light is reflected from all light sources.- Overrides:
setBackAmbientIntensityin classBaseTwoSidedMaterial- Parameters:
newAmbientIntensity- The new intensity value- Throws:
InvalidFieldValueException
-
setBackDiffuseColor
Accessor method to set a new value for field attribute diffuseColor. How much direct, angle-dependent light is reflected from all light sources.- Overrides:
setBackDiffuseColorin classBaseTwoSidedMaterial- Parameters:
newDiffuseColor- The new value of diffuseColor- Throws:
InvalidFieldValueException
-
setBackEmissiveColor
Accessor method to set a new value for field attribute emissiveColor. How much glowing light is emitted from this object.- Overrides:
setBackEmissiveColorin classBaseTwoSidedMaterial- Parameters:
newEmissiveColor- The new value of EmissiveColor- Throws:
InvalidFieldValueException
-
setBackShininess
Accessor method to set a new value for field attribute shininess. Low values provide soft specular glows, high values provide sharper, smaller highlights.- Overrides:
setBackShininessin classBaseTwoSidedMaterial- Parameters:
newShininess- The new value of Shininess- Throws:
InvalidFieldValueException
-
setBackSpecularColor
Accessor method to set a new value for field attribute specularColor. Specular highlights are brightness reflections (example: shiny spots on an apple).- Overrides:
setBackSpecularColorin classBaseTwoSidedMaterial- Parameters:
newSpecularColor- The new value of SpecularColor- Throws:
InvalidFieldValueException
-
setBackTransparency
Accessor method to set a new value for field attribute transparency. How "clear" an object is: 1.0 is completely transparent, 0.0 is completely opaque .- Overrides:
setBackTransparencyin classBaseTwoSidedMaterial- Parameters:
newTransparency- The new value of Transparency- Throws:
InvalidFieldValueException
-
setSeparateBackColor
Set a new value for the separated back face colour state.- Overrides:
setSeparateBackColorin classBaseTwoSidedMaterial- Parameters:
state- true to use different front from back colours- Throws:
InvalidFieldValueException
-