Bullet Collision Detection & Physics Library: btIDebugDraw.h Source File

Bullet Collision Detection & Physics Library

btIDebugDraw.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org
4
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15
16 #ifndef BT_IDEBUG_DRAW__H
17 #define BT_IDEBUG_DRAW__H
18
19 #include "btVector3.h"
20 #include "btTransform.h"
21
26 class btIDebugDraw
27 {
28 public:
29 ATTRIBUTE_ALIGNED16(struct)
30 DefaultColors
31 {
32 btVector3 m_activeObject;
33 btVector3 m_deactivatedObject;
34 btVector3 m_wantsDeactivationObject;
35 btVector3 m_disabledDeactivationObject;
36 btVector3 m_disabledSimulationObject;
37 btVector3 m_aabb;
38 btVector3 m_contactPoint;
39
40 DefaultColors()
41 : m_activeObject(1, 1, 1),
42 m_deactivatedObject(0, 1, 0),
43 m_wantsDeactivationObject(0, 1, 1),
44 m_disabledDeactivationObject(1, 0, 0),
45 m_disabledSimulationObject(1, 1, 0),
46 m_aabb(1, 0, 0),
47 m_contactPoint(1, 1, 0)
48 {
49 }
50 };
51
52 enum DebugDrawModes
53 {
54 DBG_NoDebug = 0,
55 DBG_DrawWireframe = 1,
56 DBG_DrawAabb = 2,
57 DBG_DrawFeaturesText = 4,
58 DBG_DrawContactPoints = 8,
59 DBG_NoDeactivation = 16,
60 DBG_NoHelpText = 32,
61 DBG_DrawText = 64,
62 DBG_ProfileTimings = 128,
63 DBG_EnableSatComparison = 256,
64 DBG_DisableBulletLCP = 512,
65 DBG_EnableCCD = 1024,
66 DBG_DrawConstraints = (1 << 11),
67 DBG_DrawConstraintLimits = (1 << 12),
68 DBG_FastWireframe = (1 << 13),
69 DBG_DrawNormals = (1 << 14),
70 DBG_DrawFrames = (1 << 15),
71 DBG_MAX_DEBUG_DRAW_MODE
72 };
73
74 virtual ~btIDebugDraw(){};
75
76 virtual DefaultColors getDefaultColors() const
77 {
78 DefaultColors colors;
79 return colors;
80 }
82 virtual void setDefaultColors(const DefaultColors& /*colors*/) {}
83
84 virtual void drawLine(const btVector3& from, const btVector3& to, const btVector3& color) = 0;
85
86 virtual void drawLine(const btVector3& from, const btVector3& to, const btVector3& fromColor, const btVector3& toColor)
87 {
88 (void)toColor;
89 drawLine(from, to, fromColor);
90 }
91
92 virtual void drawSphere(btScalar radius, const btTransform& transform, const btVector3& color)
93 {
94 btVector3 center = transform.getOrigin();
95 btVector3 up = transform.getBasis().getColumn(1);
96 btVector3 axis = transform.getBasis().getColumn(0);
97 btScalar minTh = -SIMD_HALF_PI;
98 btScalar maxTh = SIMD_HALF_PI;
99 btScalar minPs = -SIMD_HALF_PI;
100 btScalar maxPs = SIMD_HALF_PI;
101 btScalar stepDegrees = 30.f;
102 drawSpherePatch(center, up, axis, radius, minTh, maxTh, minPs, maxPs, color, stepDegrees, false);
103 drawSpherePatch(center, up, -axis, radius, minTh, maxTh, minPs, maxPs, color, stepDegrees, false);
104 }
105
106 virtual void drawSphere(const btVector3& p, btScalar radius, const btVector3& color)
107 {
108 btTransform tr;
109 tr.setIdentity();
110 tr.setOrigin(p);
111 drawSphere(radius, tr, color);
112 }
113
114 virtual void drawTriangle(const btVector3& v0, const btVector3& v1, const btVector3& v2, const btVector3& /*n0*/, const btVector3& /*n1*/, const btVector3& /*n2*/, const btVector3& color, btScalar alpha)
115 {
116 drawTriangle(v0, v1, v2, color, alpha);
117 }
118 virtual void drawTriangle(const btVector3& v0, const btVector3& v1, const btVector3& v2, const btVector3& color, btScalar /*alpha*/)
119 {
120 drawLine(v0, v1, color);
121 drawLine(v1, v2, color);
122 drawLine(v2, v0, color);
123 }
124
125 virtual void drawContactPoint(const btVector3& PointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color) = 0;
126
127 virtual void reportErrorWarning(const char* warningString) = 0;
128
129 virtual void draw3dText(const btVector3& location, const char* textString) = 0;
130
131 virtual void setDebugMode(int debugMode) = 0;
132
133 virtual int getDebugMode() const = 0;
134
135 virtual void drawAabb(const btVector3& from, const btVector3& to, const btVector3& color)
136 {
137 btVector3 halfExtents = (to - from) * 0.5f;
138 btVector3 center = (to + from) * 0.5f;
139 int i, j;
140
141 btVector3 edgecoord(1.f, 1.f, 1.f), pa, pb;
142 for (i = 0; i < 4; i++)
143 {
144 for (j = 0; j < 3; j++)
145 {
146 pa = btVector3(edgecoord[0] * halfExtents[0], edgecoord[1] * halfExtents[1],
147 edgecoord[2] * halfExtents[2]);
148 pa += center;
149
150 int othercoord = j % 3;
151 edgecoord[othercoord] *= -1.f;
152 pb = btVector3(edgecoord[0] * halfExtents[0], edgecoord[1] * halfExtents[1],
153 edgecoord[2] * halfExtents[2]);
154 pb += center;
155
156 drawLine(pa, pb, color);
157 }
158 edgecoord = btVector3(-1.f, -1.f, -1.f);
159 if (i < 3)
160 edgecoord[i] *= -1.f;
161 }
162 }
163 virtual void drawTransform(const btTransform& transform, btScalar orthoLen)
164 {
165 btVector3 start = transform.getOrigin();
166 drawLine(start, start + transform.getBasis() * btVector3(orthoLen, 0, 0), btVector3(btScalar(1.), btScalar(0.3), btScalar(0.3)));
167 drawLine(start, start + transform.getBasis() * btVector3(0, orthoLen, 0), btVector3(btScalar(0.3), btScalar(1.), btScalar(0.3)));
168 drawLine(start, start + transform.getBasis() * btVector3(0, 0, orthoLen), btVector3(btScalar(0.3), btScalar(0.3), btScalar(1.)));
169 }
170
171 virtual void drawArc(const btVector3& center, const btVector3& normal, const btVector3& axis, btScalar radiusA, btScalar radiusB, btScalar minAngle, btScalar maxAngle,
172 const btVector3& color, bool drawSect, btScalar stepDegrees = btScalar(10.f))
173 {
174 const btVector3& vx = axis;
175 btVector3 vy = normal.cross(axis);
176 btScalar step = stepDegrees * SIMD_RADS_PER_DEG;
177 int nSteps = (int)btFabs((maxAngle - minAngle) / step);
178 if (!nSteps) nSteps = 1;
179 btVector3 prev = center + radiusA * vx * btCos(minAngle) + radiusB * vy * btSin(minAngle);
180 if (drawSect)
181 {
182 drawLine(center, prev, color);
183 }
184 for (int i = 1; i <= nSteps; i++)
185 {
186 btScalar angle = minAngle + (maxAngle - minAngle) * btScalar(i) / btScalar(nSteps);
187 btVector3 next = center + radiusA * vx * btCos(angle) + radiusB * vy * btSin(angle);
188 drawLine(prev, next, color);
189 prev = next;
190 }
191 if (drawSect)
192 {
193 drawLine(center, prev, color);
194 }
195 }
196 virtual void drawSpherePatch(const btVector3& center, const btVector3& up, const btVector3& axis, btScalar radius,
197 btScalar minTh, btScalar maxTh, btScalar minPs, btScalar maxPs, const btVector3& color, btScalar stepDegrees = btScalar(10.f), bool drawCenter = true)
198 {
199 btVector3 vA[74];
200 btVector3 vB[74];
201 btVector3 *pvA = vA, *pvB = vB, *pT;
202 btVector3 npole = center + up * radius;
203 btVector3 spole = center - up * radius;
204 btVector3 arcStart;
205 btScalar step = stepDegrees * SIMD_RADS_PER_DEG;
206 const btVector3& kv = up;
207 const btVector3& iv = axis;
208 btVector3 jv = kv.cross(iv);
209 bool drawN = false;
210 bool drawS = false;
211 if (minTh <= -SIMD_HALF_PI)
212 {
213 minTh = -SIMD_HALF_PI + step;
214 drawN = true;
215 }
216 if (maxTh >= SIMD_HALF_PI)
217 {
218 maxTh = SIMD_HALF_PI - step;
219 drawS = true;
220 }
221 if (minTh > maxTh)
222 {
223 minTh = -SIMD_HALF_PI + step;
224 maxTh = SIMD_HALF_PI - step;
225 drawN = drawS = true;
226 }
227 int n_hor = (int)((maxTh - minTh) / step) + 1;
228 if (n_hor < 2) n_hor = 2;
229 btScalar step_h = (maxTh - minTh) / btScalar(n_hor - 1);
230 bool isClosed = false;
231 if (minPs > maxPs)
232 {
233 minPs = -SIMD_PI + step;
234 maxPs = SIMD_PI;
235 isClosed = true;
236 }
237 else if ((maxPs - minPs) >= SIMD_PI * btScalar(2.f))
238 {
239 isClosed = true;
240 }
241 else
242 {
243 isClosed = false;
244 }
245 int n_vert = (int)((maxPs - minPs) / step) + 1;
246 if (n_vert < 2) n_vert = 2;
247 btScalar step_v = (maxPs - minPs) / btScalar(n_vert - 1);
248 for (int i = 0; i < n_hor; i++)
249 {
250 btScalar th = minTh + btScalar(i) * step_h;
251 btScalar sth = radius * btSin(th);
252 btScalar cth = radius * btCos(th);
253 for (int j = 0; j < n_vert; j++)
254 {
255 btScalar psi = minPs + btScalar(j) * step_v;
256 btScalar sps = btSin(psi);
257 btScalar cps = btCos(psi);
258 pvB[j] = center + cth * cps * iv + cth * sps * jv + sth * kv;
259 if (i)
260 {
261 drawLine(pvA[j], pvB[j], color);
262 }
263 else if (drawS)
264 {
265 drawLine(spole, pvB[j], color);
266 }
267 if (j)
268 {
269 drawLine(pvB[j - 1], pvB[j], color);
270 }
271 else
272 {
273 arcStart = pvB[j];
274 }
275 if ((i == (n_hor - 1)) && drawN)
276 {
277 drawLine(npole, pvB[j], color);
278 }
279
280 if (drawCenter)
281 {
282 if (isClosed)
283 {
284 if (j == (n_vert - 1))
285 {
286 drawLine(arcStart, pvB[j], color);
287 }
288 }
289 else
290 {
291 if (((!i) || (i == (n_hor - 1))) && ((!j) || (j == (n_vert - 1))))
292 {
293 drawLine(center, pvB[j], color);
294 }
295 }
296 }
297 }
298 pT = pvA;
299 pvA = pvB;
300 pvB = pT;
301 }
302 }
303
304 virtual void drawBox(const btVector3& bbMin, const btVector3& bbMax, const btVector3& color)
305 {
306 drawLine(btVector3(bbMin[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMin[1], bbMin[2]), color);
307 drawLine(btVector3(bbMax[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMax[1], bbMin[2]), color);
308 drawLine(btVector3(bbMax[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMax[1], bbMin[2]), color);
309 drawLine(btVector3(bbMin[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMin[1], bbMin[2]), color);
310 drawLine(btVector3(bbMin[0], bbMin[1], bbMin[2]), btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
311 drawLine(btVector3(bbMax[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
312 drawLine(btVector3(bbMax[0], bbMax[1], bbMin[2]), btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
313 drawLine(btVector3(bbMin[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
314 drawLine(btVector3(bbMin[0], bbMin[1], bbMax[2]), btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
315 drawLine(btVector3(bbMax[0], bbMin[1], bbMax[2]), btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
316 drawLine(btVector3(bbMax[0], bbMax[1], bbMax[2]), btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
317 drawLine(btVector3(bbMin[0], bbMax[1], bbMax[2]), btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
318 }
319 virtual void drawBox(const btVector3& bbMin, const btVector3& bbMax, const btTransform& trans, const btVector3& color)
320 {
321 drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), color);
322 drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), color);
323 drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), color);
324 drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), color);
325 drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
326 drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
327 drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), trans * btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
328 drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
329 drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), trans * btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
330 drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMax[2]), trans * btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
331 drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMax[2]), trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
332 drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
333 }
334
335 virtual void drawCapsule(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
336 {
337 int stepDegrees = 30;
338
339 btVector3 capStart(0.f, 0.f, 0.f);
340 capStart[upAxis] = -halfHeight;
341
342 btVector3 capEnd(0.f, 0.f, 0.f);
343 capEnd[upAxis] = halfHeight;
344
345 // Draw the ends
346 {
347 btTransform childTransform = transform;
348 childTransform.getOrigin() = transform * capStart;
349 {
350 btVector3 center = childTransform.getOrigin();
351 btVector3 up = childTransform.getBasis().getColumn((upAxis + 1) % 3);
352 btVector3 axis = -childTransform.getBasis().getColumn(upAxis);
353 btScalar minTh = -SIMD_HALF_PI;
354 btScalar maxTh = SIMD_HALF_PI;
355 btScalar minPs = -SIMD_HALF_PI;
356 btScalar maxPs = SIMD_HALF_PI;
357
358 drawSpherePatch(center, up, axis, radius, minTh, maxTh, minPs, maxPs, color, btScalar(stepDegrees), false);
359 }
360 }
361
362 {
363 btTransform childTransform = transform;
364 childTransform.getOrigin() = transform * capEnd;
365 {
366 btVector3 center = childTransform.getOrigin();
367 btVector3 up = childTransform.getBasis().getColumn((upAxis + 1) % 3);
368 btVector3 axis = childTransform.getBasis().getColumn(upAxis);
369 btScalar minTh = -SIMD_HALF_PI;
370 btScalar maxTh = SIMD_HALF_PI;
371 btScalar minPs = -SIMD_HALF_PI;
372 btScalar maxPs = SIMD_HALF_PI;
373 drawSpherePatch(center, up, axis, radius, minTh, maxTh, minPs, maxPs, color, btScalar(stepDegrees), false);
374 }
375 }
376
377 // Draw some additional lines
378 btVector3 start = transform.getOrigin();
379
380 for (int i = 0; i < 360; i += stepDegrees)
381 {
382 capEnd[(upAxis + 1) % 3] = capStart[(upAxis + 1) % 3] = btSin(btScalar(i) * SIMD_RADS_PER_DEG) * radius;
383 capEnd[(upAxis + 2) % 3] = capStart[(upAxis + 2) % 3] = btCos(btScalar(i) * SIMD_RADS_PER_DEG) * radius;
384 drawLine(start + transform.getBasis() * capStart, start + transform.getBasis() * capEnd, color);
385 }
386 }
387
388 virtual void drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
389 {
390 btVector3 start = transform.getOrigin();
391 btVector3 offsetHeight(0, 0, 0);
392 offsetHeight[upAxis] = halfHeight;
393 int stepDegrees = 30;
394 btVector3 capStart(0.f, 0.f, 0.f);
395 capStart[upAxis] = -halfHeight;
396 btVector3 capEnd(0.f, 0.f, 0.f);
397 capEnd[upAxis] = halfHeight;
398
399 for (int i = 0; i < 360; i += stepDegrees)
400 {
401 capEnd[(upAxis + 1) % 3] = capStart[(upAxis + 1) % 3] = btSin(btScalar(i) * SIMD_RADS_PER_DEG) * radius;
402 capEnd[(upAxis + 2) % 3] = capStart[(upAxis + 2) % 3] = btCos(btScalar(i) * SIMD_RADS_PER_DEG) * radius;
403 drawLine(start + transform.getBasis() * capStart, start + transform.getBasis() * capEnd, color);
404 }
405 // Drawing top and bottom caps of the cylinder
406 btVector3 yaxis(0, 0, 0);
407 yaxis[upAxis] = btScalar(1.0);
408 btVector3 xaxis(0, 0, 0);
409 xaxis[(upAxis + 1) % 3] = btScalar(1.0);
410 drawArc(start - transform.getBasis() * (offsetHeight), transform.getBasis() * yaxis, transform.getBasis() * xaxis, radius, radius, 0, SIMD_2_PI, color, false, btScalar(10.0));
411 drawArc(start + transform.getBasis() * (offsetHeight), transform.getBasis() * yaxis, transform.getBasis() * xaxis, radius, radius, 0, SIMD_2_PI, color, false, btScalar(10.0));
412 }
413
414 virtual void drawCone(btScalar radius, btScalar height, int upAxis, const btTransform& transform, const btVector3& color)
415 {
416 int stepDegrees = 30;
417 btVector3 start = transform.getOrigin();
418
419 btVector3 offsetHeight(0, 0, 0);
420 btScalar halfHeight = height * btScalar(0.5);
421 offsetHeight[upAxis] = halfHeight;
422 btVector3 offsetRadius(0, 0, 0);
423 offsetRadius[(upAxis + 1) % 3] = radius;
424 btVector3 offset2Radius(0, 0, 0);
425 offset2Radius[(upAxis + 2) % 3] = radius;
426
427 btVector3 capEnd(0.f, 0.f, 0.f);
428 capEnd[upAxis] = -halfHeight;
429
430 for (int i = 0; i < 360; i += stepDegrees)
431 {
432 capEnd[(upAxis + 1) % 3] = btSin(btScalar(i) * SIMD_RADS_PER_DEG) * radius;
433 capEnd[(upAxis + 2) % 3] = btCos(btScalar(i) * SIMD_RADS_PER_DEG) * radius;
434 drawLine(start + transform.getBasis() * (offsetHeight), start + transform.getBasis() * capEnd, color);
435 }
436
437 drawLine(start + transform.getBasis() * (offsetHeight), start + transform.getBasis() * (-offsetHeight + offsetRadius), color);
438 drawLine(start + transform.getBasis() * (offsetHeight), start + transform.getBasis() * (-offsetHeight - offsetRadius), color);
439 drawLine(start + transform.getBasis() * (offsetHeight), start + transform.getBasis() * (-offsetHeight + offset2Radius), color);
440 drawLine(start + transform.getBasis() * (offsetHeight), start + transform.getBasis() * (-offsetHeight - offset2Radius), color);
441
442 // Drawing the base of the cone
443 btVector3 yaxis(0, 0, 0);
444 yaxis[upAxis] = btScalar(1.0);
445 btVector3 xaxis(0, 0, 0);
446 xaxis[(upAxis + 1) % 3] = btScalar(1.0);
447 drawArc(start - transform.getBasis() * (offsetHeight), transform.getBasis() * yaxis, transform.getBasis() * xaxis, radius, radius, 0, SIMD_2_PI, color, false, 10.0);
448 }
449
450 virtual void drawPlane(const btVector3& planeNormal, btScalar planeConst, const btTransform& transform, const btVector3& color)
451 {
452 btVector3 planeOrigin = planeNormal * planeConst;
453 btVector3 vec0, vec1;
454 btPlaneSpace1(planeNormal, vec0, vec1);
455 btScalar vecLen = 100.f;
456 btVector3 pt0 = planeOrigin + vec0 * vecLen;
457 btVector3 pt1 = planeOrigin - vec0 * vecLen;
458 btVector3 pt2 = planeOrigin + vec1 * vecLen;
459 btVector3 pt3 = planeOrigin - vec1 * vecLen;
460 drawLine(transform * pt0, transform * pt1, color);
461 drawLine(transform * pt2, transform * pt3, color);
462 }
463
464 virtual void clearLines()
465 {
466 }
467
468 virtual void flushLines()
469 {
470 }
471 };
472
473 #endif //BT_IDEBUG_DRAW__H
btIDebugDraw::drawTriangle
virtual void drawTriangle(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2, const btVector3 &color, btScalar)
Definition: btIDebugDraw.h:118
btIDebugDraw::DefaultColors::m_activeObject
btVector3 m_activeObject
Definition: btIDebugDraw.h:32
btIDebugDraw::drawTriangle
virtual void drawTriangle(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2, const btVector3 &, const btVector3 &, const btVector3 &, const btVector3 &color, btScalar alpha)
Definition: btIDebugDraw.h:114
btPlaneSpace1
void btPlaneSpace1(const T &n, T &p, T &q)
Definition: btVector3.h:1251
btIDebugDraw::DBG_NoDeactivation
@ DBG_NoDeactivation
Definition: btIDebugDraw.h:59
SIMD_HALF_PI
#define SIMD_HALF_PI
Definition: btScalar.h:528
btIDebugDraw::DBG_NoDebug
@ DBG_NoDebug
Definition: btIDebugDraw.h:54
btIDebugDraw::drawSphere
virtual void drawSphere(btScalar radius, const btTransform &transform, const btVector3 &color)
Definition: btIDebugDraw.h:92
btIDebugDraw::drawLine
virtual void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &fromColor, const btVector3 &toColor)
Definition: btIDebugDraw.h:86
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:314
btIDebugDraw::drawCapsule
virtual void drawCapsule(btScalar radius, btScalar halfHeight, int upAxis, const btTransform &transform, const btVector3 &color)
Definition: btIDebugDraw.h:335
btVector3::cross
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
Definition: btVector3.h:380
btIDebugDraw::DBG_EnableSatComparison
@ DBG_EnableSatComparison
Definition: btIDebugDraw.h:63
btIDebugDraw::getDebugMode
virtual int getDebugMode() const =0
btIDebugDraw::drawTransform
virtual void drawTransform(const btTransform &transform, btScalar orthoLen)
Definition: btIDebugDraw.h:163
btIDebugDraw::DefaultColors::m_disabledDeactivationObject
btVector3 m_disabledDeactivationObject
Definition: btIDebugDraw.h:35
SIMD_PI
#define SIMD_PI
Definition: btScalar.h:526
btIDebugDraw::DBG_ProfileTimings
@ DBG_ProfileTimings
Definition: btIDebugDraw.h:62
btIDebugDraw::draw3dText
virtual void draw3dText(const btVector3 &location, const char *textString)=0
btIDebugDraw::DBG_DrawContactPoints
@ DBG_DrawContactPoints
Definition: btIDebugDraw.h:58
SIMD_RADS_PER_DEG
#define SIMD_RADS_PER_DEG
Definition: btScalar.h:529
btIDebugDraw::DBG_DrawText
@ DBG_DrawText
Definition: btIDebugDraw.h:61
btTransform::setIdentity
void setIdentity()
Set this transformation to the identity.
Definition: btTransform.h:166
btIDebugDraw::DBG_DrawWireframe
@ DBG_DrawWireframe
Definition: btIDebugDraw.h:55
btVector3.h
btSin
btScalar btSin(btScalar x)
Definition: btScalar.h:499
btFabs
btScalar btFabs(btScalar x)
Definition: btScalar.h:497
btIDebugDraw
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
Definition: btIDebugDraw.h:27
btIDebugDraw::drawPlane
virtual void drawPlane(const btVector3 &planeNormal, btScalar planeConst, const btTransform &transform, const btVector3 &color)
Definition: btIDebugDraw.h:450
btIDebugDraw::drawCylinder
virtual void drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform &transform, const btVector3 &color)
Definition: btIDebugDraw.h:388
btIDebugDraw::DefaultColors::m_aabb
btVector3 m_aabb
Definition: btIDebugDraw.h:37
btIDebugDraw::DBG_DrawConstraints
@ DBG_DrawConstraints
Definition: btIDebugDraw.h:66
btTransform::getBasis
btMatrix3x3 & getBasis()
Return the basis matrix for the rotation.
Definition: btTransform.h:108
btIDebugDraw::DBG_DrawConstraintLimits
@ DBG_DrawConstraintLimits
Definition: btIDebugDraw.h:67
btIDebugDraw::drawContactPoint
virtual void drawContactPoint(const btVector3 &PointOnB, const btVector3 &normalOnB, btScalar distance, int lifeTime, const btVector3 &color)=0
btIDebugDraw::~btIDebugDraw
virtual ~btIDebugDraw()
Definition: btIDebugDraw.h:74
btCos
btScalar btCos(btScalar x)
Definition: btScalar.h:498
btTransform.h
btIDebugDraw::DefaultColors
Definition: btIDebugDraw.h:31
btIDebugDraw::DBG_DrawAabb
@ DBG_DrawAabb
Definition: btIDebugDraw.h:56
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:30
btMatrix3x3::getColumn
btVector3 getColumn(int i) const
Get a column of the matrix as a vector.
Definition: btMatrix3x3.h:140
btIDebugDraw::DBG_DrawFrames
@ DBG_DrawFrames
Definition: btIDebugDraw.h:70
btVector3
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:82
btIDebugDraw::drawSphere
virtual void drawSphere(const btVector3 &p, btScalar radius, const btVector3 &color)
Definition: btIDebugDraw.h:106
btIDebugDraw::reportErrorWarning
virtual void reportErrorWarning(const char *warningString)=0
btTransform::getOrigin
btVector3 & getOrigin()
Return the origin vector translation.
Definition: btTransform.h:113
btIDebugDraw::drawSpherePatch
virtual void drawSpherePatch(const btVector3 &center, const btVector3 &up, const btVector3 &axis, btScalar radius, btScalar minTh, btScalar maxTh, btScalar minPs, btScalar maxPs, const btVector3 &color, btScalar stepDegrees=btScalar(10.f), bool drawCenter=true)
Definition: btIDebugDraw.h:196
btIDebugDraw::setDebugMode
virtual void setDebugMode(int debugMode)=0
btIDebugDraw::DBG_EnableCCD
@ DBG_EnableCCD
Definition: btIDebugDraw.h:65
ATTRIBUTE_ALIGNED16
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:99
btIDebugDraw::DefaultColors::m_disabledSimulationObject
btVector3 m_disabledSimulationObject
Definition: btIDebugDraw.h:36
btIDebugDraw::drawLine
virtual void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color)=0
btIDebugDraw::DBG_NoHelpText
@ DBG_NoHelpText
Definition: btIDebugDraw.h:60
btIDebugDraw::clearLines
virtual void clearLines()
Definition: btIDebugDraw.h:464
btIDebugDraw::drawArc
virtual void drawArc(const btVector3 &center, const btVector3 &normal, const btVector3 &axis, btScalar radiusA, btScalar radiusB, btScalar minAngle, btScalar maxAngle, const btVector3 &color, bool drawSect, btScalar stepDegrees=btScalar(10.f))
Definition: btIDebugDraw.h:171
btIDebugDraw::flushLines
virtual void flushLines()
Definition: btIDebugDraw.h:468
btIDebugDraw::drawBox
virtual void drawBox(const btVector3 &bbMin, const btVector3 &bbMax, const btVector3 &color)
Definition: btIDebugDraw.h:304
btIDebugDraw::DefaultColors::DefaultColors
DefaultColors()
Definition: btIDebugDraw.h:40
btIDebugDraw::DefaultColors::m_wantsDeactivationObject
btVector3 m_wantsDeactivationObject
Definition: btIDebugDraw.h:34
btIDebugDraw::DBG_DrawFeaturesText
@ DBG_DrawFeaturesText
Definition: btIDebugDraw.h:57
btIDebugDraw::DBG_DisableBulletLCP
@ DBG_DisableBulletLCP
Definition: btIDebugDraw.h:64
btIDebugDraw::setDefaultColors
virtual void setDefaultColors(const DefaultColors &)
the default implementation for setDefaultColors has no effect. A derived class can implement it and s...
Definition: btIDebugDraw.h:82
btIDebugDraw::DefaultColors::m_deactivatedObject
btVector3 m_deactivatedObject
Definition: btIDebugDraw.h:33
btIDebugDraw::getDefaultColors
virtual DefaultColors getDefaultColors() const
Definition: btIDebugDraw.h:76
btIDebugDraw::drawBox
virtual void drawBox(const btVector3 &bbMin, const btVector3 &bbMax, const btTransform &trans, const btVector3 &color)
Definition: btIDebugDraw.h:319
btIDebugDraw::DBG_MAX_DEBUG_DRAW_MODE
@ DBG_MAX_DEBUG_DRAW_MODE
Definition: btIDebugDraw.h:71
btIDebugDraw::DBG_DrawNormals
@ DBG_DrawNormals
Definition: btIDebugDraw.h:69
btIDebugDraw::DebugDrawModes
DebugDrawModes
Definition: btIDebugDraw.h:53
SIMD_2_PI
#define SIMD_2_PI
Definition: btScalar.h:527
btTransform::setOrigin
void setOrigin(const btVector3 &origin)
Set the translational element.
Definition: btTransform.h:146
btIDebugDraw::DBG_FastWireframe
@ DBG_FastWireframe
Definition: btIDebugDraw.h:68
btIDebugDraw::drawAabb
virtual void drawAabb(const btVector3 &from, const btVector3 &to, const btVector3 &color)
Definition: btIDebugDraw.h:135
btIDebugDraw::DefaultColors::m_contactPoint
btVector3 m_contactPoint
Definition: btIDebugDraw.h:38
btIDebugDraw::drawCone
virtual void drawCone(btScalar radius, btScalar height, int upAxis, const btTransform &transform, const btVector3 &color)
Definition: btIDebugDraw.h:414