Class SoSFRotation


  • public class SoSFRotation
    extends SoSField
    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:

       0 1 0 3.14159265
    NOTE: When you specify an 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:
    SbRotation, SoField, SoSField, SoMFRotation
    • Method Detail

      • 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

        public void setValue​(SbRotation newValue)
        Sets this field to newValue.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class SoField
      • getValue

        public SbRotation getValue()
        Returns this field's value.
      • setValue

        public void setValue​(SbRotationd rotd)
        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

        public void setValue​(SbVec3f axis,
                             float angle)
        Sets the field to the rotation given by axis/angle.