##### Ninja Library - Motion Function

# njActionLink

Links motions

### FORMAT

`

  void njActionLink( *actionlink, frame )
  NJS_ACTION_LINK *actionlink
  Float frame

`

### PARAMETER

  `*actionlink` | Pointer to action link structure
  `frame` | Frame number (from 0 to 1)

### RETURN

  None

### DESCRIPTION

  Links two motion structures.

  The frames in the motion link structure are the link source and link destination motion frames. When the frame parameter is "0", the frame is part of the motion of the link source frame; when the frame parameter is "1", the frame is part of the motion of the link destination frame. Other values (0 < ff < 1) interpolate the motion between the link destination frame and the link source frame.

### EXAMPLE

      #include <Shinobi.h>
      #define	OBJECT	object_sample
      #define	MOTION1	motion_sample1 /* Described in NAM */
      #define	MOTION2	motion_sample2 /* Described in NAM */
      #define	STEPS	60
      extern NJS_MOTION	MOTION1[];
      extern NJS_MOTION	MOTION2[];
      NJS_MOTION_LINK	motionlink;
      NJS_ACTION_LINK	actionlink;
      	:
      actionlink.motionlink = &motionlink;
      actionlink.object = OBJECT;
      motionlink.motion[0] = MOTION1;/* Link source */
      motionlink.motion[1] = MOTION2;/* Link destination */
      /* Interpolate 1.5 frames of MOTION2 from the final frame of MOTION1 */
      motionlink.frame[0] = MOTION1->nbFrame-1;
      motionlink.frame[1] = 1.5;
      	:
      njActionLink( &actionlink, ff/STEPS ); /* Specify from 0 - 1 for frames */
      ff+=0.2f;
      if( ff >= STEPS - 1 ) ff=0.f;
      	:

### NOTE

  As for drawing, it is completely the same as model drawing, except that it has motion. Therefore, settings for `njControl3D()` are the same. This function corresponds to the model drawing function `njDrawObject(),` so the light source is normal light.

### REFERENCE

  `njDrawMotionLink()
  njFastActionLink()
  njFastDrawMotionLink()
  `

njActionLink

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999