#include <collisionHandlerEvent.h>
Inheritance diagram for CollisionHandlerEvent:
Public Member Functions | |
CollisionHandlerEvent () | |
The default CollisionHandlerEvent will throw no events. | |
virtual void | begin_group () |
Will be called by the CollisionTraverser before a new traversal is begun. | |
virtual void | add_entry (CollisionEntry *entry) |
Called between a begin_group() .. | |
virtual bool | end_group () |
Called by the CollisionTraverser at the completion of all collision detections for this traversal. | |
void | set_in_pattern (const string &pattern) |
Sets the pattern string that indicates how the event names are generated for each collision detected. | |
string | get_in_pattern () const |
Returns the pattern string that indicates how the event names are generated for each collision detected. | |
void | set_again_pattern (const string &pattern) |
Sets the pattern string that indicates how the event names are generated when a collision between two particular nodes is *still* detected. | |
string | get_again_pattern () const |
Returns the pattern string that indicates how the event names are generated when a collision between two particular nodes is *still* detected. | |
void | set_out_pattern (const string &pattern) |
Sets the pattern string that indicates how the event names are generated when a collision between two particular nodes is *no longer* detected. | |
string | get_out_pattern () const |
Returns the pattern string that indicates how the event names are generated when a collision between two particular nodes is *no longer* detected. | |
void | clear () |
Empties the list of elements that all colliders are known to be colliding with. | |
virtual TypeHandle | get_type () const |
virtual TypeHandle | force_init_type () |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
int | get_ref_count () const |
Returns the current reference count. | |
int | ref () const |
Explicitly increments the reference count. | |
int | unref () const |
Explicitly decrements the reference count. | |
void | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Private Types | |
typedef pset< PointerTo< CollisionEntry >, SortEntries > | Colliding |
Private Member Functions | |
void | throw_event_pattern (const string &pattern, CollisionEntry *entry) |
Throws an event matching the indicated pattern. | |
Private Attributes | |
string | _in_pattern |
string | _again_pattern |
string | _out_pattern |
int | _index |
Colliding | _current_colliding |
Colliding | _last_colliding |
Static Private Attributes | |
TypeHandle | _type_handle |
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 50 of file collisionHandlerEvent.h.
|
Definition at line 86 of file collisionHandlerEvent.h. |
|
The default CollisionHandlerEvent will throw no events. Its pattern strings must first be set via a call to set_in_pattern() and/or set_out_pattern(). Definition at line 45 of file collisionHandlerEvent.cxx. References _current_colliding, and _last_colliding. |
|
Called between a begin_group() .. end_group() sequence for each collision that is detected. Reimplemented from CollisionHandler. Reimplemented in CollisionHandlerPhysical. Definition at line 83 of file collisionHandlerEvent.cxx. References _current_colliding, _in_pattern, _last_colliding, and throw_event_pattern(). |
|
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. Reimplemented in CollisionHandlerPhysical. Definition at line 63 of file collisionHandlerEvent.cxx. References _current_colliding, CollisionEntry::get_from_node(), CollisionEntry::get_into_node(), nassertv, and NULL. Referenced by CollisionHandlerPhysical::CollisionHandlerPhysical(). |
|
Empties the list of elements that all colliders are known to be colliding with. No "out" events will be thrown; if the same collision is detected next frame, a new "in" event will be thrown for each collision. This can be called each frame to defeat the persistent "in" event mechanism, which prevents the same "in" event from being thrown repeatedly. However, also see set_again_pattern(), which can be used to set the event that is thrown when a collision is detected for two or more consecutive frames. Definition at line 199 of file collisionHandlerEvent.cxx. |
|
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 CollisionHandler. Reimplemented in CollisionHandlerPhysical. Definition at line 113 of file collisionHandlerEvent.cxx. Referenced by CollisionHandlerPhysical::begin_group(). |
|
Reimplemented from CollisionHandler. Reimplemented in CollisionHandlerFloor, CollisionHandlerPhysical, and CollisionHandlerPusher. Definition at line 102 of file collisionHandlerEvent.h. |
|
Returns the pattern string that indicates how the event names are generated when a collision between two particular nodes is *still* detected. See set_again_pattern() and set_in_pattern(). Definition at line 189 of file collisionHandlerEvent.I. |
|
Reimplemented from CollisionHandler. Reimplemented in CollisionHandlerFloor, CollisionHandlerPhysical, and CollisionHandlerPusher. Definition at line 91 of file collisionHandlerEvent.h. References CollisionHandler::get_class_type(), and CollisionHandler::init_type(). |
|
Returns the pattern string that indicates how the event names are generated for each collision detected. See set_in_pattern(). Definition at line 131 of file collisionHandlerEvent.I. References _out_pattern, and INLINE. |
|
Returns the pattern string that indicates how the event names are generated when a collision between two particular nodes is *no longer* detected. See set_out_pattern() and set_in_pattern(). Definition at line 242 of file collisionHandlerEvent.I. |
|
Returns the current reference count.
Definition at line 183 of file referenceCount.I. Referenced by RenderState::determine_bin_index(), RenderEffects::determine_show_bounds(), FontPool::ns_garbage_collect(), TexturePool::ns_garbage_collect(), MaterialPool::ns_get_material(), and TexturePool::ns_release_texture(). |
|
Reimplemented from CollisionHandler. Reimplemented in CollisionHandlerFloor, CollisionHandlerPhysical, and CollisionHandlerPusher. Definition at line 99 of file collisionHandlerEvent.h. |
|
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index(). Definition at line 71 of file typedObject.I. References TypeHandle::get_name(), TypedObject::get_type(), and INLINE. |
|
Reimplemented from CollisionHandler. Reimplemented in CollisionHandlerFloor, CollisionHandlerPhysical, and CollisionHandlerPusher. Definition at line 94 of file collisionHandlerEvent.h. |
|
Returns true if the current object is the indicated type exactly.
Definition at line 101 of file typedObject.I. Referenced by PT(), and CollisionNode::xform(). |
|
|
Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. Definition at line 225 of file referenceCount.I. Referenced by ClientDevice::ClientDevice(), EggGroupNode::find_textures(), EggGroupNode::r_apply_texmats(), EggGroupNode::r_flatten_transforms(), and EggGroupNode::reverse_vertex_ordering(). |
|
Sets the pattern string that indicates how the event names are generated when a collision between two particular nodes is *still* detected. This event is thrown each consecutive time a collision between two particular nodes is detected, starting with the second time. In general, the in_pattern event is thrown on the first detection of a collision between two particular nodes. In subsequent passes, as long as a collision between those two nodes continues to be detected each frame, the again_pattern is thrown. The first frame in which the collision is no longer detected, the out_pattern event is thrown. Definition at line 170 of file collisionHandlerEvent.I. |
|
Sets the pattern string that indicates how the event names are generated for each collision detected. This is a string that may contain any of the following: fn - the name of the "from" object's node in - the name of the "into" object's node ft - 't' if "from" is tangible, 'i' if intangible it - 't' if "into" is tangible, 'i' if intangible The event name will be based on the in_pattern string specified here, with all occurrences of the above strings replaced with the corresponding values. In general, the in_pattern event is thrown on the first detection of a collision between two particular nodes. In subsequent passes, as long as a collision between those two nodes continues to be detected each frame, the again_pattern is thrown. The first frame in which the collision is no longer detected, the out_pattern event is thrown. Definition at line 114 of file collisionHandlerEvent.I. |
|
Sets the pattern string that indicates how the event names are generated when a collision between two particular nodes is *no longer* detected. In general, the in_pattern event is thrown on the first detection of a collision between two particular nodes. In subsequent passes, as long as a collision between those two nodes continues to be detected each frame, the again_pattern is thrown. The first frame in which the collision is no longer detected, the out_pattern event is thrown. Definition at line 223 of file collisionHandlerEvent.I. |
|
Does some easy checks to make sure that the reference count isn't completely bogus.
Definition at line 328 of file referenceCount.I. References INLINE. Referenced by EggNode::determine_bin(), and ReferenceCount::~ReferenceCount(). |
|
Throws an event matching the indicated pattern.
Definition at line 213 of file collisionHandlerEvent.cxx. Referenced by add_entry(). |
|
Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. Definition at line 293 of file referenceCount.I. References INLINE. Referenced by RenderState::determine_bin_index(), and RenderEffects::determine_show_bounds(). |
|
Definition at line 73 of file collisionHandlerEvent.h. |
|
Definition at line 87 of file collisionHandlerEvent.h. Referenced by add_entry(), begin_group(), and CollisionHandlerEvent(). |
|
Definition at line 72 of file collisionHandlerEvent.h. Referenced by add_entry(). |
|
Definition at line 76 of file collisionHandlerEvent.h. |
|
Definition at line 88 of file collisionHandlerEvent.h. Referenced by add_entry(), and CollisionHandlerEvent(). |
|
Definition at line 74 of file collisionHandlerEvent.h. Referenced by get_in_pattern(). |
|
Reimplemented from CollisionHandler. Reimplemented in CollisionHandlerFloor, CollisionHandlerPhysical, and CollisionHandlerPusher. Definition at line 30 of file collisionHandlerEvent.cxx. |