palPSDSensor Class Reference
#include <palSensors.h>
List of all members.
|
Public Member Functions |
virtual void | Init (palBody *body, Float x, Float y, Float z, Float axis_x, Float axis_y, Float axis_z, Float range) |
virtual Float | GetDistance ()=0 |
Detailed Description
A PSD (Position Sensitive Device) Sensor. A PSD sensor returns the distance between its location and direction and the nearest object. The process of doing so usually involves casting a ray and determining the intersection point to calculate the distance. The PSD sensor is therefore sometimes refered to as raycasting or raytraceing.
The diagram indicates the body to which the sensor is attached (the cube), the position at which the PSD sensor is located (the bottom of the arrow), and the direction which the PSD is facing (the tip of the arrow). The diagram illustrates the operation of the PSD, showing the PSD ray intersecting a neighbouring object. The length of the arrow is the distance returned when the PSD is queried.
Member Function Documentation
virtual Float palPSDSensor::GetDistance |
( |
|
) |
[pure virtual] |
Returns the distance Casts a ray from the sensors current location and orientation to determine the nearest intersection point.
- Returns:
- The distance to the closest object
void palPSDSensor::Init |
( |
palBody * |
body, |
|
|
Float |
x, |
|
|
Float |
y, |
|
|
Float |
z, |
|
|
Float |
axis_x, |
|
|
Float |
axis_y, |
|
|
Float |
axis_z, |
|
|
Float |
range | |
|
) |
| | [virtual] |
Initializes the PSD sensor. Attaches a PSD sensor to a given body, at specified position, and pointed in a given direction, with a maximum range.
- Parameters:
-
| body | The body which the sensor is attached to. |
| x | The position (x) |
| y | The position (y) |
| z | The position (z) |
| axis_x | The direction vector the PSD is facing (x) |
| axis_y | The direction vector the PSD is facing (y) |
| axis_z | The direction vector the PSD is facing (z) |
| range | The maximum range the PSD has |
The documentation for this class was generated from the following files:
- /var/www/hosted/adrianboeing.com/pal/current/pal/pal/pal/palSensors.h
- /var/www/hosted/adrianboeing.com/pal/current/pal/pal/pal/palSensors.cpp