14#ifndef COLLISIONHANDLERPHYSICAL_H
15#define COLLISIONHANDLERPHYSICAL_H
33 CollisionHandlerPhysical();
34 virtual ~CollisionHandlerPhysical();
57 EXTENSION(PyObject *__reduce__(PyObject *self)
const);
58 EXTENSION(
void __setstate__(PyObject *self, vector_uchar data, PyObject *nodepaths));
67 INLINE
void set_target(
const NodePath &target,
69 INLINE
void updated_transform();
75 virtual bool handle_entries()=0;
76 virtual void apply_linear_force(ColliderDef &def,
const LVector3 &force)=0;
78 virtual bool validate_target(
const NodePath &target);
81 typedef pmap<NodePath, Entries> FromEntries;
82 FromEntries _from_entries;
84 typedef pmap<NodePath, ColliderDef> Colliders;
95 static void init_type() {
96 CollisionHandlerEvent::init_type();
98 CollisionHandlerEvent::get_class_type());
100 virtual TypeHandle get_type()
const {
101 return get_class_type();
103 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
106 static TypeHandle _type_handle;
Defines a single collision event.
virtual void begin_group()
Will be called by the CollisionTraverser before a new traversal is begun.
CollisionHandlerEvent()
The default CollisionHandlerEvent will throw no events.
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.
The abstract base class for a number of CollisionHandlers that have some physical effect on their mov...
bool has_contact() const
Did the handler make any contacts with anything on the last collision pass?
has_center
Returns true if a NodePath has been specified with set_center(), false otherwise.
clear_center
Clears the center NodePath specified with set_center.
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...
bool remove_collider(const NodePath &collider)
Removes the collider from the list of colliders that this handler knows about.
void clear_colliders()
Completely empties the list of colliders this handler knows about.
bool has_collider(const NodePath &collider) const
Returns true if the handler knows about the indicated collider, false otherwise.
set_center
Specifies an arbitrary NodePath that the handler is always considered to be facing.
get_center
Returns the NodePath specified with set_center, or the empty NodePath if nothing has been specified.
This is a TFormer, similar to Trackball, that moves around a transform matrix in response to mouse in...
The default class template does not define any methods.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...