Some unexpected collision behavior

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Some unexpected collision behavior

Postby JoshKlint » Wed Jan 15, 2025 2:01 pm

I have a situation where a sphere with 0.1 mass moving at 16 meters per second collides with a heavier object (3000 units). The sphere bounces off and causes a small movement of the larger object.

This behavior seemed normal to me, since KE = M * V ^ 2.

If I increase the heavier object's mass to 3000000 units, the sphere is still able to cause the same movement of the much heavier object, with very little difference from when mass is set to 3000.

I would expect that a large mass would eventually result in the heavier object remaining nearly stationary. Can you please explain if this behavior is correct?

This is how I apply mass to a body:
Code: Select all
auto collision = NewtonBodyGetCollision(newtonbody);
dFloat origin[3] = { 0.0,0.0,0.0 };
if (collision != NULL)
{
   dFloat inertia[3];
   NewtonConvexCollisionCalculateInertialMatrix(collision, inertia, origin);
   if (inertia[0] != dFloat(0) or inertia[1] != dFloat(0) or inertia[2] != dFloat(0) )
   {
      NewtonBodySetMassMatrix(newtonbody, mass, inertia[0] * mass, inertia[1] * mass, inertia[2] * mass);
   }
   else
   {
      NewtonBodySetMassMatrix(newtonbody, mass, 0.001 * mass, 0.001 * mass, 0.001 * mass);
   }
   NewtonBodySetCentreOfMass(newtonbody, origin);
}
else
{
   NewtonBodySetMassMatrix(newtonbody, mass, 0.001 * mass, 0.001 * mass, 0.001 * mass);
   NewtonBodySetCentreOfMass(newtonbody, origin);
}


Video:
https://www.youtube.com/watch?v=HUajH3xiPbc
JoshKlint
 
Posts: 184
Joined: Sun Dec 10, 2017 8:03 pm

Re: Some unexpected collision behavior

Postby Julio Jerez » Wed Jan 15, 2025 6:01 pm

you will have to use double for that.
Julio Jerez
Moderator
Moderator
 
Posts: 12425
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Some unexpected collision behavior

Postby JoshKlint » Wed Jan 15, 2025 6:58 pm

Okay, thank you for the information.
JoshKlint
 
Posts: 184
Joined: Sun Dec 10, 2017 8:03 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron