Skip to content

Bug in ChCollisionSystemBullet::RayHit(...) when using it to find collisions with just one specific model #563

@bmo-Scape

Description

@bmo-Scape

Using version 9.0.1.

Calling ChCollisionSystem::RayHit(const ChVector3d& from, const ChVector3d& to, ChCollisionModel* model, ChRayhitResult& result) when using bullet for the collision system leads the the code below being hit. But it doesn't perform the comparison with the desired model correctly.

The code finds all collisions with all models and then afterwards (in lines 386 to 392) finds the collisions that fit the desired model:
Image

But this filtering is using the wrong model pointer. Instead of using rayCallback.m_collisionObject in line 387, rayCallback.m_collisionObject[i] should have been used. Otherwise, only if the last colliding object was the correct object, the correct collisions will be detected.

I hope that someone is able to take this info and turn it into a proper fix (PR) with the corresponding test that the code and test then works correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions