17 #ifndef BT_IDEBUG_DRAW__H
18 #define BT_IDEBUG_DRAW__H
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 );
119 pa =
btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],
120 edgecoord[2]*halfExtents[2]);
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]);
150 int nSteps = (int)((maxAngle - minAngle) / step);
151 if(!nSteps) nSteps = 1;
157 for(
int i = 1; i <= nSteps; i++)
198 drawN = drawS =
true;
200 int n_hor = (int)((maxTh - minTh) / step) + 1;
201 if(n_hor < 2) n_hor = 2;
203 bool isClosed =
false;
218 int n_vert = (int)((maxPs - minPs) / step) + 1;
219 if(n_vert < 2) n_vert = 2;
221 for(
int i = 0; i < n_hor; i++)
226 for(
int j = 0; j < n_vert; j++)
231 pvB[j] = center + cth * cps * iv + cth * sps * jv + sth * kv;
248 if((i == (n_hor - 1)) && drawN)
264 if(((!i) || (i == (n_hor-1))) && ((!j) || (j == (n_vert-1))))
271 pT = pvA; pvA = pvB; pvB = pT;
309 int stepDegrees = 30;
312 capStart[upAxis] = -halfHeight;
315 capEnd[upAxis] = halfHeight;
321 childTransform.
getOrigin() = transform * capStart;
331 drawSpherePatch(center, up, axis, radius,minTh, maxTh, minPs, maxPs, color,
btScalar(stepDegrees) ,
false);
340 childTransform.
getOrigin() = transform * capEnd;
349 drawSpherePatch(center, up, axis, radius,minTh, maxTh, minPs, maxPs, color,
btScalar(stepDegrees) ,
false);
356 for (
int i=0;i<360;i+=stepDegrees)
359 capEnd[(upAxis+2)%3] = capStart[(upAxis+2)%3] =
btCos(
btScalar(i)*SIMD_RADS_PER_DEG)*radius;
369 offsetHeight[upAxis] = halfHeight;
372 capStart[upAxis] = -halfHeight;
374 capEnd[upAxis] = halfHeight;
376 for (
int i=0;i<360;i+=stepDegrees)
379 capEnd[(upAxis+2)%3] = capStart[(upAxis+2)%3] =
btCos(
btScalar(i)*SIMD_RADS_PER_DEG)*radius;
386 xaxis[(upAxis+1)%3] =
btScalar(1.0);
393 int stepDegrees = 30;
398 offsetHeight[upAxis] = halfHeight;
400 offsetRadius[(upAxis+1)%3] = radius;
402 offset2Radius[(upAxis+2)%3] = radius;
406 capEnd[upAxis] = -halfHeight;
408 for (
int i=0;i<360;i+=stepDegrees)
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);
424 xaxis[(upAxis+1)%3] =
btScalar(1.0);
430 btVector3 planeOrigin = planeNormal * planeConst;
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);
444 #endif //BT_IDEBUG_DRAW__H