Skip to content

niPathController⚓︎

A controller that moves an object along a path, while orienting it to face the travel direction. It has multiple options for the pointing and facing behaviours.

This type inherits the following: niTimeController, niObject

Properties⚓︎

active⚓︎

If the controller is active. When inactive, the target does not get updated and animation timing does not advance.

Returns:

  • result (boolean)

allowFlip⚓︎

Changes how the up vector of the local coordinate frame is calculated. When disabled, it will align towards the +Z axis. When enabled, it will use the local path derivatives with smoothing controlled by smoothing. This allows the object to turn upside down, but orientation changes at keyframes may be jerky.

Returns:

  • result (boolean)

animTimingType⚓︎

How the time parameter passed to the update function is treated. Type 0 is the default, which treats the update time as a delta time. Type 1 treats the update time an offset from the start of the animation.

Maps to values in ni.animType table.

Returns:


bank⚓︎

Controls if banking behaviour is enabled. The target object will roll so that its top side faces inside/outside the path, depending on bankDirection.

Returns:

  • result (boolean)

Temporary name. Some other scalar property related to the banking logic.

Returns:

  • result (number)

bankDirection⚓︎

The banking alignment direction used when bank mode is enabled. 1 = bank inside, -1 = bank outside.

Returns:

  • result (number)

constantVelocity⚓︎

Controls if constant velocity behaviour is enabled. It specifies if the curve represented by the path keyframe data should be parameterized by arc length when enabled, or by time when disabled.

Returns:

  • result (boolean)

cycleType⚓︎

The animation cycle type. Type 0 is looping, type 2 is reverse, type 4 is clamped.

Maps to values in ni.animCycleType table.

Returns:


flipFollowAxis⚓︎

Selects the + or - axis direction of the object that points along the path. Combines with followAxis to fully specify the axis.

Returns:

  • result (boolean)

follow⚓︎

Controls if follow behaviour is enabled. This sets if the controller orients the target object to point along the path.

Returns:

  • result (boolean)

followAxis⚓︎

Selects the axis of the object that points along the path. X = 0, Y = 1, Z = 2. Combines with flipFollowAxis to fully specify the axis.

Returns:

  • result (number)

frequency⚓︎

The animation controller's frequency value. It is a scaling value used to convert from update time units to keyframe time units, if necessary.

Returns:

  • result (number)

highKeyFrame⚓︎

This is the end animation key time of the animation controller.

Returns:

  • result (number)

lastScaledTime⚓︎

This function returns the last scaled time computed by this controller. The scaled time takes the frequency and phase into account, along with the cycleType and animTimingType. This is the last value used to interpolate animation keys.

Returns:

  • result (number)

lastTime⚓︎

No description.

Returns:

  • result (number)

lastUsedPathIndex⚓︎

The last path position index that the game engine used.

Returns:

  • result (number)

lastUsedPercentIndex⚓︎

The last path percent index that the game engine used.

Returns:

  • result (number)

lowKeyFrame⚓︎

This is the beginning animation key time of the animation controller.

Returns:

  • result (number)

maxBankAngle⚓︎

Maximum bank angle in radians. Used when bank mode is enabled.

Returns:

  • result (number)

nextController⚓︎

The next animation controller in the list of controllers containing the calling controller.

Returns:


openCurve⚓︎

Controls if the curve is open. This ensures correct wraparound for interpolation.

Returns:

  • result (boolean)

pathData⚓︎

Read-only. The path position animation data used by the controller.

Returns:

  • result (niPosData)

percentData⚓︎

Read-only. The path percent animation data used by the controller.

Returns:

  • result (niFloatData)

phase⚓︎

The phase value. It is an offset applied to the animation's update time, in seconds.

Returns:

  • result (number)

refCount⚓︎

Read-only. The number of references that exist for this object. When this value reaches zero, the object will be deleted.

Returns:

  • result (number)

RTTI⚓︎

Read-only. The runtime type information for this object. This is an alias for the .runTimeTypeInformation property.

Returns:


runTimeTypeInformation⚓︎

Read-only. The runtime type information for this object.

Returns:


smoothing⚓︎

Smoothing distance threshold parameter used by allowFlip mode.

Returns:

  • result (number)

startTime⚓︎

The time at which the animation controller starts playing its animation.

Returns:

  • result (number)

target⚓︎

Read-only. The scene graph object that this animation controller is to animate.

Returns:


totalLength⚓︎

The calculated total arc length of the path.

Returns:

  • result (number)

Methods⚓︎

clone⚓︎

Creates a copy of this object.

local result = myObject:clone()

Returns:


isInstanceOfType⚓︎

Determines if the object is of a given type, or of a type derived from the given type.

local result = myObject:isInstanceOfType(type)

Parameters:

Returns:

  • result (boolean)

isOfType⚓︎

Determines if the object is of a given type.

local result = myObject:isOfType(type)

Parameters:

Returns:

  • result (boolean)

saveBinary⚓︎

Serializes the object, and writes it to the given file.

local success = myObject:saveBinary(path)

Parameters:

  • path (string): The path to write the file at, relative to the Morrowind installation folder.

Returns:

  • success (boolean): If true the object was successfully serialized.

setTarget⚓︎

This method assigns a new target to the animation controller.

myObject:setTarget(target)

Parameters:


start⚓︎

Starts the controller at the specified time. Intended for controllers with animTimingType of 1.

myObject:start(time)

Parameters:

  • time (number)

stop⚓︎

Stops the controller. If you only want to pause the controller, use the update property.

myObject:stop()