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

Expose physics RID #432

Merged
merged 1 commit into from
Aug 1, 2024
Merged

Expose physics RID #432

merged 1 commit into from
Aug 1, 2024

Conversation

Ryan-000
Copy link
Contributor

It's quite useful when you need to interact with the terrain from PhysicsDirectSpaceState3D.

src/terrain_3d.h Outdated
@@ -154,6 +154,7 @@ class Terrain3D : public Node3D {
uint32_t get_collision_mask() const { return _collision_mask; };
void set_collision_priority(const real_t p_priority);
real_t get_collision_priority() const { return _collision_priority; }
RID get_rid() const { return _static_body; };
Copy link
Owner

Choose a reason for hiding this comment

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

The function call will look like terrain->get_rid(), but this is not the RID of Terrain3D. Call it get_collision_rid().

If debug collision is enabled, and _debug_static_body != nullptr, you need to return _debug_static_body->get_rid() or RID() if nothing.

Bear in mind #278 will redesign collision and the API might change in the future.

@TokisanGames TokisanGames added the api API changes label Jul 26, 2024
@TokisanGames
Copy link
Owner

Thanks for the change. I have updated this for you so we can merge it in.

You made your change on the main branch instead of another as instructed in the Godot pull request workflow. I had to force push into your main branch, which has probably broken it on your system. That means you might not be able to pull changes. If so, you'll have to delete your local main branch and download it again, or do another clone. In the future, always make another branch to make changes in.

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

Successfully merging this pull request may close these issues.

2 participants