Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# CollisionRay Class Reference

An infinite ray, with a specific origin and direction. More...

Inheritance diagram for CollisionRay:

List of all members.

## Public Member Functions
| CollisionRay ()
| Creates an invalid ray.
| CollisionRay (Point3 const origin, Vec3 const direction)
| CollisionRay (float ox, float oy, float oz, float dx, float dy, float dz)
Vec3 const | getDirection ()
Point3 const | getOrigin ()
| setDirection (float x, float y, float z)
| setDirection (Vec3 const direction)
bool | setFromLens (LensNode camera, Point2 const point)
| Accepts a LensNode and a 2-d point in the range [-1,1].
bool | setFromLens (LensNode camera, float px, float py)
| Accepts a LensNode and a 2-d point in the range [-1,1].
| setOrigin (float x, float y, float z)
| setOrigin (Point3 const origin)
## Static Public Member Functions
static TypeHandle | getClassType ()

## Detailed Description

An infinite ray, with a specific origin and direction.

It begins at its origin and continues in one direction to infinity, and it has no radius. Useful for picking from a window, or for gravity effects.

## Constructor & Destructor Documentation

CollisionRay | ( |  | ) |

Creates an invalid ray.

This isn't terribly useful; it's expected that the user will subsequently adjust the ray via set_origin()/set_direction() or set_from_lens().

CollisionRay | ( | Point3 const | origin,
|  | Vec3 const | direction
| ) |  |

CollisionRay | ( | float | ox,
|  | float | oy,
|  | float | oz,
|  | float | dx,
|  | float | dy,
|  | float | dz
| ) |  |

## Member Function Documentation

static TypeHandle getClassType | ( |  | ) | `[static]`

Reimplemented from CollisionSolid.

Reimplemented in CollisionLine.

Vec3 const getDirection | ( |  | ) |

Point3 const getOrigin | ( |  | ) |

setDirection | ( | Vec3 const | direction | ) |

setDirection | ( | float | x,
|  | float | y,
|  | float | z
| ) |  |

bool setFromLens | ( | LensNode | camera,
|  | float | px,
|  | float | py
| ) |  |

Accepts a LensNode and a 2-d point in the range [-1,1].

Sets the CollisionRay so that it begins at the LensNode's near plane and extends to infinity, making it suitable for picking objects from the screen given a camera and a mouse location.

bool setFromLens | ( | LensNode | camera,
|  | Point2 const | point
| ) |  |

Accepts a LensNode and a 2-d point in the range [-1,1].

Sets the CollisionRay so that it begins at the LensNode's near plane and extends to infinity, making it suitable for picking objects from the screen given a camera and a mouse location.

Returns true if the point was acceptable, false otherwise.

setOrigin | ( | Point3 const | origin | ) |

setOrigin | ( | float | x,
|  | float | y,
|  | float | z
| ) |  |

All Classes Namespaces Functions Variables Enumerations Enumerator Properties