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 
17 #ifndef BT_IDEBUG_DRAW__H
18 #define BT_IDEBUG_DRAW__H
19 
20 #include "btVector3.h"
21 #include "btTransform.h"
22 
23 
29 {
30  public:
31 
33  {
45  DBG_EnableCCD = 1024,
46  DBG_DrawConstraints = (1 << 11),
48  DBG_FastWireframe = (1<<13),
49  DBG_DrawNormals = (1<<14),
51  };
52 
53  virtual ~btIDebugDraw() {};
54 
55  virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& color)=0;
56 
57  virtual void drawLine(const btVector3& from,const btVector3& to, const btVector3& fromColor, const btVector3& toColor)
58  {
59  (void) toColor;
60  drawLine (from, to, fromColor);
61  }
62 
63  virtual void drawSphere(btScalar radius, const btTransform& transform, const btVector3& color)
64  {
65 
66  btVector3 center = transform.getOrigin();
67  btVector3 up = transform.getBasis().getColumn(1);
68  btVector3 axis = transform.getBasis().getColumn(0);
69  btScalar minTh = -SIMD_HALF_PI;
70  btScalar maxTh = SIMD_HALF_PI;
71  btScalar minPs = -SIMD_HALF_PI;
72  btScalar maxPs = SIMD_HALF_PI;
73  btScalar stepDegrees = 30.f;
74  drawSpherePatch(center, up, axis, radius,minTh, maxTh, minPs, maxPs, color, stepDegrees ,false);
75  drawSpherePatch(center, up, -axis, radius,minTh, maxTh, minPs, maxPs, color, stepDegrees,false );
76  }
77 
78  virtual void drawSphere (const btVector3& p, btScalar radius, const btVector3& color)
79  {
80  btTransform tr;
81  tr.setIdentity();
82  tr.setOrigin(p);
83  drawSphere(radius,tr,color);
84  }
85 
86  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)
87  {
88  drawTriangle(v0,v1,v2,color,alpha);
89  }
90  virtual void drawTriangle(const btVector3& v0,const btVector3& v1,const btVector3& v2,const btVector3& color, btScalar /*alpha*/)
91  {
92  drawLine(v0,v1,color);
93  drawLine(v1,v2,color);
94  drawLine(v2,v0,color);
95  }
96 
97  virtual void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color)=0;
98 
99  virtual void reportErrorWarning(const char* warningString) = 0;
100 
101  virtual void draw3dText(const btVector3& location,const char* textString) = 0;
102 
103  virtual void setDebugMode(int debugMode) =0;
104 
105  virtual int getDebugMode() const = 0;
106 
107  virtual void drawAabb(const btVector3& from,const btVector3& to,const btVector3& color)
108  {
109 
110  btVector3 halfExtents = (to-from)* 0.5f;
111  btVector3 center = (to+from) *0.5f;
112  int i,j;
113 
114  btVector3 edgecoord(1.f,1.f,1.f),pa,pb;
115  for (i=0;i<4;i++)
116  {
117  for (j=0;j<3;j++)
118  {
119  pa = btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],
120  edgecoord[2]*halfExtents[2]);
121  pa+=center;
122 
123  int othercoord = j%3;
124  edgecoord[othercoord]*=-1.f;
125  pb = btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],
126  edgecoord[2]*halfExtents[2]);
127  pb+=center;
128 
129  drawLine(pa,pb,color);
130  }
131  edgecoord = btVector3(-1.f,-1.f,-1.f);
132  if (i<3)
133  edgecoord[i]*=-1.f;
134  }
135  }
136  virtual void drawTransform(const btTransform& transform, btScalar orthoLen)
137  {
138  btVector3 start = transform.getOrigin();
139  drawLine(start, start+transform.getBasis() * btVector3(orthoLen, 0, 0), btVector3(0.7f,0,0));
140  drawLine(start, start+transform.getBasis() * btVector3(0, orthoLen, 0), btVector3(0,0.7f,0));
141  drawLine(start, start+transform.getBasis() * btVector3(0, 0, orthoLen), btVector3(0,0,0.7f));
142  }
143 
144  virtual void drawArc(const btVector3& center, const btVector3& normal, const btVector3& axis, btScalar radiusA, btScalar radiusB, btScalar minAngle, btScalar maxAngle,
145  const btVector3& color, bool drawSect, btScalar stepDegrees = btScalar(10.f))
146  {
147  const btVector3& vx = axis;
148  btVector3 vy = normal.cross(axis);
149  btScalar step = stepDegrees * SIMD_RADS_PER_DEG;
150  int nSteps = (int)((maxAngle - minAngle) / step);
151  if(!nSteps) nSteps = 1;
152  btVector3 prev = center + radiusA * vx * btCos(minAngle) + radiusB * vy * btSin(minAngle);
153  if(drawSect)
154  {
155  drawLine(center, prev, color);
156  }
157  for(int i = 1; i <= nSteps; i++)
158  {
159  btScalar angle = minAngle + (maxAngle - minAngle) * btScalar(i) / btScalar(nSteps);
160  btVector3 next = center + radiusA * vx * btCos(angle) + radiusB * vy * btSin(angle);
161  drawLine(prev, next, color);
162  prev = next;
163  }
164  if(drawSect)
165  {
166  drawLine(center, prev, color);
167  }
168  }
169  virtual void drawSpherePatch(const btVector3& center, const btVector3& up, const btVector3& axis, btScalar radius,
170  btScalar minTh, btScalar maxTh, btScalar minPs, btScalar maxPs, const btVector3& color, btScalar stepDegrees = btScalar(10.f),bool drawCenter = true)
171  {
172  btVector3 vA[74];
173  btVector3 vB[74];
174  btVector3 *pvA = vA, *pvB = vB, *pT;
175  btVector3 npole = center + up * radius;
176  btVector3 spole = center - up * radius;
177  btVector3 arcStart;
178  btScalar step = stepDegrees * SIMD_RADS_PER_DEG;
179  const btVector3& kv = up;
180  const btVector3& iv = axis;
181  btVector3 jv = kv.cross(iv);
182  bool drawN = false;
183  bool drawS = false;
184  if(minTh <= -SIMD_HALF_PI)
185  {
186  minTh = -SIMD_HALF_PI + step;
187  drawN = true;
188  }
189  if(maxTh >= SIMD_HALF_PI)
190  {
191  maxTh = SIMD_HALF_PI - step;
192  drawS = true;
193  }
194  if(minTh > maxTh)
195  {
196  minTh = -SIMD_HALF_PI + step;
197  maxTh = SIMD_HALF_PI - step;
198  drawN = drawS = true;
199  }
200  int n_hor = (int)((maxTh - minTh) / step) + 1;
201  if(n_hor < 2) n_hor = 2;
202  btScalar step_h = (maxTh - minTh) / btScalar(n_hor - 1);
203  bool isClosed = false;
204  if(minPs > maxPs)
205  {
206  minPs = -SIMD_PI + step;
207  maxPs = SIMD_PI;
208  isClosed = true;
209  }
210  else if((maxPs - minPs) >= SIMD_PI * btScalar(2.f))
211  {
212  isClosed = true;
213  }
214  else
215  {
216  isClosed = false;
217  }
218  int n_vert = (int)((maxPs - minPs) / step) + 1;
219  if(n_vert < 2) n_vert = 2;
220  btScalar step_v = (maxPs - minPs) / btScalar(n_vert - 1);
221  for(int i = 0; i < n_hor; i++)
222  {
223  btScalar th = minTh + btScalar(i) * step_h;
224  btScalar sth = radius * btSin(th);
225  btScalar cth = radius * btCos(th);
226  for(int j = 0; j < n_vert; j++)
227  {
228  btScalar psi = minPs + btScalar(j) * step_v;
229  btScalar sps = btSin(psi);
230  btScalar cps = btCos(psi);
231  pvB[j] = center + cth * cps * iv + cth * sps * jv + sth * kv;
232  if(i)
233  {
234  drawLine(pvA[j], pvB[j], color);
235  }
236  else if(drawS)
237  {
238  drawLine(spole, pvB[j], color);
239  }
240  if(j)
241  {
242  drawLine(pvB[j-1], pvB[j], color);
243  }
244  else
245  {
246  arcStart = pvB[j];
247  }
248  if((i == (n_hor - 1)) && drawN)
249  {
250  drawLine(npole, pvB[j], color);
251  }
252 
253  if (drawCenter)
254  {
255  if(isClosed)
256  {
257  if(j == (n_vert-1))
258  {
259  drawLine(arcStart, pvB[j], color);
260  }
261  }
262  else
263  {
264  if(((!i) || (i == (n_hor-1))) && ((!j) || (j == (n_vert-1))))
265  {
266  drawLine(center, pvB[j], color);
267  }
268  }
269  }
270  }
271  pT = pvA; pvA = pvB; pvB = pT;
272  }
273  }
274 
275 
276  virtual void drawBox(const btVector3& bbMin, const btVector3& bbMax, const btVector3& color)
277  {
278  drawLine(btVector3(bbMin[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMin[1], bbMin[2]), color);
279  drawLine(btVector3(bbMax[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMax[1], bbMin[2]), color);
280  drawLine(btVector3(bbMax[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMax[1], bbMin[2]), color);
281  drawLine(btVector3(bbMin[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMin[1], bbMin[2]), color);
282  drawLine(btVector3(bbMin[0], bbMin[1], bbMin[2]), btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
283  drawLine(btVector3(bbMax[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
284  drawLine(btVector3(bbMax[0], bbMax[1], bbMin[2]), btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
285  drawLine(btVector3(bbMin[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
286  drawLine(btVector3(bbMin[0], bbMin[1], bbMax[2]), btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
287  drawLine(btVector3(bbMax[0], bbMin[1], bbMax[2]), btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
288  drawLine(btVector3(bbMax[0], bbMax[1], bbMax[2]), btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
289  drawLine(btVector3(bbMin[0], bbMax[1], bbMax[2]), btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
290  }
291  virtual void drawBox(const btVector3& bbMin, const btVector3& bbMax, const btTransform& trans, const btVector3& color)
292  {
293  drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), color);
294  drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), color);
295  drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), color);
296  drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), color);
297  drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
298  drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
299  drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), trans * btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
300  drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
301  drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), trans * btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
302  drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMax[2]), trans * btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
303  drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMax[2]), trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
304  drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
305  }
306 
307  virtual void drawCapsule(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
308  {
309  int stepDegrees = 30;
310 
311  btVector3 capStart(0.f,0.f,0.f);
312  capStart[upAxis] = -halfHeight;
313 
314  btVector3 capEnd(0.f,0.f,0.f);
315  capEnd[upAxis] = halfHeight;
316 
317  // Draw the ends
318  {
319 
320  btTransform childTransform = transform;
321  childTransform.getOrigin() = transform * capStart;
322  {
323  btVector3 center = childTransform.getOrigin();
324  btVector3 up = childTransform.getBasis().getColumn((upAxis+1)%3);
325  btVector3 axis = -childTransform.getBasis().getColumn(upAxis);
326  btScalar minTh = -SIMD_HALF_PI;
327  btScalar maxTh = SIMD_HALF_PI;
328  btScalar minPs = -SIMD_HALF_PI;
329  btScalar maxPs = SIMD_HALF_PI;
330 
331  drawSpherePatch(center, up, axis, radius,minTh, maxTh, minPs, maxPs, color, btScalar(stepDegrees) ,false);
332  }
333 
334 
335 
336  }
337 
338  {
339  btTransform childTransform = transform;
340  childTransform.getOrigin() = transform * capEnd;
341  {
342  btVector3 center = childTransform.getOrigin();
343  btVector3 up = childTransform.getBasis().getColumn((upAxis+1)%3);
344  btVector3 axis = childTransform.getBasis().getColumn(upAxis);
345  btScalar minTh = -SIMD_HALF_PI;
346  btScalar maxTh = SIMD_HALF_PI;
347  btScalar minPs = -SIMD_HALF_PI;
348  btScalar maxPs = SIMD_HALF_PI;
349  drawSpherePatch(center, up, axis, radius,minTh, maxTh, minPs, maxPs, color, btScalar(stepDegrees) ,false);
350  }
351  }
352 
353  // Draw some additional lines
354  btVector3 start = transform.getOrigin();
355 
356  for (int i=0;i<360;i+=stepDegrees)
357  {
358  capEnd[(upAxis+1)%3] = capStart[(upAxis+1)%3] = btSin(btScalar(i)*SIMD_RADS_PER_DEG)*radius;
359  capEnd[(upAxis+2)%3] = capStart[(upAxis+2)%3] = btCos(btScalar(i)*SIMD_RADS_PER_DEG)*radius;
360  drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
361  }
362 
363  }
364 
365  virtual void drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
366  {
367  btVector3 start = transform.getOrigin();
368  btVector3 offsetHeight(0,0,0);
369  offsetHeight[upAxis] = halfHeight;
370  int stepDegrees=30;
371  btVector3 capStart(0.f,0.f,0.f);
372  capStart[upAxis] = -halfHeight;
373  btVector3 capEnd(0.f,0.f,0.f);
374  capEnd[upAxis] = halfHeight;
375 
376  for (int i=0;i<360;i+=stepDegrees)
377  {
378  capEnd[(upAxis+1)%3] = capStart[(upAxis+1)%3] = btSin(btScalar(i)*SIMD_RADS_PER_DEG)*radius;
379  capEnd[(upAxis+2)%3] = capStart[(upAxis+2)%3] = btCos(btScalar(i)*SIMD_RADS_PER_DEG)*radius;
380  drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
381  }
382  // Drawing top and bottom caps of the cylinder
383  btVector3 yaxis(0,0,0);
384  yaxis[upAxis] = btScalar(1.0);
385  btVector3 xaxis(0,0,0);
386  xaxis[(upAxis+1)%3] = btScalar(1.0);
387  drawArc(start-transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,btScalar(10.0));
388  drawArc(start+transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,btScalar(10.0));
389  }
390 
391  virtual void drawCone(btScalar radius, btScalar height, int upAxis, const btTransform& transform, const btVector3& color)
392  {
393  int stepDegrees = 30;
394  btVector3 start = transform.getOrigin();
395 
396  btVector3 offsetHeight(0,0,0);
397  btScalar halfHeight = height * btScalar(0.5);
398  offsetHeight[upAxis] = halfHeight;
399  btVector3 offsetRadius(0,0,0);
400  offsetRadius[(upAxis+1)%3] = radius;
401  btVector3 offset2Radius(0,0,0);
402  offset2Radius[(upAxis+2)%3] = radius;
403 
404 
405  btVector3 capEnd(0.f,0.f,0.f);
406  capEnd[upAxis] = -halfHeight;
407 
408  for (int i=0;i<360;i+=stepDegrees)
409  {
410  capEnd[(upAxis+1)%3] = btSin(btScalar(i)*SIMD_RADS_PER_DEG)*radius;
411  capEnd[(upAxis+2)%3] = btCos(btScalar(i)*SIMD_RADS_PER_DEG)*radius;
412  drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * capEnd, color);
413  }
414 
415  drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight+offsetRadius),color);
416  drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight-offsetRadius),color);
417  drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight+offset2Radius),color);
418  drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight-offset2Radius),color);
419 
420  // Drawing the base of the cone
421  btVector3 yaxis(0,0,0);
422  yaxis[upAxis] = btScalar(1.0);
423  btVector3 xaxis(0,0,0);
424  xaxis[(upAxis+1)%3] = btScalar(1.0);
425  drawArc(start-transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,10.0);
426  }
427 
428  virtual void drawPlane(const btVector3& planeNormal, btScalar planeConst, const btTransform& transform, const btVector3& color)
429  {
430  btVector3 planeOrigin = planeNormal * planeConst;
431  btVector3 vec0,vec1;
432  btPlaneSpace1(planeNormal,vec0,vec1);
433  btScalar vecLen = 100.f;
434  btVector3 pt0 = planeOrigin + vec0*vecLen;
435  btVector3 pt1 = planeOrigin - vec0*vecLen;
436  btVector3 pt2 = planeOrigin + vec1*vecLen;
437  btVector3 pt3 = planeOrigin - vec1*vecLen;
438  drawLine(transform*pt0,transform*pt1,color);
439  drawLine(transform*pt2,transform*pt3,color);
440  }
441 };
442 
443 
444 #endif //BT_IDEBUG_DRAW__H
445 
void setOrigin(const btVector3 &origin)
Set the translational element.
Definition: btTransform.h:150
virtual void drawBox(const btVector3 &bbMin, const btVector3 &bbMax, const btTransform &trans, const btVector3 &color)
Definition: btIDebugDraw.h:291
virtual void drawSphere(const btVector3 &p, btScalar radius, const btVector3 &color)
Definition: btIDebugDraw.h:78
btScalar btSin(btScalar x)
Definition: btScalar.h:409
virtual void reportErrorWarning(const char *warningString)=0
virtual void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color)=0
virtual void drawTriangle(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2, const btVector3 &color, btScalar)
Definition: btIDebugDraw.h:90
virtual void drawBox(const btVector3 &bbMin, const btVector3 &bbMax, const btVector3 &color)
Definition: btIDebugDraw.h:276
void btPlaneSpace1(const T &n, T &p, T &q)
Definition: btVector3.h:1271
void setIdentity()
Set this transformation to the identity.
Definition: btTransform.h:172
virtual void drawPlane(const btVector3 &planeNormal, btScalar planeConst, const btTransform &transform, const btVector3 &color)
Definition: btIDebugDraw.h:428
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:144
btVector3 getColumn(int i) const
Get a column of the matrix as a vector.
Definition: btMatrix3x3.h:134
virtual void drawCapsule(btScalar radius, btScalar halfHeight, int upAxis, const btTransform &transform, const btVector3 &color)
Definition: btIDebugDraw.h:307
#define SIMD_HALF_PI
Definition: btScalar.h:436
virtual void drawContactPoint(const btVector3 &PointOnB, const btVector3 &normalOnB, btScalar distance, int lifeTime, const btVector3 &color)=0
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:169
virtual void draw3dText(const btVector3 &location, const char *textString)=0
#define SIMD_PI
Definition: btScalar.h:434
#define SIMD_2_PI
Definition: btScalar.h:435
virtual void drawCone(btScalar radius, btScalar height, int upAxis, const btTransform &transform, const btVector3 &color)
Definition: btIDebugDraw.h:391
btVector3 & getOrigin()
Return the origin vector translation.
Definition: btTransform.h:117
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
Definition: btVector3.h:377
btMatrix3x3 & getBasis()
Return the basis matrix for the rotation.
Definition: btTransform.h:112
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations...
Definition: btIDebugDraw.h:28
virtual void drawAabb(const btVector3 &from, const btVector3 &to, const btVector3 &color)
Definition: btIDebugDraw.h:107
btVector3 can be used to represent 3D points and vectors.
Definition: btVector3.h:83
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:86
virtual ~btIDebugDraw()
Definition: btIDebugDraw.h:53
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:34
virtual void drawTransform(const btTransform &transform, btScalar orthoLen)
Definition: btIDebugDraw.h:136
virtual int getDebugMode() const =0
virtual void setDebugMode(int debugMode)=0
virtual void drawSphere(btScalar radius, const btTransform &transform, const btVector3 &color)
Definition: btIDebugDraw.h:63
virtual void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &fromColor, const btVector3 &toColor)
Definition: btIDebugDraw.h:57
#define SIMD_RADS_PER_DEG
Definition: btScalar.h:437
virtual void drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform &transform, const btVector3 &color)
Definition: btIDebugDraw.h:365
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:266
btScalar btCos(btScalar x)
Definition: btScalar.h:408