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

Fix GodotSpace3D::test_body_motion() not setting local_shape #99901

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

adamscott
Copy link
Member

@adamscott adamscott commented Dec 1, 2024

After studying and much debugging...

I compared these lines...

rcd.object = col_obj;
rcd.shape = shape_idx;
rcd.local_shape = j;
bool sc = GodotCollisionSolver2D::solve(body_shape, body_shape_xform, Vector2(), against_shape, col_obj_shape_xform, Vector2(), _rest_cbk_result, &rcd, nullptr, margin);
if (!sc) {
continue;
}

with those.

rcd.object = col_obj;
rcd.shape = shape_idx;
bool sc = GodotCollisionSolver3D::solve_static(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), _rest_cbk_result, &rcd, nullptr, margin);
if (!sc) {
continue;
}

Mmmm. godot_space_3d.cpp seems to have a line missing.
So I added the line missing.

And it works. (!!?!?!)

Fixes #75069

@adamscott adamscott added bug topic:physics topic:3d cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Dec 1, 2024
@adamscott adamscott added this to the 4.4 milestone Dec 1, 2024
@adamscott adamscott requested a review from a team as a code owner December 1, 2024 18:08
@adamscott
Copy link
Member Author

And it works. (!!?!?!)

I'm joking. It really works and it makes sense.

Copy link
Member

@rburing rburing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. +1

@grazianobolla
Copy link

What did this cause?

@akien-mga akien-mga merged commit c59f4be into godotengine:master Dec 2, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release topic:physics topic:3d
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KinematicCollision3D.get_local_shape() always returns only the zero index shape
4 participants