A specialized kind of CollisionHandler that throws an event for each collision detected. More...
#include "collisionHandlerHighestEvent.h"
Public Member Functions | |
CollisionHandlerHighestEvent () | |
The default CollisionHandlerEvent will throw no events. More... | |
virtual void | add_entry (CollisionEntry *entry) |
Called between a begin_group() . More... | |
virtual void | begin_group () |
Will be called by the CollisionTraverser before a new traversal is begun. More... | |
virtual bool | end_group () |
Called by the CollisionTraverser at the completion of all collision detections for this traversal. More... | |
virtual TypeHandle | force_init_type () |
virtual TypeHandle | get_type () const |
Public Member Functions inherited from CollisionHandlerEvent | |
CollisionHandlerEvent () | |
The default CollisionHandlerEvent will throw no events. More... | |
void | add_again_pattern (const std::string &again_pattern) |
Adds the pattern string that indicates how the event names are generated when a collision between two particular nodes is *still* detected. More... | |
void | add_in_pattern (const std::string &in_pattern) |
Adds a pattern string to the list of events that will be generated in response to a collision. More... | |
void | add_out_pattern (const std::string &out_pattern) |
Adds the pattern string that indicates how the event names are generated when a collision between two particular nodes is *no longer* detected. More... | |
void | clear () |
Empties the list of elements that all colliders are known to be colliding with. More... | |
void | clear_again_patterns () |
Removes all of the previously-added in patterns. More... | |
void | clear_in_patterns () |
Removes all of the previously-added in patterns. More... | |
void | clear_out_patterns () |
Removes all of the previously-added in patterns. More... | |
void | flush () |
Same as clear() except "out" events are thrown. More... | |
std::string | get_again_pattern (int n) const |
std::string | get_in_pattern (int n) const |
int | get_num_again_patterns () const |
int | get_num_in_patterns () const |
int | get_num_out_patterns () const |
std::string | get_out_pattern (int n) const |
void | set_again_pattern (const std::string &again_pattern) |
This method is deprecated; it completely replaces all the in patterns that have previously been set with the indicated pattern. More... | |
void | set_in_pattern (const std::string &in_pattern) |
This method is deprecated; it completely replaces all the in patterns that have previously been set with the indicated pattern. More... | |
void | set_out_pattern (const std::string &out_pattern) |
This method is deprecated; it completely replaces all the in patterns that have previously been set with the indicated pattern. More... | |
Public Member Functions inherited from CollisionHandler | |
void | set_root (const NodePath &root) |
Sets the root of the collision traversal. More... | |
bool | wants_all_potential_collidees () const |
Returns true if handler wants to know about all solids that are within the collider's bounding volume. More... | |
Public Member Functions inherited from TypedReferenceCount | |
TypedReferenceCount (const TypedReferenceCount ©) | |
void | operator= (const TypedReferenceCount ©) |
Public Member Functions inherited from TypedObject | |
TypedObject (const TypedObject ©)=default | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
int | get_best_parent_from_Set (const std::set< int > &) const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. More... | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. More... | |
TypedObject & | operator= (const TypedObject ©)=default |
Public Member Functions inherited from ReferenceCount | |
int | get_ref_count () const |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | ref_if_nonzero () const |
Atomically increases the reference count of this object if it is not zero. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
WeakReferenceList * | weak_ref () |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref () |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Static Public Member Functions inherited from CollisionHandlerEvent | |
static TypeHandle | get_class_type () |
static void | init_type () |
Static Public Member Functions inherited from CollisionHandler | |
static TypeHandle | get_class_type () |
static void | init_type () |
Static Public Member Functions inherited from TypedReferenceCount | |
static TypeHandle | get_class_type () |
static void | init_type () |
Static Public Member Functions inherited from TypedObject | |
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. More... | |
Static Public Member Functions inherited from ReferenceCount | |
static TypeHandle | get_class_type () |
static void | init_type () |
Additional Inherited Members | |
Public Attributes inherited from CollisionHandlerEvent | |
get_again_pattern | |
Returns the nth pattern string that indicates how the event names are generated for each collision detected. More... | |
get_in_pattern | |
Returns the nth pattern string that indicates how the event names are generated for each collision detected. More... | |
get_num_again_patterns | |
Returns the number of in pattern strings that have been added. More... | |
get_num_in_patterns | |
Returns the number of in pattern strings that have been added. More... | |
get_num_out_patterns | |
Returns the number of in pattern strings that have been added. More... | |
get_out_pattern | |
Returns the nth pattern string that indicates how the event names are generated for each collision detected. More... | |
Public Attributes inherited from TypedObject | |
get_type | |
Public Attributes inherited from ReferenceCount | |
get_ref_count | |
Returns the current reference count. More... | |
A specialized kind of CollisionHandler that throws an event for each collision detected.
The event thrown may be based on the name of the moving object or the struck object, or both. The first parameter of the event will be a pointer to the CollisionEntry that triggered it.
Definition at line 32 of file collisionHandlerHighestEvent.h.
CollisionHandlerHighestEvent::CollisionHandlerHighestEvent | ( | ) |
The default CollisionHandlerEvent will throw no events.
Its pattern strings must first be set via a call to add_in_pattern() and/or add_out_pattern().
Definition at line 29 of file collisionHandlerHighestEvent.cxx.
|
virtual |
Called between a begin_group() .
. end_group() sequence for each collision that is detected.
Reimplemented from CollisionHandlerEvent.
Definition at line 57 of file collisionHandlerHighestEvent.cxx.
|
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 CollisionHandlerEvent.
Definition at line 38 of file collisionHandlerHighestEvent.cxx.
|
virtual |
Called by the CollisionTraverser at the completion of all collision detections for this traversal.
It should do whatever finalization is required for the handler.
Reimplemented from CollisionHandlerEvent.
Definition at line 75 of file collisionHandlerHighestEvent.cxx.
References CollisionHandlerEvent::end_group().