Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CollisionHandlerPusher Class Reference

A specialized kind of CollisionHandler that simply pushes back on things that attempt to move into solid walls. More...

`#include "collisionHandlerPusher.h"`

Inheritance diagram for CollisionHandlerPusher:

## Public Member Functions
virtual TypeHandle | force_init_type ()
bool | get_horizontal () const
virtual TypeHandle | get_type () const
void | read_datagram (DatagramIterator &source)
| Restores the object state from the given datagram, previously obtained using __getstate__.
void | set_horizontal (bool flag)
void | write_datagram (Datagram &destination) const
| Serializes this object, to implement pickle support.
Public Member Functions inherited from CollisionHandlerPhysical
void | add_collider (const NodePath &collider, const NodePath &target)
| Adds a new collider to the list with a NodePath that will be updated with the collider's new position, or updates the existing collider with a new NodePath object.
void | add_collider (const NodePath &collider, const NodePath &target, DriveInterface *drive_interface)
| Adds a new collider to the list with a NodePath that will be updated with the collider's new position, or updates the existing collider with a new NodePath object.
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_center ()
void | clear_colliders ()
| Completely empties the list of colliders this handler knows about.
virtual bool | end_group ()
| Called by the CollisionTraverser at the completion of all collision detections for this traversal.
const NodePath & | get_center () const
bool | has_center () const
bool | has_collider (const NodePath &collider) const
| Returns true if the handler knows about the indicated collider, false otherwise.
bool | has_contact () const
| Did the handler make any contacts with anything on the last collision pass?
bool | remove_collider (const NodePath &collider)
| Removes the collider from the list of colliders that this handler knows about.
void | set_center (const NodePath &center)
Public Member Functions inherited from CollisionHandlerEvent
| CollisionHandlerEvent ()
| The default CollisionHandlerEvent will throw no events.
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.
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.
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.
void | clear ()
| Empties the list of elements that all colliders are known to be colliding with.
void | clear_again_patterns ()
| Removes all of the previously-added in patterns.
void | clear_in_patterns ()
| Removes all of the previously-added in patterns.
void | clear_out_patterns ()
| Removes all of the previously-added in patterns.
void | flush ()
| Same as clear() except "out" events are thrown.
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 | read_datagram (DatagramIterator &source)
| Restores the object state from the given datagram, previously obtained using __getstate__.
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.
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.
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.
void | write_datagram (Datagram &destination) const
| Serializes this object, to implement pickle support.
Public Member Functions inherited from CollisionHandler
void | set_root (const NodePath &root)
| Sets the root of the collision traversal.
bool | wants_all_potential_collidees () const
| Returns true if handler wants to know about all solids that are within the collider's bounding volume.
Public Member Functions inherited from TypedReferenceCount
| TypedReferenceCount (const TypedReferenceCount &copy)
void | operator= (const TypedReferenceCount &copy)
Public Member Functions inherited from TypedObject
| TypedObject (const TypedObject &copy)=default
TypedObject * | as_typed_object ()
| Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObject * | as_typed_object () const
| Returns the object, upcast (if necessary) to a TypedObject pointer.
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.
bool | is_exact_type (TypeHandle handle) const
| Returns true if the current object is the indicated type exactly.
bool | is_of_type (TypeHandle handle) const
| Returns true if the current object is or derives from the indicated type.
TypedObject & | operator= (const TypedObject &copy)=default
Public Member Functions inherited from MemoryBase
void | operator delete (void *, void *)
void | operator delete (void *ptr)
void | operator delete[] (void *, void *)
void | operator delete[] (void *ptr)
void * | operator new (size_t size)
void * | operator new (size_t size, void *ptr)
void * | operator new[] (size_t size)
void * | operator new[] (size_t size, void *ptr)
Public Member Functions inherited from ReferenceCount
int | get_ref_count () const
WeakReferenceList * | get_weak_list () const
| Returns the WeakReferenceList associated with this ReferenceCount object.
bool | has_weak_list () const
| Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
void | local_object ()
| This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
void | ref () const
| Explicitly increments the reference count.
bool | ref_if_nonzero () const
| Atomically increases the reference count of this object if it is not zero.
bool | test_ref_count_integrity () const
| Does some easy checks to make sure that the reference count isn't completely bogus.
bool | test_ref_count_nonzero () const
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
virtual bool | unref () const
| Explicitly decrements the reference count.
bool | unref_if_one () const
| Atomically decreases the reference count of this object if it is one.
WeakReferenceList * | weak_ref ()
| Adds the indicated PointerToVoid as a weak reference to this object.
void | weak_unref ()
| Removes the indicated PointerToVoid as a weak reference to this object.

