Panda3D
bulletManifoldPoint.I
1 // Filename: bulletManifoldPoint.I
2 // Created by: enn0x (07Mar10)
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 // Function: BulletManifoldPoint::Destructor
17 // Access: Published
18 // Description:
19 ////////////////////////////////////////////////////////////////////
20 INLINE BulletManifoldPoint::
21 ~BulletManifoldPoint() {
22 
23 }
24 
25 ////////////////////////////////////////////////////////////////////
26 // Function: BulletManifoldPoint::set_lateral_friction_initialized
27 // Access: Published
28 // Description:
29 ////////////////////////////////////////////////////////////////////
30 INLINE void BulletManifoldPoint::
31 set_lateral_friction_initialized(bool value) {
32 #if BT_BULLET_VERSION >= 285
33  if (value) {
34  _pt.m_contactPointFlags |= BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED;
35  } else {
36  _pt.m_contactPointFlags &= ~BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED;
37  }
38 #else
39  _pt.m_lateralFrictionInitialized = value;
40 #endif
41 }
42 
43 ////////////////////////////////////////////////////////////////////
44 // Function: BulletManifoldPoint::get_lateral_friction_initialized
45 // Access: Published
46 // Description:
47 ////////////////////////////////////////////////////////////////////
48 INLINE bool BulletManifoldPoint::
49 get_lateral_friction_initialized() const {
50 #if BT_BULLET_VERSION >= 285
51  return (_pt.m_contactPointFlags & BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED) != 0;
52 #else
53  return _pt.m_lateralFrictionInitialized;
54 #endif
55 }
56 
57 ////////////////////////////////////////////////////////////////////
58 // Function: BulletManifoldPoint::set_lateral_friction_dir1
59 // Access: Published
60 // Description:
61 ////////////////////////////////////////////////////////////////////
62 INLINE void BulletManifoldPoint::
63 set_lateral_friction_dir1(const LVecBase3 &dir) {
64 
65  _pt.m_lateralFrictionDir1 = LVecBase3_to_btVector3(dir);
66 }
67 
68 ////////////////////////////////////////////////////////////////////
69 // Function: BulletManifoldPoint::get_lateral_friction_dir1
70 // Access: Published
71 // Description:
72 ////////////////////////////////////////////////////////////////////
73 INLINE LVector3 BulletManifoldPoint::
74 get_lateral_friction_dir1() const {
75 
76  return btVector3_to_LVector3(_pt.m_lateralFrictionDir1);
77 }
78 
79 ////////////////////////////////////////////////////////////////////
80 // Function: BulletManifoldPoint::set_lateral_friction_dir2
81 // Access: Published
82 // Description:
83 ////////////////////////////////////////////////////////////////////
84 INLINE void BulletManifoldPoint::
85 set_lateral_friction_dir2(const LVecBase3 &dir) {
86 
87  _pt.m_lateralFrictionDir2 = LVecBase3_to_btVector3(dir);
88 }
89 
90 ////////////////////////////////////////////////////////////////////
91 // Function: BulletManifoldPoint::get_lateral_friction_dir2
92 // Access: Published
93 // Description:
94 ////////////////////////////////////////////////////////////////////
95 INLINE LVector3 BulletManifoldPoint::
96 get_lateral_friction_dir2() const {
97 
98  return btVector3_to_LVector3(_pt.m_lateralFrictionDir2);
99 }
100 
101 ////////////////////////////////////////////////////////////////////
102 // Function: BulletManifoldPoint::set_contact_motion1
103 // Access: Published
104 // Description:
105 ////////////////////////////////////////////////////////////////////
106 INLINE void BulletManifoldPoint::
107 set_contact_motion1(PN_stdfloat value) {
108 
109  _pt.m_contactMotion1 = (btScalar)value;
110 }
111 
112 ////////////////////////////////////////////////////////////////////
113 // Function: BulletManifoldPoint::get_contact_motion1
114 // Access: Published
115 // Description:
116 ////////////////////////////////////////////////////////////////////
117 INLINE PN_stdfloat BulletManifoldPoint::
118 get_contact_motion1() const {
119 
120  return (PN_stdfloat)_pt.m_contactMotion1;
121 }
122 
123 ////////////////////////////////////////////////////////////////////
124 // Function: BulletManifoldPoint::set_contact_motion2
125 // Access: Published
126 // Description:
127 ////////////////////////////////////////////////////////////////////
128 INLINE void BulletManifoldPoint::
129 set_contact_motion2(PN_stdfloat value) {
130 
131  _pt.m_contactMotion2 = (btScalar)value;
132 }
133 
134 ////////////////////////////////////////////////////////////////////
135 // Function: BulletManifoldPoint::get_contact_motion2
136 // Access: Published
137 // Description:
138 ////////////////////////////////////////////////////////////////////
139 INLINE PN_stdfloat BulletManifoldPoint::
140 get_contact_motion2() const {
141 
142  return (PN_stdfloat)_pt.m_contactMotion2;
143 }
144 
145 ////////////////////////////////////////////////////////////////////
146 // Function: BulletManifoldPoint::set_combined_friction
147 // Access: Published
148 // Description:
149 ////////////////////////////////////////////////////////////////////
150 INLINE void BulletManifoldPoint::
151 set_combined_friction(PN_stdfloat value) {
152 
153  _pt.m_combinedFriction = (btScalar)value;
154 }
155 
156 ////////////////////////////////////////////////////////////////////
157 // Function: BulletManifoldPoint::get_combined_friction
158 // Access: Published
159 // Description:
160 ////////////////////////////////////////////////////////////////////
161 INLINE PN_stdfloat BulletManifoldPoint::
162 get_combined_friction() const {
163 
164  return (PN_stdfloat)_pt.m_combinedFriction;
165 }
166 
167 ////////////////////////////////////////////////////////////////////
168 // Function: BulletManifoldPoint::set_combined_restitution
169 // Access: Published
170 // Description:
171 ////////////////////////////////////////////////////////////////////
172 INLINE void BulletManifoldPoint::
173 set_combined_restitution(PN_stdfloat value) {
174 
175  _pt.m_combinedRestitution = (btScalar)value;
176 }
177 
178 ////////////////////////////////////////////////////////////////////
179 // Function: BulletManifoldPoint::get_combined_restitution
180 // Access: Published
181 // Description:
182 ////////////////////////////////////////////////////////////////////
183 INLINE PN_stdfloat BulletManifoldPoint::
184 get_combined_restitution() const {
185 
186  return (PN_stdfloat)_pt.m_combinedRestitution;
187 }
188 
189 ////////////////////////////////////////////////////////////////////
190 // Function: BulletManifoldPoint::set_applied_impulse
191 // Access: Published
192 // Description:
193 ////////////////////////////////////////////////////////////////////
194 INLINE void BulletManifoldPoint::
195 set_applied_impulse(PN_stdfloat value) {
196 
197  _pt.m_appliedImpulse = (btScalar)value;
198 }
199 
200 ////////////////////////////////////////////////////////////////////
201 // Function: BulletManifoldPoint::set_applied_impulse_lateral1
202 // Access: Published
203 // Description:
204 ////////////////////////////////////////////////////////////////////
205 INLINE void BulletManifoldPoint::
206 set_applied_impulse_lateral1(PN_stdfloat value) {
207 
208  _pt.m_appliedImpulseLateral1 = (btScalar)value;
209 }
210 
211 ////////////////////////////////////////////////////////////////////
212 // Function: BulletManifoldPoint::get_applied_impulse_lateral1
213 // Access: Published
214 // Description:
215 ////////////////////////////////////////////////////////////////////
216 INLINE PN_stdfloat BulletManifoldPoint::
217 get_applied_impulse_lateral1() const {
218 
219  return (PN_stdfloat)_pt.m_appliedImpulseLateral1;
220 }
221 
222 ////////////////////////////////////////////////////////////////////
223 // Function: BulletManifoldPoint::set_applied_impulse_lateral2
224 // Access: Published
225 // Description:
226 ////////////////////////////////////////////////////////////////////
227 INLINE void BulletManifoldPoint::
228 set_applied_impulse_lateral2(PN_stdfloat value) {
229 
230  _pt.m_appliedImpulseLateral2 = (btScalar)value;
231 }
232 
233 ////////////////////////////////////////////////////////////////////
234 // Function: BulletManifoldPoint::get_applied_impulse_lateral2
235 // Access: Published
236 // Description:
237 ////////////////////////////////////////////////////////////////////
238 INLINE PN_stdfloat BulletManifoldPoint::
239 get_applied_impulse_lateral2() const {
240 
241  return (PN_stdfloat)_pt.m_appliedImpulseLateral2;
242 }
243 
244 ////////////////////////////////////////////////////////////////////
245 // Function: BulletManifoldPoint::set_contact_cfm1
246 // Access: Published
247 // Description:
248 ////////////////////////////////////////////////////////////////////
249 INLINE void BulletManifoldPoint::
250 set_contact_cfm1(PN_stdfloat value) {
251 #if BT_BULLET_VERSION < 285
252  _pt.m_contactCFM1 = (btScalar)value;
253 #endif
254 }
255 
256 ////////////////////////////////////////////////////////////////////
257 // Function: BulletManifoldPoint::get_contact_cfm1
258 // Access: Published
259 // Description:
260 ////////////////////////////////////////////////////////////////////
261 INLINE PN_stdfloat BulletManifoldPoint::
262 get_contact_cfm1() const {
263 #if BT_BULLET_VERSION < 285
264  return (PN_stdfloat)_pt.m_contactCFM1;
265 #else
266  return 0;
267 #endif
268 }
269 
270 ////////////////////////////////////////////////////////////////////
271 // Function: BulletManifoldPoint::set_contact_cfm2
272 // Access: Published
273 // Description:
274 ////////////////////////////////////////////////////////////////////
275 INLINE void BulletManifoldPoint::
276 set_contact_cfm2(PN_stdfloat value) {
277 #if BT_BULLET_VERSION < 285
278  _pt.m_contactCFM2 = (btScalar)value;
279 #endif
280 }
281 
282 ////////////////////////////////////////////////////////////////////
283 // Function: BulletManifoldPoint::get_contact_cfm2
284 // Access: Published
285 // Description:
286 ////////////////////////////////////////////////////////////////////
287 INLINE PN_stdfloat BulletManifoldPoint::
288 get_contact_cfm2() const {
289 #if BT_BULLET_VERSION < 285
290  return (PN_stdfloat)_pt.m_contactCFM2;
291 #else
292  return 0;
293 #endif
294 }
295 
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100