This object represents dynamic lighting in a RenderWare Graphics Retained Mode scene. Lighting models available are:
Further information is available in the Dynamic Models chapter of the User Guide.
|
RpLightCallBack represents the function called from RpWorldForAllLights and RpWorld SectorForAllLights for all lights in a given world or world sector. This function should return a pointer to the current light to indicate success. The callback may return NULL to terminate further callbacks on the world sector.
|
|
RpLightFlag defines what geometry is influenced by the light. The bit-field RpLightFlag specifies the options available for controlling the scope of a light source (see API function RpLightSetFlags): |
|
RpLightType are light sub types. This type represents the different types of light source that can be created using the API function RpLightCreate. Note that lights of types rpLIGHTPOINT, rpLIGHTSPOT and rpLIGHTSPOTSOFT have linear intensity fall-off with distance from the source, reducing to zero at the light's radius: |
|
RpLightCreate is used to create a new light of the type specified. The light needs to be linked to a frame and added to a world before it can be included in any rendering. The associated frame enables the light to be positioned and oriented (i.e. positioned) within the world as required. When a frame is defined directional lighting (rpLIGHTDIRECTIONAL, rpLIGHTSPOT and rpLIGHTSPOTSOFT) is oriented such that it illuminates in the direction of the frame's look-at vector, while positionable lighting (rpLIGHTPOINT, rpLIGHTSPOT and rpLIGHTSPOTSOFT) is located at the origin. Transformations applied to the frame can then be used to move and re-orient the light as required. The following defaults are defined:
|
|
RpLightDestroy is used to destroy the specified dynamic light. The light must be removed from the worlds it belongs to (if any) before destruction using RpWorldRemoveLight. Any frame attached to the light should be removed from the light using RpLightSetFrame passing NULL as the new frame.
lights.c in LightsDestroy() (line 335).
SpotSoftLight is a pointer to an RpLight.
if( SpotSoftLight ) { world = RpLightGetWorld(SpotSoftLight); if( world ) { RpWorldRemoveLight(world, SpotSoftLight); } frame = RpLightGetFrame(SpotSoftLight); RpLightSetFrame(SpotSoftLight, NULL); RwFrameDestroy(frame); RpLightDestroy(SpotSoftLight); } The world plugin must be attached before using this function.
|
|
RpLightForAllWorldSectors is used to enumerate all the world sectors that a light affects. If any invocation of the callback function returns a failure status the iteration is terminated. However, RpLightForAllWorldSectors will still return successfully. The world plugin must be attached before using this function.
|
|
RpLightGetClump is used to retrieve the specified light's parent clump, if one exists. The world plugin must be attached before using this function.
|
|
RpLightGetColor is used to retrieve the color of the specified light. Light colors are specified as real values within the range 0 to 1 in each color channel. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpLightGetConeAngle is used to retrieve the angle at which a spot light illuminates objects (measured from the direction vector of the light). The cone angle only applies to lights of type rpLIGHTTYPESPOT and rpLIGHTTYPESPOTSOFT and this function will return an error if used on any other type. The world plugin must be attached before using this function.
|
|
RpLightGetFlags is used to retrieve the flags associated with a light object. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpLightGetFrame is used to retrieve the frame the specified light is attached to, if any. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpLightGetPluginOffset is used to get the offset of a previously registered light plugin. The world plugin must be attached before using this function.
|
|
RpLightGetRadius is used to retrieve the radius of a point or spot light - the distance from the light in world units beyond which it has no influence. Within the radius of the light the intensity falls according to 1-(d/R), where d is the distance from the light and R is the radius. Hence at d=0 the light has full intensity and at d=R the intensity is zero. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpLightGetType is used to determine the type of a light object, if any. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpLightGetWorld is used to determine the world the specified light belongs to, if any. The world plugin must be attached before using this function.
|
|
RpLightRegisterPlugin is used to register a plugin and reserve some space within a light. This must happen after the engine has been initialized but before the engine is opened. The world plugin must be attached before using this function.
|
|
RpLightRegisterPluginStream is used to associate a set of binary stream functionality with a previously registered light plugin. The world plugin must be attached before using this function.
|
|
RpLightSetColor is used to specify the color of the given light. Light colors are specified as real values within the range 0 to 1 in each color channel. The default color is white (red = 1.0, green = 1.0, blue = 1.0). The world plugin must be attached before using this function.
|
|
RpLightSetConeAngle is used to specify the cone angle at which a spot light illuminates objects (measured in radians from the direction vector of the light). This function is only valid for lights of type rpLIGHTTYPESPOT or rpLIGHTTYPESPOTSOFT. The default cone angle is zero. The maximum allowed cone angle (this value being platform-dependent) is given by rpLIGHTMAXCONEANGLE. The world plugin must be attached before using this function.
|
|
RpLightSetFlags is used to specify what a particular light object illuminates. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpLightSetFrame is used to attach the specified light to the given frame so that it can be positioned and oriented, as appropriate, within a world. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpLightSetFreeListCreateParams allows the developer to specify how many RpLight s to preallocate space for. Call before RwEngineInit.
|
|
RpLightSetRadius is used to specify the radius of a point or spot light. The radius is the distance from the light in world units beyond which it has no influence. Within the radius the intensity falls according to 1-(d/R), where d is the distance from the light and R is the radius. Hence at d=0 the light has full intensity and at d=R the intensity is zero. The default radius is zero. The world plugin must be attached before using this function.
|
|
RpLightSetStreamAlwaysCallBack is used to associate a binary stream functionality with a previously registered light plugin. This callback is called for all plugins after stream data reading has completed. The world plugin must be attached before using this function.
|
|
RpLightStreamGetSize is used to determine the size in bytes of the binary representation of the given light object. This is used in the binary chunk header to indicate the size of the chunk. The size does not include the size of the chunk header. The world plugin must be attached before using this function.
|
|
RpLightStreamRead is used to read a light object from the specified binary stream. Note that prior to this function call a binary light chunk must be found in the stream using the RwStreamFindChunk API function. The world plugin must be attached before using this function. The sequence to locate and read a light from a binary stream is as follows: RwStream *stream; RpLight *NewLight; stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx"); if (stream) { if( RwStreamFindChunk(stream, rwID_LIGHT, NULL, NULL) ) { NewLight = RpLightStreamRead(stream); } RwStreamClose(stream, NULL); }
|
|
RpLightStreamWrite is used to write the specified light to a binary stream. Note that the stream will have been opened prior to this function call. The world plugin must be attached before using this function.
|
|
RpLightTieSetFreeListCreateParams allows the developer to specify how many RpLightTie s to preallocate space for. Call before RwEngineInit.
|
|
RpLightValidatePlugins validates the plugin memory allocated within the specified light. This function is useful for determining where memory trampling may be occuring within an application. This function only returns a meaningful response under a debug library. The world plugin must be attached before using this function.
|
Converted from CHM to HTML with chm2web Pro 2.85 (unicode) |