public class SoTrackFollower extends SoEngine
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:
TrackFollower {
points | 0 0 0 |
timeStamps | 0 |
radius | 0 |
rollAngle | 0 |
rollSpeed | 0 |
keepRollAngle | false |
headRotation | 0 0 1 0 |
alpha | 0 |
loop | true |
useHeadRotationOnly | false |
See also:
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoSFFloat |
alpha
The value on which the interpolation is made.
|
SoMFRotation |
headRotation
The final rotation applied at a control point, which allows the camera or the object to be rotated while following the track.
|
SoMFBool |
keepRollAngle
Indicates if the roll angle should be maintained after the middle of the turn.
|
SoSFBool |
loop
If loop is true, the animation will loop.
|
SoEngineOutput |
orientation
(
SoSFRotation ) Rotation interpolated from the alpha value. |
SoMFVec3f |
points
Coordinates of the control points.
|
SoEngineOutput |
position
|
SoMFFloat |
radius
Radius of the turn at a control point.
|
SoMFFloat |
rollAngle
Roll angle during the turn at a control point.
|
SoMFFloat |
rollSpeed
Speed at which the roll angle is reached during a turn.
|
SoMFFloat |
timeStamps
Time stamps associated with the control points.
|
SoSFBool |
useHeadRotationOnly
If true, the
orientation output field is a direct interpolation of headRotation values, without taking into consideration the roll angle or the track itself. |
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoTrackFollower()
Constructor.
|
copy, getByName, getOutput, getOutputName
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable, touch
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public final SoMFVec3f points
public final SoMFFloat timeStamps
alpha
value to go from 0 to 1. In other words, the overall speed is controlled by the application or another engine (for example SoVRMLTimeSensor
) 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.
public final SoMFFloat radius
If there are fewer radius values than control points, the value of the last radius is used for the remaining control points.
public final SoMFFloat rollAngle
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.
public final SoMFFloat rollSpeed
If there are fewer rollSpeed values than control points, the value of the last rollSpeed is used for the remaining control points.
public final SoMFBool keepRollAngle
If there are fewer keepRollAngle values than control points, the value of the last keepRollAngle is used for the remaining control points.
public final SoMFRotation headRotation
public final SoSFFloat alpha
public final SoSFBool loop
public final SoSFBool useHeadRotationOnly
orientation
output field is a direct interpolation of headRotation
values, without taking into consideration the roll angle or the track itself.public final SoEngineOutput position
public final SoEngineOutput orientation
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.Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com