Panda3D
 All Classes Functions Variables Enumerations
bulletConstraint.cxx
1 // Filename: bulletConstraint.cxx
2 // Created by: enn0x (01Mar10)
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 #include "bulletConstraint.h"
16 #include "bulletRigidBodyNode.h"
17 
18 TypeHandle BulletConstraint::_type_handle;
19 
20 ////////////////////////////////////////////////////////////////////
21 // Function: BulletConstraint::enable_feedback
22 // Access: Published
23 // Description:
24 ////////////////////////////////////////////////////////////////////
25 void BulletConstraint::
26 enable_feedback(bool value) {
27 
28  ptr()->enableFeedback(value);
29 }
30 
31 ////////////////////////////////////////////////////////////////////
32 // Function: BulletConstraint::get_applied_impulse
33 // Access: Published
34 // Description:
35 ////////////////////////////////////////////////////////////////////
36 PN_stdfloat BulletConstraint::
37 get_applied_impulse() const {
38 
39  return (PN_stdfloat)ptr()->getAppliedImpulse();
40 }
41 
42 ////////////////////////////////////////////////////////////////////
43 // Function: BulletConstraint::set_dbg_draw_size
44 // Access: Published
45 // Description:
46 ////////////////////////////////////////////////////////////////////
47 void BulletConstraint::
48 set_debug_draw_size(PN_stdfloat size) {
49 
50  ptr()->setDbgDrawSize((btScalar)size);
51 }
52 
53 ////////////////////////////////////////////////////////////////////
54 // Function: BulletConstraint::get_dbg_draw_size
55 // Access: Published
56 // Description:
57 ////////////////////////////////////////////////////////////////////
58 PN_stdfloat BulletConstraint::
59 get_debug_draw_size() {
60 
61  return (PN_stdfloat)ptr()->getDbgDrawSize();
62 }
63 
64 ////////////////////////////////////////////////////////////////////
65 // Function: BulletConstraint::get_rigid_body_a
66 // Access: Published
67 // Description:
68 ////////////////////////////////////////////////////////////////////
69 BulletRigidBodyNode *BulletConstraint::
70 get_rigid_body_a() {
71 
72  return (BulletRigidBodyNode *)ptr()->getRigidBodyA().getUserPointer();
73 }
74 
75 ////////////////////////////////////////////////////////////////////
76 // Function: BulletConstraint::get_rigid_body_b
77 // Access: Published
78 // Description:
79 ////////////////////////////////////////////////////////////////////
80 BulletRigidBodyNode *BulletConstraint::
81 get_rigid_body_b() {
82 
83  return (BulletRigidBodyNode *)ptr()->getRigidBodyB().getUserPointer();
84 }
85 
86 ////////////////////////////////////////////////////////////////////
87 // Function: BulletConstraint::set_param
88 // Access: Published
89 // Description:
90 ////////////////////////////////////////////////////////////////////
91 void BulletConstraint::
92 set_param(ConstraintParam num, PN_stdfloat value, int axis) {
93 
94  ptr()->setParam((btConstraintParams)num, (btScalar)value, axis);
95 }
96 
97 ////////////////////////////////////////////////////////////////////
98 // Function: BulletConstraint::get_param
99 // Access: Published
100 // Description:
101 ////////////////////////////////////////////////////////////////////
102 PN_stdfloat BulletConstraint::
103 get_param(ConstraintParam num, int axis) {
104 
105  return (PN_stdfloat)ptr()->getParam((btConstraintParams)num, axis);
106 }
107 
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85