palRayHit Class Reference

#include <palCollision.h>

List of all members.

Public Attributes

bool m_bHit
 The ray succesfully hit an object.
bool m_bHitPosition
 The ray hit position is available.
bool m_bHitNormal
 The ray hit normal is available.
palBodyBasem_pBody
 The body that was hit (if applicable).
palGeometrym_pGeom
 The geometry that was hit (if applicable).
palVector3 m_vHitPosition
 The world position where the ray hit location (if applicable).
palVector3 m_vHitNormal
 The surface normal at the point where the ray hit (if applicable).
Float m_fDistance
 The distance between the ray origin and hit position.


Detailed Description

The ray hit information. The ray hit contains the information from the result of a ray casting operation. This includes the body and geometry that terminated the raycast, as well as the position and normal of the hit location, and the distance from the origin of the initial ray cast operation. Each engine may not support the full set of raycast information, so each variable should be checked for validity. This can be done via the m_bHit, m_bHitPosition, and m_bHitNormal flags. Example:
palRayHit *prh;
if (prh->m_bHit)
	prh->m_vHitPosition.x //do a calculation
Raycasting allows the implementation of AI functionality and the simulation of distance sensors (eg: PSD or Sonar)
The documentation for this class was generated from the following files:

Generated on Mon Aug 31 13:58:02 2009 for pal by  doxygen 1.5.7.1