Skip to content

Conversation

@ThierryBerger
Copy link
Contributor

@ThierryBerger ThierryBerger commented Mar 3, 2025

cuboid_cuboid contact implementation is currently commented out, this PR investigates why and will attempt to bring it back.

** ⚠️ Currently in draft because current implementation is incorrect.**

step 1: add test

Currently, contact fall back to using the more generic "as_support_shape" implementation. Let's compare both results and see if any is incorrect.

a simple test (see c2686ce) reveal differences betweens the 2 implementations:

test log

[crates/parry3d-f64/../../src/query/contact/contact_cuboid_cuboid.rs:153:9] result_support = Some(
    Contact {
        point1: [
            1.0,
            0.25,
            0.25,
        ],
        point2: [
            -1.0,
            -0.25,
            -0.25,
        ],
        normal1: [
            [
                1.0,
                0.0,
                -0.0,
            ],
        ],
        normal2: [
            [
                -1.0,
                0.0,
                0.0,
            ],
        ],
        dist: -1.5,
    },
)
[crates/parry3d-f64/../../src/query/contact/contact_cuboid_cuboid.rs:154:9] result_cuboid = Some(
    Contact {
        point1: [
            -0.5,
            1.0,
            1.0,
        ],
        point2: [
            -1.0,
            1.0,
            1.0,
        ],
        normal1: [
            [
                0.0,
                0.7071067811865475,
                0.7071067811865475,
            ],
        ],
        normal2: [
            [
                0.0,
                -0.7071067811865475,
                -0.7071067811865475,
            ],
        ],
        dist: 0.7071067811865476,
    },
}

on cuboid_cuboid, dist being positive suggests there is no intersection, which is wrong here.

@ThierryBerger ThierryBerger marked this pull request as draft May 19, 2025 14:02
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

Successfully merging this pull request may close these issues.

1 participant