only use the getInterpolationWorldTransform for objects that are not isStaticOrKinematic

This should solver the issue discussed here: http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=7681
remove some warning
This commit is contained in:
erwin.coumans
2011-12-12 13:33:34 +00:00
parent 76785d6e01
commit 665829bd81
2 changed files with 13 additions and 8 deletions

View File

@@ -65,9 +65,10 @@ cl_platform_id btOpenCLUtils::getPlatform(int platformIndex, cl_int* pErrNum)
{
cl_platform_id platform = 0;
cl_uint numPlatforms;
cl_int ciErrNum = clGetPlatformIDs(0, NULL, &numPlatforms);
cl_uint clNumPlatforms;
cl_int ciErrNum = clGetPlatformIDs(0, NULL, &clNumPlatforms);
int numPlatforms = (int)clNumPlatforms;
if (platformIndex>=0 && platformIndex<numPlatforms)
{
cl_platform_id* platforms = new cl_platform_id[numPlatforms];
@@ -138,10 +139,13 @@ cl_context btOpenCLUtils::createContextFromPlatform(cl_platform_id platform, cl_
cl_context btOpenCLUtils::createContextFromType(cl_device_type deviceType, cl_int* pErrNum, void* pGLContext, void* pGLDC )
{
cl_uint numPlatforms;
cl_uint clNumPlatforms;
cl_context retContext = 0;
cl_int ciErrNum = clGetPlatformIDs(0, NULL, &numPlatforms);
cl_int ciErrNum = clGetPlatformIDs(0, NULL, &clNumPlatforms);
int numPlatforms = (int)clNumPlatforms;
if(ciErrNum != CL_SUCCESS)
{
if(pErrNum != NULL) *pErrNum = ciErrNum;
@@ -224,10 +228,11 @@ cl_device_id btOpenCLUtils::getDevice(cl_context cxMainContext, int deviceIndex)
// get the list of devices associated with context
clGetContextInfo(cxMainContext, CL_CONTEXT_DEVICES, 0, NULL, &szParmDataBytes);
if( szParmDataBytes / sizeof(cl_device_id) < deviceIndex ) {
if( int(szParmDataBytes / sizeof(cl_device_id)) < deviceIndex ) {
return (cl_device_id)-1;
}
cdDevices = (cl_device_id*) malloc(szParmDataBytes);
clGetContextInfo(cxMainContext, CL_CONTEXT_DEVICES, szParmDataBytes, cdDevices, NULL);

View File

@@ -155,7 +155,7 @@ void btCollisionWorld::updateSingleAabb(btCollisionObject* colObj)
minAabb -= contactThreshold;
maxAabb += contactThreshold;
if(getDispatchInfo().m_useContinuous && colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY)
if(getDispatchInfo().m_useContinuous && !colObj->isStaticOrKinematicObject())
{
btVector3 minAabb2,maxAabb2;
colObj->getCollisionShape()->getAabb(colObj->getInterpolationWorldTransform(),minAabb2,maxAabb2);
@@ -1457,7 +1457,7 @@ void btCollisionWorld::debugDrawWorld()
btVector3 minAabb2,maxAabb2;
if(colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY)
if(getDispatchInfo().m_useContinuous && !colObj->isStaticOrKinematicObject())
{
colObj->getCollisionShape()->getAabb(colObj->getInterpolationWorldTransform(),minAabb2,maxAabb2);
minAabb2 -= contactThreshold;