Function _IrrAddSplineAnimator

au3Irr2

au3Irr2 Function Reference

_IrrAddSplineAnimator

Animator moving its parent node along a spline curve.

#Include <au3Irrlicht2.au3>
_IrrAddSplineAnimator($h_Node, $tVectorStruct, $i_Start, $f_Speed, $f_Tightness)

 

Parameters

$h_Node Handle of a scene Node.
$tVectorStruct Struct array with 3D-points defining the spline curve.
Use __CreateVectStruct and __SetVectStruct to build the required struct.
$i_Start Time in milliseconds that must pass before the animation starts.
$f_Speed Defines the rate the node moves along the spline curve.
$f_Tightness Specifies how tightly the curve is tied to the points.
Value between 0 (angular) and 1 (very loose).

 

Return Value

Success: Handle of the created animator.
Failure: False and sets @error:
    1 - error from .dll call
    2 - $tVectorStruct is not a dllstruct

 

Remarks

This is one of the more difficult to set up of the animators but is very natural looking and powerful.
A spline is a curved line that passes through or close to a list of co-ordinates, creating a smooth flight.
This animator needs a list of coordinates stored in a struct array for the X, Y and Z locations of all the points.
A good way to get coordinates for this struct is to load in the camera position example and move your camera to a point and write down its coordinates.

 

Related

__CreateVectStruct, __SetVectStruct, _IrrRemoveAnimator

 

Example


#include "au3Irrlicht2.au3"

_IrrStart()

local $nodeCamera = _IrrAddCamera(150,50,0, 0,75,0)
local $nodeTest = _IrrAddTestSceneNode()
_IrrSetNodeMaterialTexture( $nodeTest, _IrrGetTexture(".\media\au3irr2_logo.jpg"), 0)
_IrrSetNodeMaterialFlag( $nodeTest, $IRR_EMF_LIGHTING, $IRR_OFF )

local $tVectors = __CreateVectStruct(4)
__SetVectStruct($tVectors, 0, -100, 50, 0)
__SetVectStruct($tVectors, 1, 0, 100, -100)
__SetVectStruct($tVectors, 2, 100, 50, 0)
__SetVectStruct($tVectors, 3, 0, 100, 100)

_IrrAddSplineAnimator($nodeTest, $tVectors, 0, 0.5, 1)

WHILE _IrrRunning()
    _IrrBeginScene(0, 0, 0)
    _IrrDrawScene()
    _IrrEndScene()
WEND

_IrrStop()