14#ifndef COLLISIONSOLID_H
15#define COLLISIONSOLID_H
45class EXPCL_PANDA_COLLIDE CollisionSolid :
public CopyOnWriteObject {
48 CollisionSolid(
const CollisionSolid ©);
49 virtual ~CollisionSolid();
51 virtual CollisionSolid *make_copy()=0;
53 virtual PT(CopyOnWriteObject) make_cow_copy();
56 virtual LPoint3 get_collision_origin()
const=0;
57 MAKE_PROPERTY(collision_origin, get_collision_origin);
70 MAKE_PROPERTY(respect_effective_normal,
82 virtual void xform(
const LMatrix4 &mat);
86 bool bounds_only)
const;
92 virtual void output(std::ostream &out)
const;
93 virtual void write(std::ostream &out,
int indent_level = 0)
const;
96 INLINE
bool do_is_tangible()
const;
97 INLINE
bool do_has_effective_normal()
const;
99 INLINE
void mark_internal_bounds_stale();
109 test_intersection_from_segment(
const CollisionEntry &entry)
const;
111 test_intersection_from_capsule(
const CollisionEntry &entry)
const;
113 test_intersection_from_parabola(
const CollisionEntry &entry)
const;
117 static void report_undefined_intersection_test(
TypeHandle from_type,
119 static void report_undefined_from_intersection(
TypeHandle from_type);
121 INLINE
void mark_viz_stale();
122 virtual void fill_viz_geom();
135 LVector3 _effective_normal;
141 F_effective_normal = 0x02,
142 F_viz_geom_stale = 0x04,
143 F_ignore_effective_normal = 0x08,
144 F_internal_bounds_stale = 0x10,
163 static void init_type() {
164 CopyOnWriteObject::init_type();
166 CopyOnWriteObject::get_class_type());
168 virtual TypeHandle get_type()
const {
169 return get_class_type();
171 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
174 static TypeHandle _type_handle;
176 friend class CollisionSphere;
177 friend class CollisionLine;
178 friend class CollisionRay;
179 friend class CollisionSegment;
180 friend class CollisionCapsule;
181 friend class CollisionParabola;
182 friend class CollisionHandlerFluidPusher;
183 friend class CollisionBox;
186INLINE std::ostream &operator << (std::ostream &out,
const CollisionSolid &cs) {
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
Defines a single collision event.
The abstract interface to a number of classes that decide what to do when a collision is detected.
A node in the scene graph that can hold any number of CollisionSolids.
The abstract base class for all things that can collide with other things in the world,...
bool has_effective_normal() const
Returns true if a special normal was set by set_effective_normal(), false otherwise.
set_tangible
Sets the current state of the 'tangible' flag.
virtual PStatCollector & get_test_pcollector()
Returns a PStatCollector that is used to count the number of intersection tests made against a solid ...
get_bounds
Returns the solid's bounding volume.
is_tangible
Returns whether the solid is considered 'tangible' or not.
const LVector3 & get_effective_normal() const
Returns the normal that was set by set_effective_normal().
set_respect_effective_normal
This is only meaningful for CollisionSolids that will be added to a traverser as colliders.
set_bounds
Returns the solid's bounding volume.
void clear_effective_normal()
Removes the normal previously set by set_effective_normal().
virtual void xform(const LMatrix4 &mat)
Transforms the solid by the indicated matrix.
get_respect_effective_normal
See set_respect_effective_normal().
void set_effective_normal(const LVector3 &effective_normal)
Records a false normal for this CollisionSolid that will be reported by the collision system with all...
virtual PStatCollector & get_volume_pcollector()
Returns a PStatCollector that is used to count the number of bounding volume tests made against a sol...
A spherical collision volume or object.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
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 ...
A node that holds Geom objects, renderable pieces of geometry.
This is a standard, non-reentrant mutex, similar to the Mutex class.
A lightweight class that represents a single element that may be timed and/or counted via stats.
A basic node of the scene graph or data graph.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
TypeHandle is the identifier used to differentiate C++ class types.
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
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.
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(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.