vrml.eai.field
Class EventInMFRotation
java.lang.Object
vrml.eai.field.BaseField
vrml.eai.field.EventIn
vrml.eai.field.EventInMFRotation
public abstract class EventInMFRotation
- extends EventIn
Reference to a MFRotation event-in slot. Use this class to write
values into MFRotation event-in slots.
The following example demonstrates how to write five
rotations into the "keyValue" field of an OrientationInterpolator
node:
vrml.eai.Node orientationInterpolator = ...;
vrml.eai.field.EventInMFRotation set_keyValue = (vrml.eai.field.EventInMFRotation)orientationInterpolator.getEventIn("set_keyValue");
float[][] r = new float[5][];
r[0] = new float[] { 0.0f, 1.0f, 0.0f, 0.0f }; // no rotation
r[1] = new float[] { 0.0f, 1.0f, 0.0f, 1.5708f }; // 90 degrees around the y axis
r[2] = new float[] { 0.0f, 1.0f, 0.0f, 3.1416f }; // 180 degrees around the y axis
r[3] = new float[] { 0.0f, 1.0f, 0.0f, 4.7124f }; // 270 degress around the y axis
r[4] = new float[] { 0.0f, 1.0f, 0.0f, 0.0f }; // no rotation
set_keyValue.setValue(r);
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 MFRotation event-in slot. |
abstract void |
setValue(float[][] value)
Sets the elements of the MFRotation event-in slot. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EventInMFRotation
protected EventInMFRotation()
- 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 MFRotation event-in slot.
The following example demonstrates how to write five
rotations into the "keyValue" field of an OrientationInterpolator
node:
vrml.eai.Node orientationInterpolator = ...;
vrml.eai.field.EventInMFRotation set_keyValue = (vrml.eai.field.EventInMFRotation)orientationInterpolator.getEventIn("set_keyValue");
float[][] r = new float[5][];
r[0] = new float[] { 0.0f, 1.0f, 0.0f, 0.0f }; // no rotation
r[1] = new float[] { 0.0f, 1.0f, 0.0f, 1.5708f }; // 90 degrees around the y axis
r[2] = new float[] { 0.0f, 1.0f, 0.0f, 3.1416f }; // 180 degrees around the y axis
r[3] = new float[] { 0.0f, 1.0f, 0.0f, 4.7124f }; // 270 degress around the y axis
r[4] = new float[] { 0.0f, 1.0f, 0.0f, 0.0f }; // no rotation
set_keyValue.setValue(r);
- Parameters:
value
- The new rotation values. This is an array of float arrays that
contain at least four values. The first value is the x component
of the rotation axis, the second value the y component, the
third value the z component, and the fourth value the rotation
angle in radians.
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- when one of the arrays
in the value parameter contains less than four values.
set1Value
public abstract void set1Value(int index,
float[] value)
throws java.lang.ArrayIndexOutOfBoundsException
- Sets one element of the MFRotation event-in slot.
The following example demonstrates how to write a rotation
into the first element of the "keyValue" field of an OrientationInterpolator
node:
vrml.eai.Node orientationInterpolator = ...;
vrml.eai.field.EventInMFRotation set_keyValue = (vrml.eai.field.EventInMFRotation)orientationInterpolator.getEventIn("set_keyValue");
float[] r = new float[] { 0.0f, 1.0f, 0.0f, 0.0f }; // no rotation
set_keyValue.set1Value(0, r);
- Parameters:
index
- The index of the element, starting at 0.value
- The new rotation value. This is an array of
at least four float values. The first value is the x component
of the rotation axis, the second value the y component, the third value
the z component, and the fourth value the rotation angle in radians.
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- when the index is
invalid, or the value array contains less then four values.