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

Inertia scaling gives weird results #127

Open
danielkrakowiak opened this issue Mar 24, 2020 · 0 comments
Open

Inertia scaling gives weird results #127

danielkrakowiak opened this issue Mar 24, 2020 · 0 comments

Comments

@danielkrakowiak
Copy link

danielkrakowiak commented Mar 24, 2020

Hey, I'm using Unreal and trying to scale a cylinder's inertia tensor in one, specific axis. If I scale inertia tensor's z-axis it does resist rotation as expected. However, if I scale any of the other two axes, it also does resist rotation (even more seemingly). I would expect other two axes to not impact the shown rotation at all.

Here is the video.

I know this is Unreal, not pure PhysX, but maybe you could still help me. The cylinder is a triangle mesh, so the underlying physics representation is a convex shape. Can that affect initial inertia calculation and lead to inertia tensor components not being aligned with object coordinate space? Can they be misaligned somehow? I don't see any inertia tensor rotation in the interface so I assume that's not the case. Any ideas on what could be causing this?

Edit: I tried to print the value of Body->getMassSpaceInertiaTensor(). It's weird, because the more I scale Z-axis, the longer X, Y become and the shorter Z becomes in the vector returned by it. It also doesn't seem to change linearly with the scale provided.

Edit2: I read the code in PxMassProperties::scaleInertia and it seems that changing the inertia along one axis has impact on inertia in other axes. Maybe that's a law of nature that I don't intuitively grasp. Is there a good way to understand that?

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

No branches or pull requests

1 participant