Panda3D
bulletConstraint.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file bulletConstraint.cxx
10  * @author enn0x
11  * @date 2010-03-01
12  */
13 
14 #include "bulletConstraint.h"
15 
16 #include "bulletRigidBodyNode.h"
17 #include "bulletShape.h"
18 
19 TypeHandle BulletConstraint::_type_handle;
20 
21 /**
22  *
23  */
24 void BulletConstraint::
25 enable_feedback(bool value) {
26 
27  ptr()->enableFeedback(value);
28 }
29 
30 /**
31  *
32  */
33 PN_stdfloat BulletConstraint::
34 get_applied_impulse() const {
35 
36  return (PN_stdfloat)ptr()->getAppliedImpulse();
37 }
38 
39 /**
40  *
41  */
42 void BulletConstraint::
43 set_debug_draw_size(PN_stdfloat size) {
44 
45  ptr()->setDbgDrawSize((btScalar)size);
46 }
47 
48 /**
49  *
50  */
51 PN_stdfloat BulletConstraint::
52 get_debug_draw_size() {
53 
54  return (PN_stdfloat)ptr()->getDbgDrawSize();
55 }
56 
57 /**
58  *
59  */
60 BulletRigidBodyNode *BulletConstraint::
61 get_rigid_body_a() {
62 
63  return (BulletRigidBodyNode *)ptr()->getRigidBodyA().getUserPointer();
64 }
65 
66 /**
67  *
68  */
69 BulletRigidBodyNode *BulletConstraint::
70 get_rigid_body_b() {
71 
72  return (BulletRigidBodyNode *)ptr()->getRigidBodyB().getUserPointer();
73 }
74 
75 /**
76  *
77  */
78 void BulletConstraint::
79 set_param(ConstraintParam num, PN_stdfloat value, int axis) {
80 
81  ptr()->setParam((btConstraintParams)num, (btScalar)value, axis);
82 }
83 
84 /**
85  *
86  */
87 PN_stdfloat BulletConstraint::
88 get_param(ConstraintParam num, int axis) {
89 
90  return (PN_stdfloat)ptr()->getParam((btConstraintParams)num, axis);
91 }
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81