Package com.openinventor.inventor.fields
Class SoSFRotation
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.fields.SoField
com.openinventor.inventor.fields.SoSField
com.openinventor.inventor.fields.SoSFRotation
Field containing a rotation.
A field containing a single
SbRotation
(an arbitrary rotation).
SoSFRotations are written to file as four floating point values separated by whitespace. The 4 values represent an axis of rotation followed by the amount of right-handed rotation about that axis, in radians. For example, a 180 degree rotation about the Y axis is:
NOTE: When you specify an0 1 0 3.14159265
SoSFRotation
value using setValue with 4 floating point values, those values will be interpreted as a quaternion (x, y, z, w) rather than an axis and a rotation. To specify an SoSFRotation
value using an axis and a rotation, you must use the following method: setValue(const SbVec3f &axis, float angle)
.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.fields.SoField
SoField.FieldTypes
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
ConstructorsConstructorDescriptionSoSFRotation
(SoFieldContainer fieldContainer, String fieldName, SoField.FieldTypes fieldType, SbRotation defaultValue) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getValue()
Returns this field's value.void
setValue
(float[] q) Sets the field to the given quaternion (x, y, z, w).void
setValue
(float q0, float q1, float q2, float q3) Sets the field to the given quaternion (x, y, z, w).void
setValue
(SbRotation newValue) Sets this field to newValue.void
setValue
(SbRotationd rotd) Convenience method that allows you to specify a field value using a double precision variable.void
Sets the field to the rotation given by axis/angle.Methods inherited from class com.openinventor.inventor.fields.SoField
appendConnection, appendConnection, connectFrom, connectFrom, disconnect, disconnect, disconnect, enableConnection, get, getConnectedEngine, getConnectedField, getContainer, getNumConnections, getValueSize, isConnected, isConnectedFromEngine, isConnectedFromField, isConnectedFromVRMLInterp, isConnectionEnabled, isDefault, isIgnored, set, setIgnored, touch
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
Constructor Details
-
SoSFRotation
public SoSFRotation(SoFieldContainer fieldContainer, String fieldName, SoField.FieldTypes fieldType, SbRotation defaultValue) Default constructor.
-
-
Method Details
-
setValue
public void setValue(float q0, float q1, float q2, float q3) Sets the field to the given quaternion (x, y, z, w). -
setValue
public void setValue(float[] q) Sets the field to the given quaternion (x, y, z, w). -
setValue
Sets this field to newValue. -
equals
-
getValue
Returns this field's value. -
setValue
Convenience method that allows you to specify a field value using a double precision variable. Note that Open Inventor fields still store only single precision values, not double precision values. The specified value is converted to single precision, then stored. -
setValue
Sets the field to the rotation given by axis/angle.
-