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

Use cuboid_cuboid contact implementation. #318

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Vrixyz
Copy link
Contributor

@Vrixyz Vrixyz commented Mar 3, 2025

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

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.

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