14 #ifndef __BULLET_BODY_NODE_H__ 15 #define __BULLET_BODY_NODE_H__ 45 int get_num_shapes()
const;
47 MAKE_SEQ(get_shapes, get_num_shapes, get_shape);
49 LPoint3 get_shape_pos(
int idx)
const;
50 LMatrix4 get_shape_mat(
int idx)
const;
57 bool is_static()
const;
58 bool is_kinematic()
const;
60 INLINE
void set_static(
bool value);
61 INLINE
void set_kinematic(
bool value);
66 INLINE
void notify_collisions(
bool value);
67 INLINE
bool notifies_collisions()
const;
69 INLINE
void set_collision_response(
bool value);
70 INLINE
bool get_collision_response()
const;
72 bool check_collision_with(
PandaNode *node);
74 bool has_contact_response()
const;
76 PN_stdfloat get_contact_processing_threshold()
const;
77 void set_contact_processing_threshold(PN_stdfloat threshold);
80 bool is_active()
const;
81 void set_active(
bool active,
bool force=
false);
82 void force_active(
bool active);
84 void set_deactivation_time(PN_stdfloat dt);
85 PN_stdfloat get_deactivation_time()
const;
87 void set_deactivation_enabled(
bool enabled);
88 bool is_deactivation_enabled()
const;
91 INLINE
void set_debug_enabled(
const bool enabled);
92 INLINE
bool is_debug_enabled()
const;
95 PN_stdfloat get_restitution()
const;
96 void set_restitution(PN_stdfloat restitution);
98 PN_stdfloat get_friction()
const;
99 void set_friction(PN_stdfloat friction);
101 #if BT_BULLET_VERSION >= 281 102 PN_stdfloat get_rolling_friction()
const;
103 void set_rolling_friction(PN_stdfloat friction);
104 MAKE_PROPERTY(rolling_friction, get_rolling_friction, set_rolling_friction);
107 bool has_anisotropic_friction()
const;
108 void set_anisotropic_friction(
const LVecBase3 &friction);
109 LVecBase3 get_anisotropic_friction()
const;
112 PN_stdfloat get_ccd_swept_sphere_radius()
const;
113 PN_stdfloat get_ccd_motion_threshold()
const;
114 void set_ccd_swept_sphere_radius(PN_stdfloat radius);
115 void set_ccd_motion_threshold(PN_stdfloat threshold);
118 void set_transform_dirty();
120 MAKE_SEQ_PROPERTY(shapes, get_num_shapes, get_shape);
121 MAKE_SEQ_PROPERTY(shape_pos, get_num_shapes, get_shape_pos);
122 MAKE_SEQ_PROPERTY(shape_mat, get_num_shapes, get_shape_mat);
123 MAKE_SEQ_PROPERTY(shape_transform, get_num_shapes, get_shape_transform);
124 MAKE_PROPERTY(shape_bounds, get_shape_bounds);
125 MAKE_PROPERTY(
static, is_static, set_static);
126 MAKE_PROPERTY(kinematic, is_kinematic, set_kinematic);
127 MAKE_PROPERTY(collision_notification, notifies_collisions, notify_collisions);
128 MAKE_PROPERTY(collision_response, get_collision_response, set_collision_response);
129 MAKE_PROPERTY(contact_response, has_contact_response);
130 MAKE_PROPERTY(contact_processing_threshold, get_contact_processing_threshold, set_contact_processing_threshold);
131 MAKE_PROPERTY(active, is_active, force_active);
132 MAKE_PROPERTY(deactivation_time, get_deactivation_time, set_deactivation_time);
133 MAKE_PROPERTY(deactivation_enabled, is_deactivation_enabled, set_deactivation_enabled);
134 MAKE_PROPERTY(debug_enabled, is_debug_enabled, set_debug_enabled);
135 MAKE_PROPERTY(restitution, get_restitution, set_restitution);
136 MAKE_PROPERTY(friction, get_friction, set_friction);
137 MAKE_PROPERTY(anisotropic_friction, get_anisotropic_friction, set_anisotropic_friction);
138 MAKE_PROPERTY(ccd_swept_sphere_radius, get_ccd_swept_sphere_radius, set_ccd_swept_sphere_radius);
139 MAKE_PROPERTY(ccd_motion_threshold, get_ccd_motion_threshold, set_ccd_motion_threshold);
142 virtual btCollisionObject *get_object()
const = 0;
144 virtual CollideMask get_legal_collide_mask()
const;
153 virtual void output(std::ostream &out)
const;
154 virtual void do_output(std::ostream &out)
const;
157 void set_collision_flag(
int flag,
bool value);
158 bool get_collision_flag(
int flag)
const;
160 btCollisionShape *_shape;
163 BulletShapes _shapes;
166 virtual void do_shape_changed();
170 static bool is_identity(btTransform &trans);
185 static void init_type() {
186 PandaNode::init_type();
188 PandaNode::get_class_type());
191 return get_class_type();
195 return get_class_type();
204 #endif // __BULLET_BODY_NODE_H__ PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
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 is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
virtual bool safe_to_modify_transform() const
Returns true if it is safe to automatically adjust the transform on this kind of node.
This defines a bounding sphere, consisting of a center and a radius.
Base class for objects that can be written to and read from Bam files.
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.
virtual bool safe_to_combine_children() const
Returns true if it is generally safe to combine the children of this PandaNode with each other.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is our own Panda specialization on the default STL list.
virtual bool safe_to_combine() const
Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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().
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool safe_to_flatten_below() const
Returns true if a flatten operation may safely continue past this node, or false if nodes below this ...
set_into_collide_mask
Sets the "into" CollideMask.
virtual bool require_fully_complete() const
Some objects require all of their nested pointers to have been completed before the objects themselve...
A node in the scene graph that can hold any number of CollisionSolids.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
virtual bool safe_to_transform() const
Returns true if it is generally safe to transform this particular kind of PandaNode by calling the xf...
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of PandaNode by duplicating ...