Macaw OS C reference

Function levelface

#include <macawlevel.h>
int levelface(
    int level,
    int i,
    float *xyz,
    int max,
    int *tex,
    double *nx,
    double *ny,
    double *nz
);

Gives one face of the built level: its corners, its texture and which way it faces. The corners go anticlockwise, seen from the front.

Parameters

levelint
The level.
iint
Which face, from 0.
xyzfloat *
An array of floats for the corners, three (x, y, z) for each, or NULL.
maxint
How many corners xyz has room for (so it holds 3 * max floats).
texint *
The address of an int for its texture's number, from 0, or NULL.
nxdouble *
The address of a double for x of the way it faces, or NULL.
nydouble *
The address of a double for y of the way it faces, or NULL.
nzdouble *
The address of a double for z of the way it faces, or NULL.

Returns int

How many corners the face has (even if more than max), or 0 if there's no face i.

In Baking light and the built level, with levelbake, levelbakestep, levellightdata, levelsetlight, levelunbake, levelsetsky, levelfacecount, levelstat.