-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
VehicleWheel can now return the surface it's colliding with. #55723
VehicleWheel can now return the surface it's colliding with. #55723
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it generally looks good! I've left some comments to fix and clarify a few things.
@pouleyKetchoupp I implemented the requested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just make sure you squash your commits into one using interactive rebase.
scene/3d/vehicle_body_3d.cpp
Outdated
@@ -225,6 +225,10 @@ bool VehicleWheel3D::is_in_contact() const { | |||
return m_raycastInfo.m_isInContact; | |||
} | |||
|
|||
Node3D *VehicleWheel3D::get_contact_body() const { | |||
return (m_raycastInfo.m_groundObject); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just nitpicking, but brackets are not needed :)
scene/3d/vehicle_body_3d.cpp
Outdated
@@ -225,6 +225,10 @@ bool VehicleWheel3D::is_in_contact() const { | |||
return m_raycastInfo.m_isInContact; | |||
} | |||
|
|||
Node3D *VehicleWheel3D::get_contact_body() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a trailing tab here, the style checks would fail. While fixing it, might be worth addressing https://github.com/godotengine/godot/pull/55723/files#r765866806 too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed these as well.
scene/3d/vehicle_body_3d.cpp
Outdated
wheel.m_raycastInfo.m_groundObject = nullptr; | ||
bool col = ss->intersect_ray(ray_params, rr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing tab here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thank you!
Once merged I would typically do the cherry-pick myself, unless it needs to be a dedicated backport due to significantly different codebases (but here it's similar, I'll just have to handle the node renames like |
258d2eb
to
9cc0596
Compare
Ah, okay! I'll let you do it then. I'm sorry I'm new to the Godot Development workflow. (I'm also not a big Git mage) |
There's one issue left, the method added in the documentation is not following alphabetical ordering: https://github.com/godotengine/godot/runs/4482502518?check_suite_focus=true For future contributions, you can use |
Fixed PR issues. Update vehicle_body_3d.cpp Apply suggestions from code review Co-authored-by: Camille Mohr-Daurat <pouleyKetchoup@gmail.com>
9cc0596
to
0c35240
Compare
Thank you! I fixed this issue and uploaded a new version. I'll be more careful next time. |
Thanks! And congrats for your first merged Godot contribution 🎉 |
Cherry-picked for 3.5. |
As per this proposed change I implemented the functionality to have give the ability to VehicleWheel to return the surface it's colliding with.
In this picture the two Blue and White bodies' ID's are returned by two VehicleWheels to the console.
Bugsquad edit: Implements godotengine/godot-proposals#3640