Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RtPick
[Collision Detection]


Functions

const RwCamera RwCameraCalcPixelRay (const RwCamera *camera, RwLine *line, const RwV2d *pixel)
RpAtomic RpWorldPickAtomicOnLine (RpWorld *world, const RwLine *line)
RpAtomic RwCameraPickAtomicOnPixel (const RwCamera *camera, const RwV2d *pixel)

Detailed Description

Picking Toolkit for RenderWare.

RtPick Toolkit Overview

Requirements

Overview

This toolkit provides some utilities for picking out objects in a scene that lie under a particular pixel location of a camera's image raster. This is useful for manipulating objects with a mouse or other controller.

The following functions are available:-


Function Documentation

RpAtomic* RpWorldPickAtomicOnLine RpWorld   world,
const RwLine   line
 

RpWorldPickAtomicOnLine is used to determine the atomic in the specified world that intersects the given line closest to its start point. The parameters of the line, its start and end positions, are specified in world units.

Note that this function only tests the atomic's bounding sphere to determine if it has been picked. For a more accurate test based on the atomic's geometry use RpAtomicForAllIntersections.

The world and collision plugins must be attached before using this function, and the rtpick library is required (header file rtpick.h).

Parameters:
world  Pointer to the world containing atomics.
line  Pointer to a RwLine value specifying the world line.
Returns:
Returns pointer to an atomic if successful or NULL if there is an error or if there are no atomics on the pick line.
See also:
RwCameraPickAtomicOnPixel , RwCameraCalcPixelRay , RpAtomicForAllIntersections , RpWorldForAllAtomicIntersections , RpWorldForAllWorldSectorIntersections , RpCollisionPluginAttach , RpWorldPluginAttach
const RwCamera* RwCameraCalcPixelRay const RwCamera   camera,
RwLine   line,
const RwV2d   pixel
 

RwCameraCalcPixelRay is used to determine the parameters of a line which passes through the specified camera's frustum at the given pixel location. The line starts and ends on the camera's near and far clip planes, respectively, and is specified in world units.

This function is useful if we wish to calculate intersections of the line with atomics located within the frustum. This enables us to identify the atomics corresponding to a user pick event on the camera's image raster.

The world plugin must be attached before using this function, and the rtpick library is required (header file rtpick.h).

Parameters:
camera  Pointer to the camera.
line  Pointer to a RwLine value which will receive the generated ray.
pixel  Pointer to a RwV2d value equal to the position of the picked pixel.
Returns:
Returns pointer to the camera if successful or NULL if there is an error.
See also:
RwCameraPickAtomicOnPixel , RpWorldPickAtomicOnLine , RpWorldForAllAtomicIntersections , RpWorldForAllWorldSectorIntersections , RpWorldPluginAttach
RpAtomic* RwCameraPickAtomicOnPixel const RwCamera   camera,
const RwV2d   pixel
 

RwCameraPickAtomicOnPixel is used to determine the nearest atomic, if any, which is selected through a user pick event on the specified camera's image raster at the given pixel location.

Note that this function only tests the atomic's bounding sphere to determine if it has been picked. For a more accurate test based on the atomic's geometry use RpAtomicForAllIntersections.

The world and collision plugins must be attached before using this function, and the rtpick library is required (header file rtpick.h).

Parameters:
camera  Pointer to the camera.
pixel  Pointer to the 2d coordinates of the picked camera pixel.
Returns:
Returns a pointer to an atomic if successful or NULL if there is an error, or if there are no atomics on the pixel.
See also:
RwCameraCalcPixelRay , RpWorldPickAtomicOnLine , RpWorldForAllAtomicIntersections , RpWorldForAllWorldSectorIntersections , RpCollisionPluginAttach , RpWorldPluginAttach

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:46:59 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)