RenderWare Graphics utilizes a standard virtual camera model and this object represents the virtual camera. Usually, a camera object requires a frame and two rasters. The frame is required so the camera can be positioned within world space.
The rasters will usually be of type rwRASTERTYPECAMERA and rwRASTERTYPEZBUFFER, representing the frame buffer and Z buffer respectively. Alternatively, a camera can reference a sub-raster stored within another camera to allow split-screen or picture-in-picture rendering.
|
RwCameraCallBack type represents a function called from any camera iterator that may be implemented in plugins. This function should return a pointer to the current camera to indicate success. The callback may return NULL to terminate further callbacks on other cameras.
|
|
RwCameraChunkInfo is typedef'd to a structure that holds camera data. This should be considered an opaque type. Use the RwCamera API functions to access it. |
|
RwCameraClearMode Camera clear flags |
|
RwCameraProjection This type represents the options available for setting the camera projection model, either perspective projection or parallel projection (see API function RwCameraSetProjection) |
|
RwFrustumTestResult This type represents the results from a camera frustum test on a given sphere (see API function RwCameraFrustumTestSphere) |
|
RwCameraBeginUpdate is used to indicate that the specified camera is about to start rendering a view of a scene and that the camera's frame buffer raster is to be the target of any subsequent 3D rendering. When RwCameraBeginUpdate is called, the camera's image raster is pushed onto the context stack, thereby ensuring that the result of any rendering is stored in the camera's own raster. At the same time, all dirty frame hierarchies are synchronized, i.e. the individual Local Transform Matrices (LTMs) are recalculated ready for processing. Rendering to the camera can now take place with all scene objects guaranteed to be in their correct positions and orientations.
|
|
RwCameraChunkInfoRead extracts Chunk Info data from a RenderWare stream. The data is converted from its original format and inserted into an RwCameraChunkInfo structure. A pointer to this structure is returned on success.
|
|
RwCameraClear is used to clear the image and/or Z-buffer rasters associated with the specified camera. This function is typically used to prepare the camera's rasters for receiving the results from a new rendering, just before an RwCameraBeginUpdate / RwCameraEndUpdate block. The image raster can be cleared to a specified color.
|
|
RwCameraClone is used to create a copy of the specified camera. Note that the old and new cameras share the same frame, image raster and Z-buffer raster. If the original camera has been added to a world, the new camera is also in that world. The following camera attributes are copied directly:
|
|
RwCameraCreate creates a new camera. Before the camera can be used to render a view of a scene, a frame, image raster and Z-buffer raster must be attached to the camera. The associated frame enables the camera to be positioned and oriented (i.e. pointed) within a world. The image raster is used for storing the rendered image. The Z-buffer raster contains depth information used for hidden surface calculations. Finally, the camera must also be added to the world in which it is to be used for rendering. When a frame is defined, the camera is positioned at the origin and is oriented such that its view direction is along the positive z-axis and 'up' is along the positive y-axis. Transformations applied to the frame can be used to move and re-orient the camera as required. The camera is created with a pre-defined view-window, view-offset and near and far clip-planes. Initially, the view-window is a unit square with a view-offset of zero, giving a 'look-at' direction passing through the center of the rendered image. The near and far clip-planes are positioned at distances of 0.05 and 10.0 units, respectively, from the camera's local origin, measured along the 'look-at' direction. Both the view plane and near and far clip-planes are perpendicular to the view direction. Note that the view-window is fixed at unit distance from the camera and cannot be moved. In this situation changes to the aspect ratio and angular field-of-view of the rendered image can be achieved by defining new values for the width and height of the view-window. The default projection model is rwPERSPECTIVE.
|
|
RwCameraDestroy destroys the specified camera. It is recommended that the camera's frame, image raster and Z-buffer raster are destroyed first before actually calling RwCameraDestroy as they are not explicitly destroyed by this function.
|
|
RwCameraEndUpdate is used to indicate that 3D rendering to the specified camera has been completed. Note that RwCameraBeginUpdate and RwCameraEndUpdate work as a pair and only between these calls can any rendering be properly performed.
|
|
RwCameraFrustumTestSphere is used to check if a specified sphere intersects the view frustum of the given camera. A sphere that is wholly inside the frustum is considered to have intersected the frustum.
|
|
RwCameraGetCurrentCamera is used to determine which (if any) camera is being used for 3D rendering of the current scene. The current camera is only defined between calls to RwCameraBeginUpdate and RwCameraEndUpdate. 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.
|
|
RwCameraGetFarClipPlane returns the distance of the specified camera's far clip-plane. This distance is measured in world units from the camera's position in the direction of the 'look-at' vector. 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.
|
|
RwCameraGetFogDistance returns the specified camera's fogging distance. This distance is measured in world and is the distance at which fogging begins to take effect. The far clip-plane is the distance at which the full fog effect is obtained. The fog distance cannot be zero. The default fog distance is 5.0 units. 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.
|
|
RwCameraGetFrame returns a pointer to the frame attached to the specified camera, (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.
|
|
RwCameraGetNearClipPlane returns the distance of the specified camera's near clip-plane. This distance is measured in world units from the camera's position in the direction of the 'look-at' vector. (The near clip-plane distance cannot be 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.
|
|
RwCameraGetPluginOffset is used to get the offset of a previously registered camera plugin.
|
|
RwCameraGetProjection is used to determine the projection model currently set for the specified camera. 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.
|
|
RwCameraGetRaster is used to retrieve a pointer to the raster attached to the specified camera which serves as the camera's image buffer. 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.
|
|
RwCameraGetViewMatrix is used to retrieve the specified camera's view-transformation matrix. This matrix can be used to transform world coordinate positions to camera clip space. The camera's clip space is bounded by the near and far clip planes, and side planes defined as follows:
|
|
RwCameraGetViewOffset is used to determine the current view-offset of the specified camera. The x- and y-offsets are measured in world units in a plane passing through the camera's viewpoint and parallel to the view-plane, in the negative direction of the camera's 'look-right' and in the positive direction of the camera's 'look-up' vectors respectively. Non-zero offsets move the apex of the view volume whilst its edges remain fixed to the corners of the view-window. This has the effect of shearing the view volume. 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.
|
|
RwCameraGetViewWindow is used to retrieve the specified camera's view-window size. View-window sizes are measured in world units. The returned 2D vector represents the half-width and half-height of the view- window. The default view-window has dimensions of (1.0, 1.0) giving a window 2.0 units on each side. 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.
|
|
RwCameraGetZRaster is used to retrieve a pointer to the raster, if any, attached to the specified camera and serving as the camera's Z-buffer. 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.
|
|
RwCameraRegisterPlugin is used to register a plugin and reserve some space within a camera. This must happen after the engine has been initialized but before the engine is opened.
|
|
RwCameraRegisterPluginStream is used to add stream capability to a previously registered plugin.
|
|
RwCameraSetFarClipPlane is used to set the distance of the specified camera's far clip-plane. This distance is specified in world units and must be greater than the near clip-plane.
|
|
RwCameraSetFogDistance is used to set the a camera's fogging distance. This distance is specified in world units and is the distance at which fogging begins to take effect. The far clip-plane is the distance at which full fog effect is obtained. The fog distance cannot be zero. The default fog distance is 5.0 units.
|
|
RwCameraSetFrame is used to attach a frame to the specified camera 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.
|
|
RwCameraSetFreeListCreateParams allows the developer to specify how many RwCamera s to preallocate space for. Call before RwEngineInit.
|
|
RwCameraSetNearClipPlane is used to set the distance of the specified camera's near clip-plane. This distance is specified in world units and must be greater than zero and less than the far clip-plane.
|
|
RwCameraSetProjection is used to specify the projection model for the given camera. Two types of projection model are currently supported: perspective and parallel. Perspective projection takes into account the distance of an object from the camera and produces a view very much like we expect from a real camera. Parallel projection presumes that objects maintain their same relative size regardless of distance from the camera. Hence two identical objects at different distances look the same size when viewed with a parallel camera. The default projection model is perspective.
|
|
RwCameraSetRaster is used to specify a raster which will serve as the camera's image buffer. Note that the raster must have been defined as type rwRASTERTYPECAMERA or rwRASTERTYPECAMERATEXTURE when it was created. 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.
|
|
RwCameraSetStreamAlwaysCallBack is used to associate a binary stream functionality with a previously registered camera plugin. This callback is called for all plugins after stream data reading has completed.
|
|
RwCameraSetViewOffset is used to specify the current view-offset of the given camera. The x- and y-offsets are measured in world units in a plane passing through the camera's viewpoint and parallel to the view-plane, in the negative direction of the camera's 'look-right' and in the positive direction of the camera's 'look-up' vectors respectively. Non-zero offsets move the apex of the view volume whilst its edges remain fixed to the corners of the view-window. This has the effect of shearing the view volume.
|
|
RwCameraSetViewWindow is used to set the size of the specified camera's view-window (in world units). The specified 2D vector represents the half-width and half-height of the view-window. The default view-window has dimensions (1.0, 1.0) giving a window 2.0 units on each side. This function can be used to control the angular field-of-view of the camera. Larger values give a wider field-of-view while smaller values give a narrower view. Hence changing the size of the view-window gives the effect of a zoom-lens. Note that changing the size of the view-window does not alter the size of the camera's image raster, so unless the aspect ratios match, the resulting image will be distorted to conform to the image raster's aspect ratio.
|
|
RwCameraSetZRaster is used to specify a raster which will serve as the camera's Z-buffer. Note that the raster must have been defined as type rwRASTERTYPEZBUFFER when it was created. 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.
|
|
RwCameraShowRaster is used to copy the specified camera's image raster to the display. This function often immediately follows a RwCameraBeginUpdate / RwCameraEndUpdate block in order to transfer the new rendering to the display device.
|
|
RwCameraStreamGetSize determines the size in bytes of the binary representation of the specified camera 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.
|
|
RwCameraStreamRead reads a camera object from a binary stream. Note that prior to this function call, a binary camera chunk must be found in the stream using the RwStreamFindChunk API function.
RwStream *stream; RwCamera *newCamera; stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx"); if (stream) { if (RwStreamFindChunk(stream, rwID_CAMERA, NULL, NULL)) { newCamera = RwCameraStreamRead(stream); } RwStreamClose(stream, NULL); }
|
|
RwCameraStreamWrite writes the specified camera object to a binary stream. Note that the stream will have been opened prior to this function call.
|
|
RwCameraValidatePlugins is used to validate the plugin memory allocated within the specified camera. This function is useful for determining where memory trampling may be occuring within an application. NOTE: This function only returns a meaningful response under a debug library.
|
Converted from CHM to HTML with chm2web Pro 2.85 (unicode) |