Ninja Library - Light Function

njSetLightAngle

Sets the limit angle for light that was set by the njCreateLight() function

FORMAT

void njSetLightAngle( *ptr, iang, oang )
NJS_LIGHT *ptr
Angle iang
Angle oang

PARAMETER

 *ptr  Pointer to light source 
 iang  Angle limit inside of cone angle 
 oang  Angle limit outside of cone angle 

RETURN

None

DESCRIPTION

Sets angle limit (excluding CHUNK model) for light source with a spotlight specula set by njCreateLight() function. For example, a spotlight being shown on a stage. Although the light is shown in a cone shape on the stage, it is damped gradually rather than quickly at the outer edge of the cone. At this time, the edge angle of the cone or angle at which the reduction starts is the iang parameter of this function. Next, although reduction does not exceed more than 90 degrees, the spotlight is sharper, and calculations near 90 degrees have no meaning. Parameter oang sets the angle at which calculation of reduction starts to cut off, in other words at which the light begins fading.

EXAMPLE

#include <Shinobi.h>
	:
NJS_LIGHT light;
sbInitSystem( NJD_RESOLUTION_VGA, NJD_FRAMEBUFFER_MODE_RGB565, 1);
njCreateLight(&light, NJD_SPEC_POINT);
	:
/* Inside angle limit of point light source with specula set to 30 degrees and outside angle to 60 degrees */
njSetLightAngle(&light, NJM_RAD_ANG(NJD_PI/6.f), NJM_RAD_ANG(NJD_PI/3.f));

NOTE

Light source needs to be specified by njCreateLight() function.

REFERENCE

njCreateLight()
njSetLightRange()

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