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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user