Motion type & Layers
There are three different Motion types for a body, defining how the body moves :
Motion type | Description |
---|---|
Static | The body cannot move, regardless of forces applied |
Kinematic | The body can move with Velocity but not with Forces |
Dynamic | The body can move with Forces and with Velocity |
There are three different Layer types for a body, defining how the body collides with other bodies :
Layer type | Description |
---|---|
Static | Body is not meant to move, only react. It will physically collide with other bodies. |
Moving | Body is meant to move and react. It will physically collide with other bodies. |
Sensor | Body will send Trigger Events on output pin when it collides, but not physically collide with other bodies |
Example
Weight
Weight represents the mass of the object in kilograms and is used in various calculations, such as:
- Inertia: The resistance to changes in motion.
- Momentum: The product of the body’s mass and velocity.
- Force: The push or pull exerted on the object.
- Collision detection and response: The weight property is used to determine the outcome of collisions between objects.
Example
Same weight | Different weight |
---|---|
Blue weight: 10 Red weight: 10 |
Blue weight: 10 Red weight: 100 |
Motion Type
Each body has a motion quality setting that can be set to the following:
- Discrete: (default) A test for collision detection will be run at the beginning of each simulation step and if no collision is found the body will move according to its velocity.
This works fine in most cases for objects that are relatively big and not moving too fast.
- Linear Cast: This mode is intended for smaller and faster objects which can accidentally “tunnel” through other objects because their velocity is such that the collision is not detected in between two simulation steps. With this mode active, additional computing is done to check after a simulation step for any collisions that may have been missed. If such is the case, the body is placed back to the point where the collision occured.
This mode may also have the disadvantage of showing movements that are non-linear in speed and should be reserved for whenever fast moving and or smaller objects do not collide properly since more computing is involved.
Restitution
Restitution describes the elasticity of a collision between two bodies (or with the floor) and will adjust the velocity of the bodies involved in the collision. The restitution coefficient is usually a value between 0 and 1, where:
- 0 represents a completely inelastic collision, where the bodies stick together and do not bounce off each other.
- 1 represents a completely elastic collision, where the bodies bounce off each other with no loss of energy.
The restitution coefficient can be set for each body individually and in case of collision the greatest of the two values will be used in computing the reaction to apply on the momentum of each body.
Example
Same restitution | Different restitution |
---|---|
Blue restitution: 0.5 Red restitution: 0.5 |
Blue restitution: 0.2 Red restitution: 0.8 |
Analysis
With the same value of restitution, the balls bounce back from each other slightly and with the same energy.
When Red has a higher restitution than Blue: Red is pushed back slightly more but Blue is pushed back significantly more.
Note also that as Red’s restitution value approaches 1 it becomes slightly jittery and bounces off the floor.
Friction
Red has Friction set to 50 and Blue has Friction set to 1.0.
Both have a force applied of Vx = 1.0
Friction has close to no effect on spheres as the surface of contact with the floor is extremely small and close to a point.
Stone box (closest to camera) has Friction set to 1.0 and Brick box (farthest from camera) has Friction set to 0.20 (default)
On boxes sliding down a surface, differences in friction and its impact on acceleration and speed is far more visible as the surface in contact is much greater
Note that in this example Angular Speed Limit was set to its minimum value of 0.10 to improve readability of motion.
Linear Speed Limit
Red has Linear Speed Limit set to 1.0. Blue is set to 500 (default).
Both have a force applied of Fx = 1.0
Angular Speed Limit
Red has Angluar Speed Limit set to 10.0. Blue is set to 47.12 (default).
Both have a rotation force applied of TAy = 2.0
Need more help with this?
Don’t hesitate to contact us here.