Panda3D
 All Classes Functions Variables Enumerations
bulletRotationalLimitMotor.I
1 // Filename: bulletRotationalLimitMotor.I
2 // Created by: enn0x (03Mar13)
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: BulletRotationalLimitMotor::is_limited
18 // Access: Published
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE bool BulletRotationalLimitMotor::
22 is_limited() const {
23 
24  return _motor.isLimited();
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: BulletRotationalLimitMotor::set_motor_enabled
29 // Access: Published
30 // Description:
31 ////////////////////////////////////////////////////////////////////
32 INLINE void BulletRotationalLimitMotor::
33 set_motor_enabled(bool enabled) {
34 
35  _motor.m_enableMotor = enabled;
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: BulletRotationalLimitMotor::get_motor_enabled
40 // Access: Published
41 // Description:
42 ////////////////////////////////////////////////////////////////////
43 INLINE bool BulletRotationalLimitMotor::
44 get_motor_enabled() const {
45 
46  return _motor.m_enableMotor;
47 }
48 
49 ////////////////////////////////////////////////////////////////////
50 // Function: BulletRotationalLimitMotor::set_low_limit
51 // Access: Published
52 // Description:
53 ////////////////////////////////////////////////////////////////////
54 INLINE void BulletRotationalLimitMotor::
55 set_low_limit(PN_stdfloat limit) {
56 
57  _motor.m_loLimit = (btScalar)limit;
58 }
59 
60 ////////////////////////////////////////////////////////////////////
61 // Function: BulletRotationalLimitMotor::set_high_limit
62 // Access: Published
63 // Description:
64 ////////////////////////////////////////////////////////////////////
65 INLINE void BulletRotationalLimitMotor::
66 set_high_limit(PN_stdfloat limit) {
67 
68  _motor.m_hiLimit = (btScalar)limit;
69 }
70 
71 ////////////////////////////////////////////////////////////////////
72 // Function: BulletRotationalLimitMotor::set_target_velocity
73 // Access: Published
74 // Description:
75 ////////////////////////////////////////////////////////////////////
76 INLINE void BulletRotationalLimitMotor::
77 set_target_velocity(PN_stdfloat velocity) {
78 
79  _motor.m_targetVelocity = (btScalar)velocity;
80 }
81 
82 ////////////////////////////////////////////////////////////////////
83 // Function: BulletRotationalLimitMotor::set_max_motor_force
84 // Access: Published
85 // Description:
86 ////////////////////////////////////////////////////////////////////
87 INLINE void BulletRotationalLimitMotor::
88 set_max_motor_force(PN_stdfloat force) {
89 
90  _motor.m_maxMotorForce = (btScalar)force;
91 }
92 
93 ////////////////////////////////////////////////////////////////////
94 // Function: BulletRotationalLimitMotor::set_max_limit_force
95 // Access: Published
96 // Description:
97 ////////////////////////////////////////////////////////////////////
98 INLINE void BulletRotationalLimitMotor::
99 set_max_limit_force(PN_stdfloat force) {
100 
101  _motor.m_maxLimitForce = (btScalar)force;
102 }
103 
104 ////////////////////////////////////////////////////////////////////
105 // Function: BulletRotationalLimitMotor::set_damping
106 // Access: Published
107 // Description:
108 ////////////////////////////////////////////////////////////////////
109 INLINE void BulletRotationalLimitMotor::
110 set_damping(PN_stdfloat damping) {
111 
112  _motor.m_damping = (btScalar)damping;
113 }
114 
115 ////////////////////////////////////////////////////////////////////
116 // Function: BulletRotationalLimitMotor::set_softness
117 // Access: Published
118 // Description:
119 ////////////////////////////////////////////////////////////////////
120 INLINE void BulletRotationalLimitMotor::
121 set_softness(PN_stdfloat softness) {
122 
123  _motor.m_limitSoftness = (btScalar)softness;
124 }
125 
126 ////////////////////////////////////////////////////////////////////
127 // Function: BulletRotationalLimitMotor::set_bounce
128 // Access: Published
129 // Description:
130 ////////////////////////////////////////////////////////////////////
131 INLINE void BulletRotationalLimitMotor::
132 set_bounce(PN_stdfloat bounce) {
133 
134  _motor.m_bounce = (btScalar)bounce;
135 }
136 
137 ////////////////////////////////////////////////////////////////////
138 // Function: BulletRotationalLimitMotor::set_normal_cfm
139 // Access: Published
140 // Description:
141 ////////////////////////////////////////////////////////////////////
142 INLINE void BulletRotationalLimitMotor::
143 set_normal_cfm(PN_stdfloat cfm) {
144 
145  _motor.m_normalCFM = (btScalar)cfm;
146 }
147 
148 ////////////////////////////////////////////////////////////////////
149 // Function: BulletRotationalLimitMotor::set_stop_cfm
150 // Access: Published
151 // Description:
152 ////////////////////////////////////////////////////////////////////
153 INLINE void BulletRotationalLimitMotor::
154 set_stop_cfm(PN_stdfloat cfm) {
155 
156  _motor.m_stopCFM = (btScalar)cfm;
157 }
158 
159 ////////////////////////////////////////////////////////////////////
160 // Function: BulletRotationalLimitMotor::set_stop_erp
161 // Access: Published
162 // Description:
163 ////////////////////////////////////////////////////////////////////
164 INLINE void BulletRotationalLimitMotor::
165 set_stop_erp(PN_stdfloat erp) {
166 
167  _motor.m_stopERP = (btScalar)erp;
168 }
169 
170 ////////////////////////////////////////////////////////////////////
171 // Function: BulletRotationalLimitMotor::get_current_limit
172 // Access: Published
173 // Description: Retrieves the current value of angle:
174 // 0 = free,
175 // 1 = at low limit,
176 // 2 = at high limit.
177 ////////////////////////////////////////////////////////////////////
180 
181  return _motor.m_currentLimit;
182 }
183 
184 ////////////////////////////////////////////////////////////////////
185 // Function: BulletRotationalLimitMotor::get_current_error
186 // Access: Published
187 // Description:
188 ////////////////////////////////////////////////////////////////////
189 INLINE PN_stdfloat BulletRotationalLimitMotor::
190 get_current_error() const {
191 
192  return (PN_stdfloat)_motor.m_currentLimitError;
193 }
194 
195 ////////////////////////////////////////////////////////////////////
196 // Function: BulletRotationalLimitMotor::get_current_position
197 // Access: Published
198 // Description:
199 ////////////////////////////////////////////////////////////////////
200 INLINE PN_stdfloat BulletRotationalLimitMotor::
201 get_current_position() const {
202 
203  return (PN_stdfloat)_motor.m_currentPosition;
204 }
205 
206 ////////////////////////////////////////////////////////////////////
207 // Function: BulletRotationalLimitMotor::get_accumulated_impulse
208 // Access: Published
209 // Description:
210 ////////////////////////////////////////////////////////////////////
211 INLINE PN_stdfloat BulletRotationalLimitMotor::
212 get_accumulated_impulse() const {
213 
214  return (PN_stdfloat)_motor.m_accumulatedImpulse;
215 }
216 
int get_current_limit() const
Retrieves the current value of angle: 0 = free, 1 = at low limit, 2 = at high limit.