Class SoPendulum

  • All Implemented Interfaces:
    SafeDisposable

    public class SoPendulum
    extends SoRotation
    Animated oscillating rotation node. The SoPendulum class is derived from SoRotation, so it applies a rotation to the current transformation. Using engines connected to the realTime global field, the rotation value is animated over time between two fixed rotations, achieving the effect of a swinging pendulum. The period of the swing can be adjusted by changing the speed field. The current rotation at any time is available in the rotation field, inherited from SoRotation

    File format/default:

    Pendulum {

      rotation 0 0 1 0
      rotation0 0 0 1 0
      rotation1 0 0 1 0
      speed 1
      on true
    }

    Action behavior:

    SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoRayPickAction
    Concatenates interpolated rotation value with the current transformation matrix.

    SoGetMatrixAction
    Returns transformation matrix specified by the interpolated rotation.

    See Also:
    SoRotor, SoShuttle
    • Field Detail

      • rotation0

        public final SoSFRotation rotation0
        Defines the first of the two fixed rotations that are interpolated to create the pendular motion.
      • rotation1

        public final SoSFRotation rotation1
        Defines the second of the two fixed rotations that are interpolated to create the pendular motion.
      • speed

        public final SoSFFloat speed
        Defines the speed of the pendulum, in cycles per second.
      • on

        public final SoSFBool on
        Allows applications to enable or disable the motion easily.
    • Constructor Detail

      • SoPendulum

        public SoPendulum()
        Creates a pendulum node with default settings.