Panda3D
bulletRigidBodyNode.I
1 // Filename: bulletRigidBodyNode.I
2 // Created by: enn0x (19Nov10)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: BulletRigidBodyNode::Destructor
18 // Access: Published
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE BulletRigidBodyNode::
22 ~BulletRigidBodyNode() {
23 
24  delete _rigid;
25  delete _motion;
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: BulletRigidBodyNode::set_linear_damping
30 // Access: Published
31 // Description:
32 ////////////////////////////////////////////////////////////////////
33 INLINE void BulletRigidBodyNode::
34 set_linear_damping(PN_stdfloat value) {
35 
36  _rigid->setDamping(value, _rigid->getAngularDamping());
37 }
38 
39 ////////////////////////////////////////////////////////////////////
40 // Function: BulletRigidBodyNode::set_angular_damping
41 // Access: Published
42 // Description:
43 ////////////////////////////////////////////////////////////////////
44 INLINE void BulletRigidBodyNode::
45 set_angular_damping(PN_stdfloat value) {
46 
47  _rigid->setDamping(_rigid->getLinearDamping(), value);
48 }
49 
50 ////////////////////////////////////////////////////////////////////
51 // Function: BulletRigidBodyNode::get_linear_damping
52 // Access: Published
53 // Description:
54 ////////////////////////////////////////////////////////////////////
55 INLINE PN_stdfloat BulletRigidBodyNode::
56 get_linear_damping() const {
57 
58  return (PN_stdfloat)_rigid->getLinearDamping();
59 }
60 
61 ////////////////////////////////////////////////////////////////////
62 // Function: BulletRigidBodyNode::get_angular_damping
63 // Access: Published
64 // Description:
65 ////////////////////////////////////////////////////////////////////
66 INLINE PN_stdfloat BulletRigidBodyNode::
67 get_angular_damping() const {
68 
69  return (PN_stdfloat)_rigid->getAngularDamping();
70 }
71