Panda3D
Public Member Functions | Static Public Member Functions

CollisionHandlerQueue Class Reference

A special kind of CollisionHandler that does nothing except remember the CollisionEntries detected the last pass. More...

#include "collisionHandlerQueue.h"

Inheritance diagram for CollisionHandlerQueue:
CollisionHandler TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

List of all members.

Public Member Functions

virtual void add_entry (CollisionEntry *entry)
 Called between a begin_group() .
virtual void begin_group ()
 Will be called by the CollisionTraverser before a new traversal is begun.
void clear_entries ()
 Removes all the entries from the queue.
virtual TypeHandle force_init_type ()
CollisionEntryget_entry (int n) const
 Returns the nth CollisionEntry detected last pass.
int get_num_entries () const
 Returns the number of CollisionEntries detected last pass.
virtual TypeHandle get_type () const
 MAKE_SEQ (get_entries, get_num_entries, get_entry)
void output (ostream &out) const
void sort_entries ()
 Sorts all the detected collisions front-to-back by from_intersection_point() so that those intersection points closest to the collider's origin (e.g., the center of the CollisionSphere, or the point_a of a CollisionSegment) appear first.
void write (ostream &out, int indent_level=0) const

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.

Detailed Description

A special kind of CollisionHandler that does nothing except remember the CollisionEntries detected the last pass.

This set of CollisionEntries may then be queried by the calling function. It's primarily useful when a simple intersection test is being made, e.g. for picking from the window.

Definition at line 32 of file collisionHandlerQueue.h.


Member Function Documentation

void CollisionHandlerQueue::add_entry ( CollisionEntry entry) [virtual]

Called between a begin_group() .

. end_group() sequence for each collision that is detected.

Reimplemented from CollisionHandler.

Definition at line 68 of file collisionHandlerQueue.cxx.

void CollisionHandlerQueue::begin_group ( ) [virtual]

Will be called by the CollisionTraverser before a new traversal is begun.

It instructs the handler to reset itself in preparation for a number of CollisionEntries to be sent.

Reimplemented from CollisionHandler.

Definition at line 57 of file collisionHandlerQueue.cxx.

void CollisionHandlerQueue::clear_entries ( )

Removes all the entries from the queue.

Definition at line 117 of file collisionHandlerQueue.cxx.

CollisionEntry * CollisionHandlerQueue::get_entry ( int  n) const

Returns the nth CollisionEntry detected last pass.

Definition at line 138 of file collisionHandlerQueue.cxx.

int CollisionHandlerQueue::get_num_entries ( ) const

Returns the number of CollisionEntries detected last pass.

Definition at line 128 of file collisionHandlerQueue.cxx.

static void CollisionHandlerQueue::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from CollisionHandler.

Definition at line 59 of file collisionHandlerQueue.h.

References CollisionHandler::init_type().

void CollisionHandlerQueue::sort_entries ( )

Sorts all the detected collisions front-to-back by from_intersection_point() so that those intersection points closest to the collider's origin (e.g., the center of the CollisionSphere, or the point_a of a CollisionSegment) appear first.

Definition at line 83 of file collisionHandlerQueue.cxx.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations