Skip to content

Setters for Shapes #349

Answered by jrouwe
peter1745 asked this question in Q&A
Dec 5, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hello,

The fact that there aren't any setters is on purpose. In specific cases it would be harmless to have them, e.g. if your body uses a simple sphere shape, it's not colliding with anything and you don't care about the mass/inertia you could easily change its radius.

If however your sphere is part of a compound shape and you change its radius then the bounding volume information of the compound shape will be incorrect. Also its calculated center of mass will be incorrect and because a body stores not its position but its center of mass position, this means a change of center of mass of the shape actually implicitly changes the position of the body. Finally, if the body is in the vicini…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@peter1745
Comment options

Answer selected by peter1745
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #348 on December 06, 2022 19:23.