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 Method get_inverse_inertia_tensor #40512

Merged
merged 1 commit into from
Jul 21, 2020

Conversation

yrk06
Copy link
Contributor

@yrk06 yrk06 commented Jul 19, 2020

Exposed inertia tensor to GDScript

How

This was done by creating a variable on the rigidbody class. The variable receives the inverse inertia tensor value each time the RigidBody state gets changed, then the get_inverse_inertia_tensor() returns the the inverse_inertia_tensor. The method is exposed to GDScript with bind_method

Consequences

As a consequence of this, rotations with rigid bodies can be controlled more accurately through the use of Physics Formulas of Torque

Requests

This was proposed in: godotengine/godot-proposals#1114 also in #2125 and kind of related to godotengine/godot-proposals#945

This Pull Request has been made in the Godot 3.2 branch at #39817 and now I've made it in the Master Branch (due to class name changes, for instance RigidBody class became RigidBody3D)

@yrk06 yrk06 requested a review from a team as a code owner July 19, 2020 17:15
@yrk06 yrk06 force-pushed the ExposeInertiaTensorMaster branch from 9735e7b to 1ab6460 Compare July 19, 2020 17:27
@Calinou Calinou added cherrypick:3.x Considered for cherry-picking into a future 3.x release enhancement topic:physics labels Jul 19, 2020
@Calinou Calinou added this to the 4.0 milestone Jul 19, 2020
@Calinou Calinou removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jul 19, 2020
@akien-mga
Copy link
Member

Needs a rebase on current master to fix CI.

@yrk06 yrk06 force-pushed the ExposeInertiaTensorMaster branch from 1ab6460 to 7055814 Compare July 20, 2020 16:33
@yrk06
Copy link
Contributor Author

yrk06 commented Jul 20, 2020

Needs a rebase on current master to fix CI.

Rebase done. While on that note, should I also do a rebase for the 3.2 version pull request?

@akien-mga
Copy link
Member

Unless the CI checks failed there too, it shouldn't be necessary.

@yrk06 yrk06 force-pushed the ExposeInertiaTensorMaster branch from 7055814 to a91103a Compare July 21, 2020 14:36
@yrk06 yrk06 changed the title Added Method get_inverse_inertia_tensor Add Method get_inverse_inertia_tensor Jul 21, 2020
@akien-mga akien-mga merged commit 01fb1f1 into godotengine:master Jul 21, 2020
@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.

4 participants