Collision materials

Once a collision takes place, there must be some kind of collision response. How the bodies respond to a collision depends on what ObiCollisionMaterials your particles / colliders are using. All Obi actors (cloth, ropes, etc) have a "Material" property that lets you specify which ObiCollisionMaterial will be used by all of that actor's particles. You can also assign collision materials to ObiColliders.

In the image above, the red arrow represents the particle's velocity upon collision. This velocity is split in two components: one along the contact normal, and one along the contact tangent. The blue arrow represents the force applied to the particle to cancel its normal velocity, which is always fully applied. The purple arrow is the friction force, which removes a percentage of the tangential velocity component (in the image, 100% of it). The green arrow is the stickiness force.



Heavy ball falling on a very sticky piece of cloth.

ObiCollisionMaterials are assets, just like Unity's PhysicMaterials. You can right click in your project folders, and select Create->Obi->ObiCollisionMaterial. Here's the material inspector:



Dynamic friction

Percentage of relative tangential velocity removed in a collision, once the static friction threshold has been surpassed and the particle is moving relative to the surface. 0 means things will slide as if made of ice, 1 will result in total loss of tangential velocity.

Static friction

Percentage of relative tangential velocity removed in a collision. 0 means things will slide as if made of ice, 1 will result in total loss of tangential velocity.

Stickiness

Amount of inward normal force applied between objects in a collision. 0 means no force will be applied, 1 will keep objects from separating once they collide.

Stick distance

Maximum distance between objects at which sticky forces are applied. Since contacts will be generated between bodies within the stick distance, it should be kept as small as possible to reduce the amount of contacts generated.

Friction combine

How is the friction coefficient calculated when two objects involved in a collision have different coefficients. If both objects have different friction combine modes, the mode with the lowest enum index is used.

Stickiness combine

How is the stickiness coefficient calculated when two objects involved in a collision have different coefficients. If both objects have different stickiness combine modes, the mode with the lowest enum index is used.

Rolling contacts

Enable this to perform full contact resolution including angular velocities. Regular contacts (both particle-particle and particle-collider) treat particles as simple positions in space, so they won't cause particles to rotate. This simplification allows for very cheap collision response, as only linear velocities are considered. However, you can choose to perform full contact resolution taking angular velocities and particle orientations into account by enabling rolling contacts in the contact material.

Regular contacts: angular velocities / orientations are ignored.
Rolling contacts: angular velocities / orientations are honored.

If you enable rolling contacts for a collision material, a new parameter "rolling friction" will appear. Rolling friction acts by appling a torque that opposes the angular velocity of the particles involved in a contact. In real life, perfectly spherical particles would never stop rolling on an inclined plane. However, particles with an irregular surface (such as rocks or pebbles) would stop rolling after a while, due to the unevenness of their surface. This is what rolling friction strives to simulate.

Particles in the left have higher rolling friction than the ones in the right, so they eventually stop rolling even on an inclined plane.

Rolling friction

Rolling friction: During a rolling contact, the amount of rolling resistance applied. Values between 0 and 0.1 are most useful.