vrml.eai.field
Class EventOutSFVec3f
java.lang.Object
vrml.eai.field.BaseField
vrml.eai.field.EventOut
vrml.eai.field.EventOutSFVec3f
public abstract class EventOutSFVec3f
- extends EventOut
Reference to a SFVec3f event-out slot. Use this class to read
values from SFVec3f event-out slots.
The following example demonstrates how to get the hit point from
a TouchSensor node:
vrml.eai.Node touchSensor = ...;
vrml.eai.field.EventOutSFVec3f hitPoint_changed = (vrml.eai.field.EventOutSFVec3f)touchSensor.getEventOut("hitPoint_changed");
float[] coord = hitPoint_changed.getValue();
System.out.println("x = " + coord[0] + ", y = " + coord[1] + ", z = " + coord[2]);
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 float[] |
getValue()
Returns the current value of the SFVec3f event-out slot. |
abstract void |
getValue(float[] value)
Returns the current value of the SFVec3f event-out slot. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EventOutSFVec3f
protected EventOutSFVec3f()
- 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.getEventOut(java.lang.String)
method.
getValue
public abstract float[] getValue()
- Returns the current value of the SFVec3f event-out slot.
The following example demonstrates how to get the hit point from
a TouchSensor node:
vrml.eai.Node touchSensor = ...;
vrml.eai.field.EventOutSFVec3f hitPoint_changed = (vrml.eai.field.EventOutSFVec3f)touchSensor.getEventOut("hitPoint_changed");
float[] coord = hitPoint_changed.getValue();
System.out.println("x = " + coord[0] + ", y = " + coord[1] + ", z = " + coord[2]);
- Returns:
- The vector as an array of three float elements. The first element
contains the x component, and the second element the y component,
and the third element the z component.
getValue
public abstract void getValue(float[] value)
throws java.lang.ArrayIndexOutOfBoundsException
- Returns the current value of the SFVec3f event-out slot.
The following example demonstrates how to get the hit point from
a TouchSensor node:
vrml.eai.Node touchSensor = ...;
vrml.eai.field.EventOutSFVec3f hitPoint_changed = (vrml.eai.field.EventOutSFVec3f)touchSensor.getEventOut("hitPoint_changed");
float[] coord = new float[3];
hitPoint_changed.getValue(coord);
System.out.println("x = " + coord[0] + ", y = " + coord[1] + ", z = " + coord[2]);
- Parameters:
value
- An array of at least three float elements that gets filled with
the components of the vector. The first element gets filled with
the x component, the second element with the y component, and the
third element with the z component.
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- when the value array has
less then three elements.