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

Add get_depth() to KinematicCollision2D/3D #64195

Merged
merged 1 commit into from
Aug 10, 2022

Conversation

TokageItLab
Copy link
Member

@TokageItLab TokageItLab commented Aug 10, 2022

Fixes godotengine/godot-proposals#3066

Add get_depth() to KinematicCollision3D and KinematicCollision2D.

get_depth.mp4

physics_test.zip

With this feature, for example, when a player is caught and press between objects, we can calculate damage according to the depth value.

If the penetration is too large, the collision is completely filled and the normals are inverted, making the value of depth not desirable. I think another PR is needed in the future for solving that problem.

@TokageItLab TokageItLab added this to the 4.0 milestone Aug 10, 2022
@TokageItLab TokageItLab requested a review from fabriceci August 10, 2022 01:17
@TokageItLab TokageItLab requested review from a team as code owners August 10, 2022 01:17
@TokageItLab TokageItLab changed the title add get_depth() to KinematicCollision3D as same of 2D Add get_depth() to KinematicCollision3D as same of 2D Aug 10, 2022
@TokageItLab TokageItLab marked this pull request as draft August 10, 2022 01:21
@TokageItLab TokageItLab changed the title Add get_depth() to KinematicCollision3D as same of 2D Add get_depth() to KinematicCollision2D/3D Aug 10, 2022
@TokageItLab TokageItLab marked this pull request as ready for review August 10, 2022 01:34
@TokageItLab TokageItLab requested a review from a team as a code owner August 10, 2022 01:34
@akien-mga akien-mga merged commit 0e60a4a into godotengine:master Aug 10, 2022
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

Implement is_inside_solid_geometry() in CharacterBody
2 participants