Ninja Library - Motion Function

njGetAction

Stores motion information

FORMAT

void njGetAction( *action, *data, frame )
NJS_ACTION *action
NJS_MOTION_DATA *data
Float frame

PARAMETER

 *action  Pointer to action structure 
 *data  Pointer to motion data structure 
 frame  Frame 

RETURN

None

DESCRIPTION

Stores motion information (shift, rotation, scaling) in the location specified by the parameter.

EXAMPLE

#include <Shinobi.h>
#define	ACTION	action_sample
#define	NODE_NUM	20
#define	BUF_NUM	(NODE_NUM*3)
extern NJS_ACTION	ACTION[];
Float	ff = 0.f;
NJS_MOTION_DATA	data;
Float	pos[BUF_NUM];
Angle	ang[BUF_NUM];
Float	scl[BUF_NUM];
	:
data.pos = pos;
data.ang = ang;
data.scl = scl;
	:
Sint32 njUserMain(void)
{
	:
	njGetAction( ACTION, &data, ff );
	ff+=0.2f;
	if( ff >= (ACTION->motion->nbFrame-1) ) ff=0.f;
	:
}
	:

REFERENCE

njGetDrawMotion()
njGetMotionTranslate()
njGetMotionRotate()
njGetMotionScale()

njGetAction
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999