##### Ninja Library - Motion Function

# njCnkDrawShapeMotion

Executes motion with shape

### FORMAT

`

  void njCnkShapeDrawMotion( *object, *motion, *shape, frame )
  NJS_CNK_OBJECT *object
  NJS_MOTION *motion
  NJS_MOTION *shape
  Float frame

`

### PARAMETER

  `*object` | Pointer to chunk object structure
  `*motion` | Pointer to motion structure
  `*shape` | Pointer to motion structure (apex animation)
  `frame` | Frame number

### RETURN

  None

### DESCRIPTION

  Draws a motion according to motion data.

  Because floating-point notation is possible for frame numbers, interpolation of motion data is possible. For motions where the number of frames is 10, the frame number range is 0 to less than 10 (9.9999). For example, when the frame number is set to 0.5, the values for the mean between frame 0 and frame 1 are interpolated and drawn. Interpolation for frames between 9 and less than 10 (9.9999) is carried out between the last frame and the first frame.

  Apex types suitable for apex animation are listed below.

  Apex | NJD_CV, NJD_CV_D8, NJD_CV_UF, NJD_CV_NF, NJD_CV_S5, NJD_CV_S4, NJD_CV_IN
  Apex/normal vector | NJD_CV_VN, NJD_CV_VN_D8, NJD_CV_VN_UF, NJD_CV_VN_NF, NJD_CV_VN_S5, NJD_CV_VN_S4, NJD_CV_VN_IN

  (Spline interpolation only for apex)

### EXAMPLE

      #include <Shinobi.h>
      #define	OBJECT	object_sample	/* Enter in NJA(NAM) file */
      #define	MOTION	motion_sample	/* Enter in NAM file */
      #define	SHAPE	shape_sample	/* Enter in NAS file */
      extern NJS_CNK_OBJECT	OBJECT[];
      extern NJS_MOTION	MOTION[];
      extern NJS_MOTION	SHAPE[];
      float	buf[10000];
      float	ff=0.f;
      	:
      njInitShape(buf);
      	:
      njCnkDrawShapeMotion( OBJECT,MOTION,SHAPE,ff );
      ff+=0.2f;
      if( ff >= (MOTION->nbFrame-1) ) ff=0.f;
      	:

### NOTE

  This is a motion for the chunk object structures. The drawing function is exactly the same as model drawing, except for the fact that motion and shape (apex animation) have been added.

### REFERENCE

  `njCnkDrawMotion()
  njCnkDrawObject()
  `

njCnkDrawShapeMotion

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999