Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 3, 2011, 5:07:42 AM (13 years ago)
Author:
rgrieder
Message:

Updated Bullet from v2.77 to v2.78.
(I'm not going to make a branch for that since the update from 2.74 to 2.77 hasn't been tested that much either).

You will HAVE to do a complete RECOMPILE! I tested with MSVC and MinGW and they both threw linker errors at me.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/external/bullet/LinearMath/btIDebugDraw.h

    r8351 r8393  
    1515
    1616
    17 #ifndef IDEBUG_DRAW__H
    18 #define IDEBUG_DRAW__H
     17#ifndef BT_IDEBUG_DRAW__H
     18#define BT_IDEBUG_DRAW__H
    1919
    2020#include "btVector3.h"
     
    310310                drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
    311311        }
     312
     313        virtual void drawCapsule(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
     314        {
     315                btVector3 capStart(0.f,0.f,0.f);
     316                capStart[upAxis] = -halfHeight;
     317
     318                btVector3 capEnd(0.f,0.f,0.f);
     319                capEnd[upAxis] = halfHeight;
     320
     321                // Draw the ends
     322                {
     323
     324                        btTransform childTransform = transform;
     325                        childTransform.getOrigin() = transform * capStart;
     326                        drawSphere(radius, childTransform, color);
     327                }
     328
     329                {
     330                        btTransform childTransform = transform;
     331                        childTransform.getOrigin() = transform * capEnd;
     332                        drawSphere(radius, childTransform, color);
     333                }
     334
     335                // Draw some additional lines
     336                btVector3 start = transform.getOrigin();
     337
     338                capStart[(upAxis+1)%3] = radius;
     339                capEnd[(upAxis+1)%3] = radius;
     340                drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
     341                capStart[(upAxis+1)%3] = -radius;
     342                capEnd[(upAxis+1)%3] = -radius;
     343                drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
     344
     345                capStart[(upAxis+1)%3] = 0.f;
     346                capEnd[(upAxis+1)%3] = 0.f;
     347
     348                capStart[(upAxis+2)%3] = radius;
     349                capEnd[(upAxis+2)%3] = radius;
     350                drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
     351                capStart[(upAxis+2)%3] = -radius;
     352                capEnd[(upAxis+2)%3] = -radius;
     353                drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
     354        }
     355
     356        virtual void drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
     357        {
     358                btVector3 start = transform.getOrigin();
     359                btVector3       offsetHeight(0,0,0);
     360                offsetHeight[upAxis] = halfHeight;
     361                btVector3       offsetRadius(0,0,0);
     362                offsetRadius[(upAxis+1)%3] = radius;
     363                drawLine(start+transform.getBasis() * (offsetHeight+offsetRadius),start+transform.getBasis() * (-offsetHeight+offsetRadius),color);
     364                drawLine(start+transform.getBasis() * (offsetHeight-offsetRadius),start+transform.getBasis() * (-offsetHeight-offsetRadius),color);
     365
     366                // Drawing top and bottom caps of the cylinder
     367                btVector3 yaxis(0,0,0);
     368                yaxis[upAxis] = btScalar(1.0);
     369                btVector3 xaxis(0,0,0);
     370                xaxis[(upAxis+1)%3] = btScalar(1.0);
     371                drawArc(start-transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,btScalar(10.0));
     372                drawArc(start+transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,btScalar(10.0));
     373        }
     374
     375        virtual void drawCone(btScalar radius, btScalar height, int upAxis, const btTransform& transform, const btVector3& color)
     376        {
     377
     378                btVector3 start = transform.getOrigin();
     379
     380                btVector3       offsetHeight(0,0,0);
     381                offsetHeight[upAxis] = height * btScalar(0.5);
     382                btVector3       offsetRadius(0,0,0);
     383                offsetRadius[(upAxis+1)%3] = radius;
     384                btVector3       offset2Radius(0,0,0);
     385                offset2Radius[(upAxis+2)%3] = radius;
     386
     387                drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight+offsetRadius),color);
     388                drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight-offsetRadius),color);
     389                drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight+offset2Radius),color);
     390                drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight-offset2Radius),color);
     391
     392                // Drawing the base of the cone
     393                btVector3 yaxis(0,0,0);
     394                yaxis[upAxis] = btScalar(1.0);
     395                btVector3 xaxis(0,0,0);
     396                xaxis[(upAxis+1)%3] = btScalar(1.0);
     397                drawArc(start-transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,10.0);
     398        }
     399
     400        virtual void drawPlane(const btVector3& planeNormal, btScalar planeConst, const btTransform& transform, const btVector3& color)
     401        {
     402                btVector3 planeOrigin = planeNormal * planeConst;
     403                btVector3 vec0,vec1;
     404                btPlaneSpace1(planeNormal,vec0,vec1);
     405                btScalar vecLen = 100.f;
     406                btVector3 pt0 = planeOrigin + vec0*vecLen;
     407                btVector3 pt1 = planeOrigin - vec0*vecLen;
     408                btVector3 pt2 = planeOrigin + vec1*vecLen;
     409                btVector3 pt3 = planeOrigin - vec1*vecLen;
     410                drawLine(transform*pt0,transform*pt1,color);
     411                drawLine(transform*pt2,transform*pt3,color);
     412        }
    312413};
    313414
    314415
    315 #endif //IDEBUG_DRAW__H
    316 
     416#endif //BT_IDEBUG_DRAW__H
     417
Note: See TracChangeset for help on using the changeset viewer.