vrml.eai.field
Class EventInMFVec3f
java.lang.Object
vrml.eai.field.BaseField
vrml.eai.field.EventIn
vrml.eai.field.EventInMFVec3f
public abstract class EventInMFVec3f
- extends EventIn
Reference to a MFVec3f event-in slot. Use this class to write
values into MFVec3f event-in slots.
The following example demonstrates how to write three
position values into the "point" field of a Coordinate
node:
vrml.eai.Node coordinate = ...;
vrml.eai.field.EventInMFVec3f set_point = (vrml.eai.field.EventInMFVec3f)coordinate.getEventIn("set_point");
float[][] v = new float[3][];
v[0] = new float[] { -1.0f, -1.0f, 0.0f }; // lower left
v[1] = new float[] { 1.0f, -1.0f, 0.0f }; // lower right
v[2] = new float[] { 0.0f, 1.0f, 0.0f }; // top center
set_point.setValue(v);
Fields inherited from class vrml.eai.field.BaseField |
MFColor, MFFloat, MFInt32, MFNode, MFRotation, MFString, MFTime, MFVec2f, MFVec3f, SFBool, SFColor, SFFloat, SFImage, SFInt32, SFNode, SFRotation, SFString, SFTime, SFVec2f, SFVec3f |
Method Summary |
abstract void |
set1Value(int index,
float[] value)
Sets one element of the MFVec3f event-in slot. |
abstract void |
setValue(float[][] value)
Sets the elements of the MFVec3f event-in slot. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EventInMFVec3f
protected EventInMFVec3f()
- Default constructor. This method is protected, i.e. you cannot create
new instances of this class. The only way to get instances is via the
Node.getEventIn(java.lang.String)
method.
setValue
public abstract void setValue(float[][] value)
throws java.lang.ArrayIndexOutOfBoundsException
- Sets the elements of the MFVec3f event-in slot.
The following example demonstrates how to write three
position values into the "point" field of a Coordinate
node:
vrml.eai.Node coordinate = ...;
vrml.eai.field.EventInMFVec3f set_point = (vrml.eai.field.EventInMFVec3f)coordinate.getEventIn("set_point");
float[][] v = new float[3][];
v[0] = new float[] { -1.0f, -1.0f, 0.0f }; // lower left
v[1] = new float[] { 1.0f, -1.0f, 0.0f }; // lower right
v[2] = new float[] { 0.0f, 1.0f, 0.0f }; // top center
set_point.setValue(v);
- Parameters:
value
- The new vector values. This is an array of float arrays that
contain at least three values. The first value is the x component
of the vector, the second value the y component, and the third
value the z component.
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- when one of the arrays
in the value parameter contains less than three values.
set1Value
public abstract void set1Value(int index,
float[] value)
throws java.lang.ArrayIndexOutOfBoundsException
- Sets one element of the MFVec3f event-in slot.
The following example demonstrates how to write a new
position value into the first element of the "point" field of a
Coordinate node:
vrml.eai.Node coordinate = ...;
vrml.eai.field.EventInMFVec3f set_point = (vrml.eai.field.EventInMFVec3f)coordinate.getEventIn("set_point");
float[] v = new float[] { -1.0f, -1.0f, 0.0f };
set_point.set1Value(0, v);
- Parameters:
index
- The index of the element, starting at 0.value
- The new vector value. This is an array of
at least three float values. The first value is the x component
of the vector, the second value the y component, and the third value
the z component.
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- when the index is
invalid, or the value array contains less then three values.