This object is in archive! 

Center of Mass and Mass PB API Inconsistent and Incomplete

Computer Erika shared this feedback 2 years ago
Not Enough Votes

When using the Programming Block you can run the functions "CenterOfMass()" and "CalculateShipMass()" on an "IMyShipController"


But CenterOfMass() only returns the Center of Mass for the one ship,

(Not through landing gear, connector or otherwise)

while CalculateShipMass() on the other hand calculates mass for every connected ship

(through landing gear, connector or otherwise)


If I wanted to find the CoM(Center of Mass) for the whole ship (connections included),

you could use the CoM and Masses of all connected grids to find the the CoM for the whole ship,

but you can't find the Mass of only one grid, only the total mass of the ship, so its not possible


And if you wanted to find the Mass of just one grid, well you can't cause it only returns the mass of the every connected grid


These functions are inconsistent with what their applying too,

They also can't be used to find the center of mass for a all connected ships,

or mass of just one ship, and thus are Incomplete


This is stops scripters from calculating what thrusters to active to move the ship in ways they intend


Perhaps you can add a bool parameter to both those functions to indicate weather you mean every connected ship, or just one ship?

Replies (1)

photo
1

I completely agree. The inconsistency doesn't make any sense. I can't see it being difficult to implement, since the game already knows the construct's COM. Heck, while they're at it, they could give us the ship/grid's inertia tensor as well.

I've been trying to script a multigrid gravity drive, for which knowing the ship's COM is pretty essential. Perhaps that seems like a niche application, and maybe it is, but regardless, it's super unrealistic for a (real) engineer to not be able find/calculate his construct's COM.

Leave a Comment
 
Attach a file