Skip to content

changing mass of body during run time? #1323

Answered by jrouwe
yoshymoo asked this question in Q&A
Discussion options

You must be logged in to vote

If I understand this correctly, the box with a larger mass will have a smaller acceleration, right?

Correct if you're using BodyInterface/Body::AddForce they will get different accelerations. If you're expecting the boxes to have different acceleration due to gravity then no, they will accelerate in the same way.

I'm also thinking that there should also be a difference in collision response if I collide both box A and box B together.

Yes, this should also be the case. The heavy box should be far less affected.

If I change the HeavyOnLightTest sample to:

void HeavyOnLightTest::Initialize()
{
	// Floor
	CreateFloor();

	Ref<BoxShape> box = new BoxShape(Vec3::sReplicate(5));

	for (int i…

Replies: 3 comments 3 replies

Comment options

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

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@jrouwe
Comment options

Answer selected by yoshymoo
@yoshymoo
Comment options

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