Ninja Library - Motion Function

njLightAction

Executes light motion

FORMAT

void njLightAction( *laction, frame )
NJS_ACTION *laction
Float frame

PARAMETER

 *laction  Pointer to light motion structure 
 frame  Frame number 

RETURN

None

DESCRIPTION

Draws the light 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.


EXAMPLE

#include <Shinobi.h>
#define	LACTION	laction_sample
extern NJS_LACTION	LACTION[];
	:
njSetLight(LIGHT);
	:
njLightAction( LACTION,ff );
ff+=0.2f;
if( ff >= (LACTION->motion->nbFrame-1) ) ff=0.f;
	:

NOTE

This function is designed for use in NAL and NAM files, but it is also valid for light set with njCreateLight() etc.

REFERENCE

njSetLight()
njDrawMotion()

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