API Equivalent "Compute Mass and Inertia"

Typically: "How do I... ", "How can I... " questions
Post Reply
Matt
Posts: 10
Joined: 02 Feb 2016, 21:33

API Equivalent "Compute Mass and Inertia"

Post by Matt » 03 Feb 2016, 00:30

Hi there,

I'm looking to load object meshes to a simulation using the API, and then automatically do a convex decomposition on them. I've been able to do this, but have found that the Mass/Inertia matrix on the newly decomposed object is orders of magnitude greater then what they should be. Manually importing the mesh and computing the decomposed shape (default config), I get an object mas of ~0.01 kg. Importing the mesh via API, and computing decomposed shape via simConvexDecompose, I get an object mass of ~34 kg.

I've also made sure to scale the object BEFORE decomposing it, and playing around with setting the object to be dynamic, but it doesn't seem to have any effect (I think my API config is identical, but it also could be that something has been misplaced). Do you have any idea why the two approaches don't line up? Also -is there an equivalent API function for the "Compute Mass and Inertia" button (in the dynamic object settings dialogue)?

Here's a link to a sample scene, and object:
https://drive.google.com/folderview?id= ... sp=sharing

Matt

coppelia
Site Admin
Posts: 7123
Joined: 14 Dec 2012, 00:25

Re: API Equivalent "Compute Mass and Inertia"

Post by coppelia » 05 Feb 2016, 09:31

Hello Matt,

we discovered a small bug in the API routine. It will be corrected for next release. we also added a new API function: simComputeMassAndInertia.
The beta of next release should be available within a few days.

Cheers

Matt
Posts: 10
Joined: 02 Feb 2016, 21:33

Re: API Equivalent "Compute Mass and Inertia"

Post by Matt » 05 Feb 2016, 15:46

Great - thanks for looking into this. Looking forward to the Beta.

Matt

Post Reply