-
Notifications
You must be signed in to change notification settings - Fork 1
Mechanics
Besides working with collisions to effect bodies in the physics world, there are other means to control them. Keep in mind, that all calculations and definitions in physics are done in world space. The geometrical hierarchy of the graph is irrelevant. Use the world transformations of nodes, meshes and rigidbodies to apply the means below correctly.
It's possible to set the position and orientation of a non-kinematic rigidbody using the corresponding commands of ComponentRigidbody. Since that means an impossible action in the real world, they should be used carefully and may cause unexpected results.
It's also possible to set the translational and rotational velocity of a non-kinematic rigidbody using the corresponding commands of ComponentRigidbody. This also means an impossible action in the real world since the mass is not considered, but at least the body does not teleport in space.
Force accelerates mass. The larger the force or the lighter the mass, the higher the acceleration. The longer a constant force effects the mass, the higher the velocity of the mass in the direction of the force, as long as there is no friction, damping or collision. Respectively, it's useless to apply a force only for a very short amount of time, e.g. for one frame. Imagine pushing a cart in a supermarket.
To accelerate a mass instantaneously, taking the mass actually into account, apply an impulse to it. This is equivalent to a collision with a body moving with a certain amount of kinetic energy, transmitting it to the mass in the moment of impact. Imagine shooting objects of different mass in a game, but the bullets travel too fast to actually simulate them using the physics engine. Just apply an impulse at the point you aim at.
Torque is a force that does not accelerate a mass through space, but spins it in place, so the velocity is rotational. Other than that, what's written above concerning the force applies to the torque as well. Imagine the wind driving a windmill. Instead of calculating the forces of the air on the blades, simply apply a torque with an appropriate strength as long as the wind blows.
To spin up a mass instantaneously, taking the mass actually into account, apply an angular impulse to it, analogous to the linear impulse.