Skip to content

niLookAtController⚓︎

Orients an axis of the controlled object towards a lookAt target. The axis is selectable.

Warning: The lookAt property is not reference counted, so this controller must be removed, or lookAt set to nil before the lookAt object is deleted.

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)

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:


axis⚓︎

A number representing the axis that points at the lookAt object. flip determines which end of this axis points at the target.

  • 0 X axis
  • 1 Y axis
  • 2 Z axis

Maps to values in ni.lookAtControllerAxis table.

Returns:


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:


flip⚓︎

Determines which end of the chosen axis points towards the lookAt target.

Returns:

  • result (boolean)

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)

lookAt⚓︎

The object that this controller will point towards. This is not a reference counted pointer, so this controller must be removed or lookAt set to nil before the lookAt object is deleted. This was probably designed to avoid reference cycles where controllers keep an ancestor node alive.

Returns:


lowKeyFrame⚓︎

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

Returns:

  • result (number)

nextController⚓︎

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

Returns:


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:


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:


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()