Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLNormalNodeType

All Superinterfaces:
FrameStateListener, VRMLGeometricPropertyNodeType, VRMLNode, VRMLNodeType

public interface VRMLNormalNodeType
extends VRMLGeometricPropertyNodeType

Defines a set of 3D surface normals.

Version:
$Revision: 1.8 $
Author:
Alan Hudson

Method Summary
 int getNumNormals()
          Get the number of items in the normal array now.
 void getVector(float[] normals)
          Get current value of field vector.
 float[] getVectorRef()
          Get the internal reference to the raw or converted array of normals.
 void setVector(float[] newVector, int numValid)
          Accessor method to set a new value for field attribute vector.
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLGeometricPropertyNodeType
addComponentListener, removeComponentListener
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
 
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
 
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
 

Method Detail

setVector

void setVector(float[] newVector,
               int numValid)
Accessor method to set a new value for field attribute vector. Vector is an array of triplicates of Vec3f data ie [V3f0-0,V3f0-1,V3f0-2,V3f1-0,V3f1-1,V3f1-2,V3f2...]

Parameters:
newVector - The new value for vector
numValid - The number of valid values to copy from the array
Throws:
java.lang.ArrayIndexOutOfBoundsException

getNumNormals

int getNumNormals()
Get the number of items in the normal array now. The number returned is the total number of values in the flat array. This will allow the caller to construct the correct size array for the getVector() call.

Returns:
The number of values in the array

getVector

void getVector(float[] normals)
Get current value of field vector. Vector is an array of SFVec3f float triples. Don't call if there are no vectors in the array.

Parameters:
normals - The array to copy the vector values into

getVectorRef

float[] getVectorRef()
Get the internal reference to the raw or converted array of normals. Some of the concrete node types end up needing to convert the point values from double precision to single precision or needing to make geo-spatial projections. This is a reference to the post-processed data that may be directly used for rendering.

Note that the array may well be longer than the actual number of valid normals. Use getNumNormals() to determine the number of valid entries.

Returns:
An array of float[] values for rendering process

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium