Fog InfoAvailability LightWave® 6.0 The fog info global returns information about the fog settings for the scene. The parameters are read-only, but you can set them using commands. Global Call LWFogInfo *foginfo; foginfo = global( LWFOGINFO_GLOBAL, GFUSE_TRANSIENT ); The global function returns a pointer to an LWFogInfo. typedef struct st_LWFogInfo {
int type;
int flags;
double (*minDist) (LWTime);
double (*maxDist) (LWTime);
double (*minAmt) (LWTime);
double (*maxAmt) (LWTime);
void (*color) (LWTime, double col[3]);
} LWFogInfo;
Example This code fragment uses Fog Info to determine whether a point at distance d is in fog at time t. #include <lwserver.h>
#include <lwrender.h>
LWFogInfo *foginfo;
foginfo = global( LWFOGINFO_GLOBAL, GFUSE_TRANSIENT );
if ( foginfo ) {
if ( foginfo->type != LWFOG_NONE ) {
if ( d >= foginfo->minDist( t )) {
...d is in fog
|