Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raycast on sphere shape most of the times fails #536

Open
di0rdna opened this issue Feb 21, 2022 · 0 comments
Open

Raycast on sphere shape most of the times fails #536

di0rdna opened this issue Feb 21, 2022 · 0 comments

Comments

@di0rdna
Copy link

di0rdna commented Feb 21, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant