NVIDIAGameWorks/PhysX

Raycast on sphere shape most of the times fails

di0rdna opened this issue · 0 comments

I am using the raycast functionality quite a lot for a game that I'm developing. On most shapes the raycast works perfect, including sphere shapes, but for one shape with disabled the simulation the raycast works partially. Here is the code for the raycast :

`
physx::PxRigidDynamic* PhysxManager::RayCast(physx::PxVec3 origin, physx::PxVec3 unitDir, physx::PxReal maxDistance,
physx::PxVec3& hitPosition)
{
PxRaycastBuffer hit; // [out] Raycast results

    if (mScene->raycast(origin, unitDir, maxDistance, hit)) {
        hitPosition = hit.block.position;
        return dynamic_cast<PxRigidDynamic*>(hit.block.actor);
    }
    else
    {
        return nullptr;
    }
}

`

What am I doing wrong, or is there a bug?