vrml.eai.field
Class EventInSFRotation
java.lang.Object
vrml.eai.field.BaseField
vrml.eai.field.EventIn
vrml.eai.field.EventInSFRotation
public abstract class EventInSFRotation
- extends EventIn
Reference to a SFRotation event-in slot. Use this class to write
values into SFRotation event-in slots.
The following example demonstrates how to rotate
the children of a Transform node 180 degrees around the
y axis:
vrml.eai.Node transform = ...;
vrml.eai.field.EventInSFRotation set_rotation = (vrml.eai.field.EventInSFRotation)transform.getEventIn("set_rotation");
float x = 0.0f;
float y = 1.0f;
float z = 0.0f;
float angle = (float)Math.PI;
float[] rotation = new float[] { x, y, z, angle };
set_rotation.setValue(rotation);
Fields inherited from class vrml.eai.field.BaseField |
MFColor, MFFloat, MFInt32, MFNode, MFRotation, MFString, MFTime, MFVec2f, MFVec3f, SFBool, SFColor, SFFloat, SFImage, SFInt32, SFMatrix4f, SFNode, SFRotation, SFString, SFTime, SFVec2f, SFVec3f |
Method Summary |
abstract void |
setValue(float[] value)
Sets the value of a SFRotation event-in slot. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EventInSFRotation
protected EventInSFRotation()
- 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 value of a SFRotation event-in slot.
The following example demonstrates how to rotate
the children of a Transform node 180 degrees around the
y axis:
vrml.eai.Node transform = ...;
vrml.eai.field.EventInSFRotation set_rotation = (vrml.eai.field.EventInSFRotation)transform.getEventIn("set_rotation");
float x = 0.0f;
float y = 1.0f;
float z = 0.0f;
float angle = (float)Math.PI;
float[] rotation = new float[] { x, y, z, angle };
set_rotation.setValue(rotation);
- Parameters:
value
- The new rotation value. This is a float array of at
least fout elements. The first three elements are the
x, y and z coordinate of the rotation axis. The fourth
element is the rotation angle, in radians.
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- when the value array
contains less then four values.