15 #ifndef __BULLET_BODY_NODE_H__ 16 #define __BULLET_BODY_NODE_H__ 18 #include "pandabase.h" 20 #include "bullet_includes.h" 21 #include "bullet_utils.h" 23 #include "pandaNode.h" 24 #include "collideMask.h" 25 #include "collisionNode.h" 26 #include "transformState.h" 27 #include "boundingSphere.h" 42 void add_shape(
BulletShape *shape,
const TransformState *xform=TransformState::make_identity());
45 INLINE
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;
56 INLINE
bool is_static()
const;
57 INLINE
bool is_kinematic()
const;
59 INLINE
void set_static(
bool value);
60 INLINE
void set_kinematic(
bool value);
65 INLINE
void notify_collisions(
bool value);
66 INLINE
bool notifies_collisions()
const;
68 INLINE
void set_collision_response(
bool value);
69 INLINE
bool get_collision_response()
const;
71 bool check_collision_with(
PandaNode *node);
73 bool has_contact_response()
const;
75 PN_stdfloat get_contact_processing_threshold()
const;
76 void set_contact_processing_threshold(PN_stdfloat threshold);
79 bool is_active()
const;
80 void set_active(
bool active,
bool force=
false);
82 void set_deactivation_time(PN_stdfloat dt);
83 PN_stdfloat get_deactivation_time()
const;
85 void set_deactivation_enabled(
const bool enabled,
const bool force=
false);
86 bool is_deactivation_enabled()
const;
89 INLINE
void set_debug_enabled(
const bool enabled);
90 INLINE
bool is_debug_enabled()
const;
93 INLINE PN_stdfloat get_restitution()
const;
94 INLINE
void set_restitution(PN_stdfloat restitution);
96 INLINE PN_stdfloat get_friction()
const;
97 INLINE
void set_friction(PN_stdfloat friction);
99 #if BT_BULLET_VERSION >= 281 100 INLINE PN_stdfloat get_rolling_friction()
const;
101 INLINE
void set_rolling_friction(PN_stdfloat friction);
104 INLINE
bool has_anisotropic_friction()
const;
105 void set_anisotropic_friction(
const LVecBase3 &friction);
106 LVecBase3 get_anisotropic_friction()
const;
109 PN_stdfloat get_ccd_swept_sphere_radius()
const;
110 PN_stdfloat get_ccd_motion_threshold()
const;
111 void set_ccd_swept_sphere_radius(PN_stdfloat radius);
112 void set_ccd_motion_threshold(PN_stdfloat threshold);
115 void set_transform_dirty();
118 virtual btCollisionObject *get_object()
const = 0;
129 virtual void output(ostream &out)
const;
132 INLINE
void set_collision_flag(
int flag,
bool value);
133 INLINE
bool get_collision_flag(
int flag)
const;
135 btCollisionShape *_shape;
138 BulletShapes _shapes;
141 virtual void shape_changed();
143 static bool is_identity(btTransform &trans);
150 static void init_type() {
151 PandaNode::init_type();
152 register_type(_type_handle,
"BulletBodyNode",
153 PandaNode::get_class_type());
156 return get_class_type();
160 return get_class_type();
167 #include "bulletBodyNode.I" 169 #endif // __BULLET_BODY_NODE_H__ A basic node of the scene graph or data graph.
This is the base class for all three-component vectors and points.
virtual CollideMask get_legal_collide_mask() const
Returns the subset of CollideMask bits that may be set for this particular type of PandaNode...
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.
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 a three-component point in space (as opposed to a three-component vector, which represents a ...
virtual bool safe_to_combine() const
Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of...
This is a 4-by-4 transform matrix.
void set_into_collide_mask(CollideMask mask)
Sets the "into" CollideMask.
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 ...
A node in the scene graph that can hold any number of CollisionSolids.
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...
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of PandaNode by duplicating ...