31class EXPCL_PANDABULLET BulletRigidBodyNode :
public BulletBodyNode {
34 explicit BulletRigidBodyNode(
const char *name=
"rigid");
35 INLINE ~BulletRigidBodyNode();
43 LVector3 get_inv_inertia_diag_local()
const;
44 LMatrix3 get_inv_inertia_tensor_world()
const;
47 LVector3 get_linear_velocity()
const;
48 LVector3 get_angular_velocity()
const;
49 void set_linear_velocity(
const LVector3 &velocity);
50 void set_angular_velocity(
const LVector3 &velocity);
53 PN_stdfloat get_linear_damping()
const;
54 PN_stdfloat get_angular_damping()
const;
55 void set_linear_damping(PN_stdfloat value);
56 void set_angular_damping(PN_stdfloat value);
60 void apply_force(
const LVector3 &force,
const LPoint3 &pos);
61 void apply_central_force(
const LVector3 &force);
62 void apply_impulse(
const LVector3 &impulse,
const LPoint3 &pos);
63 void apply_central_impulse(
const LVector3 &impulse);
64 void apply_torque(
const LVector3 &torque);
65 void apply_torque_impulse(
const LVector3 &torque);
67 LVector3 get_total_force()
const;
68 LVector3 get_total_torque()
const;
71 PN_stdfloat get_linear_sleep_threshold()
const;
72 PN_stdfloat get_angular_sleep_threshold()
const;
73 void set_linear_sleep_threshold(PN_stdfloat threshold);
74 void set_angular_sleep_threshold(PN_stdfloat threshold);
77 void set_gravity(
const LVector3 &gravity);
78 LVector3 get_gravity()
const;
81 LVector3 get_linear_factor()
const;
82 LVector3 get_angular_factor()
const;
83 void set_linear_factor(
const LVector3 &factor);
84 void set_angular_factor(
const LVector3 &factor);
92 MAKE_PROPERTY(inv_inertia_diag_local, get_inv_inertia_diag_local);
93 MAKE_PROPERTY(inv_inertia_tensor_world, get_inv_inertia_tensor_world);
94 MAKE_PROPERTY(linear_velocity, get_linear_velocity, set_linear_velocity);
95 MAKE_PROPERTY(angular_velocity, get_angular_velocity, set_angular_velocity);
96 MAKE_PROPERTY(linear_damping, get_linear_damping, set_linear_damping);
97 MAKE_PROPERTY(angular_damping, get_angular_damping, set_angular_damping);
98 MAKE_PROPERTY(total_force, get_total_force);
99 MAKE_PROPERTY(total_torque, get_total_torque);
100 MAKE_PROPERTY(linear_sleep_threshold, get_linear_sleep_threshold, set_linear_sleep_threshold);
101 MAKE_PROPERTY(angular_sleep_threshold, get_angular_sleep_threshold, set_angular_sleep_threshold);
102 MAKE_PROPERTY(gravity, get_gravity, set_gravity);
103 MAKE_PROPERTY(linear_factor, get_linear_factor, set_linear_factor);
104 MAKE_PROPERTY(angular_factor, get_angular_factor, set_angular_factor);
107 virtual btCollisionObject *get_object()
const;
109 virtual void output(std::ostream &out)
const;
115 virtual void parents_changed();
116 virtual void transform_changed();
119 virtual void do_shape_changed();
120 void do_transform_changed();
122 void do_set_mass(PN_stdfloat mass);
123 PN_stdfloat do_get_mass()
const;
127 class MotionState :
public btMotionState {
132 virtual void getWorldTransform(btTransform &trans)
const;
133 virtual void setWorldTransform(
const btTransform &trans);
137 void sync_b2p(PandaNode *node);
138 bool sync_disabled()
const;
166 static void init_type() {
167 BulletBodyNode::init_type();
169 BulletBodyNode::get_class_type());
171 virtual TypeHandle get_type()
const {
172 return get_class_type();
174 virtual TypeHandle force_init_type() {
176 return get_class_type();
180 static TypeHandle _type_handle;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
set_mass
Sets the mass of a rigid body.
get_mass
Returns the total mass of a rigid body.
void do_sync_b2p()
Assumes the lock(bullet global lock) is held by the caller.
bool pick_dirty_flag()
Returns TRUE if the transform of the rigid body has changed at least once since the last call to this...
get_inv_mass
Returns the inverse mass of a rigid body.
set_inertia
Sets the inertia of a rigid body.
get_inertia
Returns the inertia of the rigid body.
void do_sync_p2b()
Assumes the lock(bullet global lock) is held by the caller.