17 #ifndef BT_IDEBUG_DRAW__H
18 #define BT_IDEBUG_DRAW__H
72 drawLine(start-xoffs, start+yoffs, color);
73 drawLine(start+yoffs, start+xoffs, color);
74 drawLine(start+xoffs, start-yoffs, color);
75 drawLine(start-yoffs, start-xoffs, color);
78 drawLine(start-xoffs, start+zoffs, color);
79 drawLine(start+zoffs, start+xoffs, color);
80 drawLine(start+xoffs, start-zoffs, color);
81 drawLine(start-zoffs, start-xoffs, color);
84 drawLine(start-yoffs, start+zoffs, color);
85 drawLine(start+zoffs, start+yoffs, color);
86 drawLine(start+yoffs, start-zoffs, color);
87 drawLine(start-zoffs, start-yoffs, color);
131 pa =
btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],
132 edgecoord[2]*halfExtents[2]);
135 int othercoord = j%3;
136 edgecoord[othercoord]*=-1.f;
137 pb =
btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],
138 edgecoord[2]*halfExtents[2]);
162 int nSteps = (int)((maxAngle - minAngle) / step);
163 if(!nSteps) nSteps = 1;
169 for(
int i = 1; i <= nSteps; i++)
210 drawN = drawS =
true;
212 int n_hor = (int)((maxTh - minTh) / step) + 1;
213 if(n_hor < 2) n_hor = 2;
215 bool isClosed =
false;
230 int n_vert = (int)((maxPs - minPs) / step) + 1;
231 if(n_vert < 2) n_vert = 2;
233 for(
int i = 0; i < n_hor; i++)
238 for(
int j = 0; j < n_vert; j++)
243 pvB[j] = center + cth * cps * iv + cth * sps * jv + sth * kv;
260 if((i == (n_hor - 1)) && drawN)
273 if(((!i) || (i == (n_hor-1))) && ((!j) || (j == (n_vert-1))))
279 pT = pvA; pvA = pvB; pvB = pT;
318 capStart[upAxis] = -halfHeight;
321 capEnd[upAxis] = halfHeight;
327 childTransform.
getOrigin() = transform * capStart;
333 childTransform.
getOrigin() = transform * capEnd;
340 capStart[(upAxis+1)%3] = radius;
341 capEnd[(upAxis+1)%3] = radius;
343 capStart[(upAxis+1)%3] = -radius;
344 capEnd[(upAxis+1)%3] = -radius;
347 capStart[(upAxis+1)%3] = 0.f;
348 capEnd[(upAxis+1)%3] = 0.f;
350 capStart[(upAxis+2)%3] = radius;
351 capEnd[(upAxis+2)%3] = radius;
353 capStart[(upAxis+2)%3] = -radius;
354 capEnd[(upAxis+2)%3] = -radius;
362 offsetHeight[upAxis] = halfHeight;
364 offsetRadius[(upAxis+1)%3] = radius;
365 drawLine(start+transform.
getBasis() * (offsetHeight+offsetRadius),start+transform.
getBasis() * (-offsetHeight+offsetRadius),color);
366 drawLine(start+transform.
getBasis() * (offsetHeight-offsetRadius),start+transform.
getBasis() * (-offsetHeight-offsetRadius),color);
372 xaxis[(upAxis+1)%3] =
btScalar(1.0);
383 offsetHeight[upAxis] = height *
btScalar(0.5);
385 offsetRadius[(upAxis+1)%3] = radius;
387 offset2Radius[(upAxis+2)%3] = radius;
389 drawLine(start+transform.
getBasis() * (offsetHeight),start+transform.
getBasis() * (-offsetHeight+offsetRadius),color);
390 drawLine(start+transform.
getBasis() * (offsetHeight),start+transform.
getBasis() * (-offsetHeight-offsetRadius),color);
391 drawLine(start+transform.
getBasis() * (offsetHeight),start+transform.
getBasis() * (-offsetHeight+offset2Radius),color);
392 drawLine(start+transform.
getBasis() * (offsetHeight),start+transform.
getBasis() * (-offsetHeight-offset2Radius),color);
398 xaxis[(upAxis+1)%3] =
btScalar(1.0);
404 btVector3 planeOrigin = planeNormal * planeConst;
408 btVector3 pt0 = planeOrigin + vec0*vecLen;
409 btVector3 pt1 = planeOrigin - vec0*vecLen;
410 btVector3 pt2 = planeOrigin + vec1*vecLen;
411 btVector3 pt3 = planeOrigin - vec1*vecLen;
412 drawLine(transform*pt0,transform*pt1,color);
413 drawLine(transform*pt2,transform*pt3,color);
418 #endif //BT_IDEBUG_DRAW__H