14#ifndef COLLISIONNODE_H
15#define COLLISIONNODE_H
30class EXPCL_PANDA_COLLIDE CollisionNode :
public PandaNode {
32 explicit CollisionNode(
const std::string &name);
35 CollisionNode(
const CollisionNode ©);
38 virtual ~CollisionNode();
41 virtual void xform(
const LMatrix4 &mat);
49 virtual void output(std::ostream &out)
const;
64 INLINE
size_t get_num_solids()
const;
66 MAKE_SEQ(get_solids, get_num_solids, get_solid);
82 virtual void compute_internal_bounds(CPT(
BoundingVolume) &internal_bounds,
83 int &internal_vertices,
85 Thread *current_thread)
const;
92 CollideMask _from_collide_mask;
98 friend class CollisionTraverser;
106 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
113 static void init_type() {
114 PandaNode::init_type();
116 PandaNode::get_class_type());
118 virtual TypeHandle get_type()
const {
119 return get_class_type();
121 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
124 static TypeHandle _type_handle;
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
get_into_collide_mask
Returns the current "into" CollideMask.
set_collider_sort
Sets a particular collider_sort value on this node.
insert_solid
Inserts the indicated solid to the node at the indicated position.
set_solid
Replaces the solid with the indicated index.
void set_collide_mask(CollideMask mask)
Simultaneously sets both the "from" and "into" CollideMask values to the same thing.
set_into_collide_mask
Sets the "into" CollideMask.
get_from_collide_mask
Returns the current "from" CollideMask.
get_collider_sort
Returns the collider_sort value that has been set for this particular node.
get_default_collide_mask
Returns the default into_collide_mask assigned to new CollisionNodes.
void clear_solids()
Removes all solids from the node.
remove_solid
Removes the solid with the indicated index.
virtual void output(std::ostream &out) const
Writes a brief description of the node to the indicated output stream.
set_from_collide_mask
Sets the "from" CollideMask.
size_t add_solid(const CollisionSolid *solid)
Adds the indicated solid to the node.
The abstract base class for all things that can collide with other things in the world,...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual bool preserve_name() const
Returns true if the node's name has extrinsic meaning and must be preserved across a flatten operatio...
virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data)
This function will be called during the cull traversal to perform any additional operations that shou...
virtual PandaNode * combine_with(PandaNode *other)
Collapses this PandaNode with the other PandaNode, if possible, and returns a pointer to the combined...
virtual bool is_renderable() const
Returns true if there is some value to visiting this particular node during the cull traversal for an...
get_legal_collide_mask
Returns the subset of CollideMask bits that may be set for this particular type of PandaNode.
get_into_collide_mask
Returns the "into" collide mask for this node.
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
virtual void xform(const LMatrix4 &mat)
Transforms the contents of this PandaNode by the indicated matrix, if it means anything to do so.
virtual bool is_collision_node() const
A simple downcast check.
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
set_into_collide_mask
Sets the "into" CollideMask.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
A thread; that is, a lightweight process.
TypeHandle is the identifier used to differentiate C++ class types.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
This is our own Panda specialization on the default STL list.
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(),...