![]() |
![]() |
![]() |
![]() |
"LW Light Info 2"Availability: LightWave 6.0 The light info global returns functions for getting light-specific information about any of the lights in a scene. Use the item info global to get the light list and for generic item information. The information returned by these functions is read-only. Global Call LWLightInfo *lightinfo; lightinfo = global( "LW Light Info", GFUSE_TRANSIENT ); The global function returns a pointer to an LWLightInfo. typedef struct st_LWLightInfo { void (*ambient) (LWTime, LWDVector color); int (*type) (LWItemID); void (*color) (LWItemID, LWTime, LWDVector color); int (*shadowType) (LWItemID); void (*coneAngles) (LWItemID, double *radius, double *edge); unsigned int (*flags) (LWItemID); double (*range) (LWItemID); } LWLightInfo;
Example This code fragment collects information about the first light. #include <lwserver.h> #include <lwrender.h> LWItemInfo *iteminfo; LWLightInfo *ltinfo; LWItemID id; LWTime t = 3.0; /* seconds */ LWDVector color; double range, radius, edge; int lighttype, shadowtype; unsigned int flags; iteminfo = global( "LW Item Info 2", GFUSE_TRANSIENT ); ltinfo = global( "LW Light Info 2", GFUSE_TRANSIENT ); if ( iteminfo && ltinfo ) { id = iteminfo->first( LWI_LIGHT, NULL ); lighttype = ltinfo->type( id ); shadowtype = ltinfo->shadowType( id ); flags = ltinfo->flags( id ); ltinfo->color( id, t, color ); if ( type == LWLIGHT_SPOT ) ltinfo->coneAngles( id, &radius, &edge ); if ( flags & LWLFL_LIMITED_RANGE ) range = ltinfo->range( id ); } |