Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Should actor massScale affect all aspects of simulation?
#5
(20-10-2025, 10:58 AM)josemendez Wrote: Yes it would. Internal forces are also forces.

Rotational mass is basically how much mass must be considered when it comes to bending the rod (which is done by rotating particles). You can think of it as the physical thickness of the rod: the more mass, the thicker the rod is, and the harder it is to bend it. Compliance also plays a role in this, as it's the bending resistance of the rod's material. "More" material (more mass) and harder material (less compliance) = harder to bend.

Where is that part of code that is affected by this? I checked bend constraint and yes compliance is added to weights of invRotMasses, but except that place is there anything else? I tested weights some time ago and I could not find difference in bending when mass was small or big, the only important thing was relation of masses.


(20-10-2025, 10:58 AM)josemendez Wrote: That can't be the case: if you ignore mass, forces become accelerations and all you're doing is modifying the velocity directly. Could you share your code for the spring?
Yeah, I just double ask, because I expected the same result you described, so it should mean there is some other setting or script changing my movement.
I need to inspect my scene then, unless you can see something.

Code:
private Vector4 CalculateSpringForce(Vector3 currentPosition, Vector3 targetPosition, Vector3 velocity)
{
     Vector3 delta = targetPosition - currentPosition;
     Vector3 direction = delta.normalized;
     Vector3 projectedVelocity = Vector3.Dot(direction, velocity) * direction;
     Vector3 force = stiffness * delta - projectedVelocity * damping;
     return Vector3.ClampMagnitude(force, maxSpringVelocity);
}
// Spring force is calculated in OnSimulationStart [...]
Vector3 force = CalculateSpringForce(currentPosition, targetPosition, solver.velocities[solverIndex]);
solver.velocities[solverIndex] += deltaTime * force;


(20-10-2025, 10:58 AM)josemendez Wrote: mass is right there in the equation you posted: the sum of drag and lift forces is multiplied by inverse mass (that is, divided by mass) to calculate acceleration. Then it's multiplied by time delta to get change in velocity, and an overall aerodynamic scale factor.


Simplified:

Code:
velocity += (dragForce + liftForce) / mass * dt;

that is,

Code:
velocity += acceleration * dt;
Aaah yes, my stupid mistake, I overlooked the bracket ending there and I read that as dragForce + liftForce * mass * dt;
Ok so actually mass is even more important for me in such a case.

Last question to this topic - is collision different for single particle with static collider when mass is different? I guess friction is affected, but except that is there any difference for mass 1 or 100? Larger depenetration, some bounce or anything like that?
Reply


Messages In This Thread
RE: Should actor massScale affect all aspects of simulation? - by Qriva0 - 20-10-2025, 11:55 AM