GXInitLightPosv

Syntax

#include <revolution/gx.h>

#define GXInitLightPosv(lo, vec) \
 (GXInitLightPos((lo), *(f32*)(vec), *((f32*)(vec)+1), *((f32*)(vec)+2)))

Arguments

lo Pointer to a light object.
vec Position vector. You may use an f32-type array or structure.

Return Values

None.

Description

This macro function sets the position of the light in the light object using a vector structure. The Wii graphics hardware supports local diffuse lights. The position of the light should be in the same space as a transformed vertex position (i.e., view space).

The memory for the light object must be allocated by the application; this function does not load any hardware registers. To load a light object into a hardware light, use the GXLoadLightObjImm or GXLoadLightObjIndx function.

Example

You may set an array of f32 values as as the vec argument.

// Using an array
f32  pos[3] = { 0.0f, 0.0f, 100.0f };
GXLightObj  myLightObj;

GXInitLightPosv( &myLightObj, pos );

You can also use a structure which contains three f32 members (like the matrix-vector library's Vec type).

// Using a structure
typedef structure
{
    f32  x, y, z;
} Point3d;

Point3d     pos;
GXLightObj  myLightObj;

pos.x = pos.y = pos.z = 0.0f;
GXInitLightPosv( &myLightObj, &pos );

See Also

GXInitLightPos, GXLightObj Initialization Flow

Revision History

2006/03/01 Initial version.


CONFIDENTIAL