Physx slow collision detection

i have created one box and one sphere as actor.
i am applying force to sphere, when force is low collision detection is done properly.
but when the force is high the sphere goes inside the box.


I think that you need to activate Continuous Collision Detection (CCD). CCD activation depends on ypur physX version.

thanks, i have added the ccd code but still my sphere goes inside the box.


gPhysicsSDK->setParameter(NX_CONTINUOUS_CD, bCCDEnabled);
gPhysicsSDK->setParameter(NX_CCD_EPSILON, 0.01);

CreateActorBox(float width, float height, float depth, NxVec3 position)

boxDesc.ccdSkeleton = CreateCCDSkeleton(width*0.8f,gPhysicsSDK);
boxDesc.shapeFlags |= NX_SF_DYNAMIC_DYNAMIC_CCD; // Activate dynamic-dynamic CCD for this body


CreateActorSphere(float width, float height, float depth, NxVec3 position)

sphereDesc.ccdSkeleton = CreateCCDSkeleton(2radius0.8f,gPhysicsSDK);
sphereDesc.shapeFlags |= NX_SF_DYNAMIC_DYNAMIC_CCD; // Activate dynamic-dynamic CCD for this body


NxCCDSkeleton* PhyActor::CreateCCDSkeleton(float size,NxPhysicsSDK* gPhysicsSDK)
NxU32 triangles[3 * 12] = {

NxVec3 points[8];

// Static mesh
points[0].set( size, -size, -size);
points[1].set( size, -size,  size);
points[2].set( size,  size, -size);
points[3].set( size,  size,  size);

points[4].set(-size, -size, -size);
points[5].set(-size, -size,  size);
points[6].set(-size,  size, -size);
points[7].set(-size,  size,  size);

NxSimpleTriangleMesh stm;
stm.numVertices = 8;
stm.numTriangles = 6*2;
stm.pointStrideBytes = sizeof(NxVec3);
stm.triangleStrideBytes = sizeof(NxU32)*3;

stm.points = points;
stm.triangles = triangles;
stm.flags |= NX_MF_FLIPNORMALS;
return gPhysicsSDK->createCCDSkeleton(stm);


Perhaps the force you apply is too high. Try to reduce it gradually to see what is the max force you can apply.

First of all what do you use for rendering the scene and actors? (The units in PhysX could be different than the renderer that you use). I use PhysX 3.2.1 - Irricht 1.7.3 no CCD enabled and I have no problems with collisions even when I have 1000 spheres joined together ;)

i am using Directx9 for rendering.
well i downloaded physx3.2.1 from
seems little bit different form ver 2.8.1. now just going through that sdk. after some time i will update my status.

thanks for the help :)