SoTrackFollower Class Reference
[Engines]

VSG extension Animates an object or camera along a track More...

#include <Inventor/engines/SoTrackFollower.h>

Inheritance diagram for SoTrackFollower:
SoEngine SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Public Member Functions

virtual SoType getTypeId () const
 SoTrackFollower ()

Static Public Member Functions

static SoType getClassTypeId ()

Public Attributes

SoMFVec3f points
SoMFFloat timeStamps
SoMFFloat radius
SoMFFloat rollAngle
SoMFFloat rollSpeed
SoMFBool keepRollAngle
SoMFRotation headRotation
SoSFFloat alpha
SoSFBool loop
SoSFBool useHeadRotationOnly
SoEngineOutput position
SoEngineOutput orientation

Detailed Description

VSG extension Animates an object or camera along a track

This engine is designed to add animations to a scene graph. It manages a track that can be followed either by an object (a sub scene graph) or by a camera. The track is defined by a set of control points. Each control point can be associated with a time stamp, a turn angle, roll information, and a head rotation. Only the points field is required. All other data fields are optional.

The input that drives the animation is the alpha field. This value should vary between 0 and 1, assuming 0 as the position and orientation at the first control point, and 1 as the position and orientation at the last control point. Alpha values are clamped to the interval [0,1]. An SoTimerSensor or other engines can be used to dynamically modify the alpha value.

The outputs are a position field and an orientation field that can be connected directly to the corresponding fields of an SoCamera or SoTransform node (see SoField::connectFrom). The values of these fields are computed by interpolating the track points with the alpha field value.

The rollAngle values are only used if the track specified by the points field is curved.

An example .iv file using SoTrackFollower is provided in the directory $OIVHOME/data/models/toys/TrackSample.

FILE FORMAT/DEFAULT

SEE ALSO

SoInterpolate


Constructor & Destructor Documentation

SoTrackFollower::SoTrackFollower (  ) 

Constructor.


Member Function Documentation

static SoType SoTrackFollower::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoEngine.

virtual SoType SoTrackFollower::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Implements SoTypedObject.


Member Data Documentation

The value on which the interpolation is made.

It must between 0.0 and 1.0.

The final rotation applied at a control point, which allows the camera or the object to be rotated while following the track.

If there are fewer headRotation values than control points, the value of the last headRotation is used for the remaining control points.

Indicates if the roll angle should be maintained after the middle of the turn.

If this flag is set to TRUE for a control point, the roll speed is assumed to be 1 in the second part of the turn for the current control point and in the first part of the turn for the next control point. This allows the roll angle to be maintained between two adjacent turns.

If there are fewer keepRollAngle values than control points, the value of the last keepRollAngle is used for the remaining control points.

If loop is TRUE, the animation will loop.

For N control points, there must be N+1 time stamps. The last time stamp is used for interpolating between the last control point and the first control point at the end of the animation loop. For example, if there are four points (P1, P2, P3, and P4), there must be five time stamps (T1,... T5) as shown below:

tracker_loop.gif

(SoSFRotation) Rotation interpolated from the alpha value.

It's a rotation from the -Z vector to the heading vector, with the initial up vector along the Y vector.

Coordinates of the control points.

(SoSFVec3f) Position interpolated from the alpha value.

Radius of the turn at a control point.

If radius is zero for a control point (the default), the orientation changes immediately when the animation reachs that point. For many animations this is an unrealistic or undesirable behavior. Radius values allow the orientation to change smoothly, following a curve.

If there are fewer radius values than control points, the value of the last radius is used for the remaining control points.

Roll angle during the turn at a control point.

The roll angle inclines the track inside the turn. If the specified roll angle is negative, the track is inclined outside the turn.

If rollAngle is zero for a control point (the default), the animated object will rotate around a vector perpendicular to the plane defined by the preceding and following segments of the track. This is typically the desired behavior, for example, when animating a vehicle on the ground. However rollAngle allows a more realistic animation of a flying vehicle.

If there are fewer rollAngle values than control points, the value of the last rollAngle is used for the remaining control points.

Speed at which the roll angle is reached during a turn.

By default, (value = 0) the roll angle varies from 0 at the beginning of the turn to the specified roll angle value in the middle of the turn and then back to 0 at the end of the turn. A value of 1 means the roll angle is immediately reached at the begining of the turn. Intermediate values vary the point at which the full roll angle is reached.

If there are fewer rollSpeed values than control points, the value of the last rollSpeed is used for the remaining control points.

Time stamps associated with the control points.

A time stamp represents the time at which a control point must be reached; the "scale" of the time is independent of the animation time. However, it is proportional to it. For example, if point 1 has a time stamp value of 10, point 2 has a time stamp value of 30, and point 3 has a time stamp value of 40, it means that the interpolation will take twice as long to go from point 1 to point 2 (20 time units) as it will to go from point 2 to point 3 (10 time units). The actual time to complete an animation, and therefore the overall speed, is determined by the time it takes for the alpha value to go from 0 to 1. In other words, the overall speed is controlled by the application or another engine which is updating the alpha input.

If a time stamp has a value of SO_UNDEFINED_TIME_STAMP (default value), then the computed time stamp is proportional to the distance between the previous and the next control point, i.e., speed is constant. If all the time stamps are set to SO_UNDEFINED_TIME_STAMP or are not set at all, they are all computed to be proportional to the distance between the points, and speed is constant over the entire track.

If the time stamp field contains one more value than the points field, the last time stamp is assumed to apply to the first/last control point in a loop. If fewer than 3 time stamps are provided, the track is interpolated proportional to the distance between control points.

If TRUE, the orientation output field is a direct interpolation of headRotation values, without taking into consideration the roll angle or the track itself.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 4 Sep 2023
Copyright © Thermo Fisher Scientific All rights reserved.
https://www.openinventor.com/