## Static Public Member Functions
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from CollisionHandlerPhysical
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.
Static Public Member Functions inherited from ReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()

## Public Attributes
| get_horizontal
| set_horizontal
Public Attributes inherited from CollisionHandlerPhysical
| clear_center
| Clears the center NodePath specified with set_center.
| get_center
| Returns the NodePath specified with set_center, or the empty NodePath if nothing has been specified.
| has_center
| Returns true if a NodePath has been specified with set_center(), false otherwise.
| set_center
| Specifies an arbitrary NodePath that the handler is always considered to be facing.
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.
| get_in_pattern
| Returns the nth pattern string that indicates how the event names are generated for each collision detected.
| get_num_again_patterns
| Returns the number of in pattern strings that have been added.
| get_num_in_patterns
| Returns the number of in pattern strings that have been added.
| get_num_out_patterns
| Returns the number of in pattern strings that have been added.
| get_out_pattern
| Returns the nth pattern string that indicates how the event names are generated for each collision detected.
Public Attributes inherited from TypedObject
| get_type
Public Attributes inherited from ReferenceCount
| get_ref_count
| Returns the current reference count.

## Detailed Description

A specialized kind of CollisionHandler that simply pushes back on things that attempt to move into solid walls.

This is the simplest kind of "real- world" collisions you can have.

Definition at line 26 of file collisionHandlerPusher.h.

## Constructor & Destructor Documentation

## ◆ CollisionHandlerPusher()

CollisionHandlerPusher::CollisionHandlerPusher | ( |  | ) |

Definition at line 40 of file collisionHandlerPusher.cxx.

## ◆ ~CollisionHandlerPusher()

CollisionHandlerPusher::~CollisionHandlerPusher | ( |  | ) |
| virtual

Definition at line 48 of file collisionHandlerPusher.cxx.

## Member Function Documentation

## ◆ force_init_type()

virtual TypeHandle CollisionHandlerPusher::force_init_type | ( |  | ) |
| inline virtual

Reimplemented from CollisionHandlerPhysical.

Definition at line 62 of file collisionHandlerPusher.h.

## ◆ get_class_type()

static TypeHandle CollisionHandlerPusher::get_class_type | ( |  | ) |
| inline static

Definition at line 51 of file collisionHandlerPusher.h.

## ◆ get_type()

virtual TypeHandle CollisionHandlerPusher::get_type | ( |  | ) | const
| inline virtual

Reimplemented from CollisionHandlerPhysical.

Definition at line 59 of file collisionHandlerPusher.h.

## ◆ init_type()

static void CollisionHandlerPusher::init_type | ( |  | ) |
| inline static

Definition at line 54 of file collisionHandlerPusher.h.

## ◆ read_datagram()

void CollisionHandlerPusher::read_datagram | ( | DatagramIterator & | source | ) |

Restores the object state from the given datagram, previously obtained using __getstate__.

Definition at line 66 of file collisionHandlerPusher.cxx.

References DatagramIterator::get_bool(), and CollisionHandlerEvent::read_datagram().

## ◆ write_datagram()

void CollisionHandlerPusher::write_datagram | ( | Datagram & | destination | ) | const

Serializes this object, to implement pickle support.

Definition at line 55 of file collisionHandlerPusher.cxx.

References Datagram::add_bool(), and CollisionHandlerEvent::write_datagram().

## Member Data Documentation

## ◆ get_horizontal

bool CollisionHandlerPusher::get_horizontal
| inline

Definition at line 35 of file collisionHandlerPusher.h.

## ◆ set_horizontal

void CollisionHandlerPusher::set_horizontal
| inline

Definition at line 35 of file collisionHandlerPusher.h.

The documentation for this class was generated from the following files:

- panda/src/collide/collisionHandlerPusher.h
- panda/src/collide/collisionHandlerPusher.cxx
- panda/src/collide/collisionHandlerPusher.I