Collisions are the interactions that occur between Nucleus objects (nCloth, nParticle, or passive objects) in your scene. nCloth and nParticle objects can also collide with themselves, which are called self collisions. When Nucleus objects collide or self-collide, there is an exchange or transformation of energy that affects how the object behaves. For example, if a moving passive object ball impacted an nCloth pillow, the force and impact of the ball would cause deformations in the pillow.
Certain Nucleus object properties affect the quality of your nDynamic collisions. For example, on the nClothShape node, Thickness determines the distance between an nCloth and its collision volume. On the nParticleShape node, Self Collide Width Scale determines the collision distance between particles that are emitted from the same nParticle object. On the nucleus node, Max Collision Iterations determines the maximum number of times per simulation step the Maya Nucleus solver will try to resolve your Nucleus object collisions. The Push Out, Trapped Check, and Crossover Push nClothShape attributes also try to improve nCloth collisions by resolving interpenetration.
Collisions with passive objects
You can create a passive object from any polygon mesh in your scene, and assign it to the same Maya Nucleus solver as the nCloth and nParticle you want it to interact with. Passive objects can interact with other Nucleus objects, but internal Maya Nucleus solver properties and external forces have no effect on them. When you create a passive object, a passive object handle appears on the mesh in the scene view, and the nRigidShape tab appears in the Attribute Editor. You can use the passive object handle to quickly select a passive object’s nRigidShape node, which then becomes the current tab selection in the Attribute Editor.
Passive objects can help you create the realistic behavior of cloth objects coming into contact with non-cloth objects. For example, if you have a character wearing an nCloth shirt, you can make the character’s body a passive object. Then during animation, when the character bends its arm at the elbow, the nCloth would behave as though it has come into contact with the character’s arm. For nParticles, passive objects provide a surface that deflect emitted particles, such as scattering sparks or splashing liquids. Modeled passive objects with concave regions can be filled with a volume of nParticles. nParticle and passive object collisions are similar to the collisions that occur between classic particles and rigid bodies.
For collisions to take place between a passive object and other Nucleus objects, the Collide attribute must be turned on in the Collisions properties of their respective nodes. In addition, you can set which of your nCloth and passive object’s components (Vertex, Edge, or Face) collide with the Collision Flag drop-down list in the Collisions sections of their respective nodes.
For additional control over your passive object collisions, you can include and exclude components from collisions with the Disable Collision or Exclude Collision Pairs constraints. See nConstraint > Disable Collision and nConstraint > Exclude Collide Pairs. You can also resolve passive object interpenetration with the Push Out, Trapped Check, and Crossover Push nClothShape or nRigidShape attributes.
For more information on collision creation, see Create and edit nCloth collisions and Set nParticle Collisions properties.
Collisions between nCloth and nParticles
You can create collisions and interactions between nCloth and nParticle objects if the objects are assigned to the same Maya Nucleus solver. Nucleus objects assigned to the same solver are affected by the solver properties in similar ways. For example, wind forces generated by the solver will cause the nCloth and nParticle objects to be animated in same direction as the wind force. However, depending on the object's individual attributes, such as Mass and Lift, these objects will react differently, and therefore, affects how nCloth and nParticle objects collide with each other.
For collisions to take place between nParticle and nCloth objects, the Collide attribute must be turned on for their respective nodes. In addition, for nCloth, you can set which of your nCloth object's components (Vertex, Edge, or Face) collide with the nParticles by setting the Collision Flag drop-down list in the Collisions section.
By default all nParticle, nCloth and passive collision objects that belong to the same Nucleus solver collide with each other. If you do not want all the Nucleus objects in your scene to collide, you can assign them to different Nucleus solvers before or after you create the object. You can also use the Disable Collision or Exclude Collision Pairs to keep Nucleus objects from colliding with each other. See Disable Collision and Exclude Collision Pairs constraints.
For nCloth, self collisions occur between the nCloth objects’s components, such as its vertices or faces. Self collisions are necessary for animated nCloth to simulate the interactions of cloth when it comes into contact with itself. For example, when an nCloth curtain panel is being pushed open along a curtain rod, it begins to sway and pleat against itself, causing the cloth to deform. You can also imagine how a flag might fold in on itself when the wind dies down, or how the full skirt on a dancer collides when the dancer changes direction.
For nParticles, self collisions occur between the individual particles that belong to same nParticle object. Like collisions between nParticles and other Nucleus objects, self collisions involve an exchange or transfer of energy. nParticle self collisions can be used to approximate interactions between rigid objects. For example you can instance geometry with nParticles and have the geometry collided with each other.
For self collisions to take place, the Self Collide attribute must be turned on in the Collisions section of the nClothShape or nParticle Attribute Editor tab. In addition, you can set which of your nCloth’s components (Vertex, VertexEdge, VertexFace, Full Surface) participate in its self collisions with the Self Collision Flag drop-down list in the Collisions section of the nClothShape tab. You can also increase and decrease the quality of your nCloth and nParticle object’s self collisions with the Max Self Collide Iterations and Self Collide Width Scale attributes.
Collisions and the nucleus node
The Maya Nucleus solver goes through a number of iterations to work out the proper behavior of your Nucleus object collisions. The greater the number of iterations, the more accurate your object collisions and the slower your simulation. You can clamp the number of iterations the Maya Nucleus solver can perform for Nucleus object collisions and self collisions by setting the Max Collision Iterations attribute on the nucleus node or the Max Self Collide attribute on the nClothShape and nParticleShape nodes.
You can also improve the accuracy of your Nucleus object collisions by increasing the number of substeps the Maya Nucleus solver is using. Substeps determine the number of times the Maya Nucleus solves your simulation, and thus calculates your object’s collisions, per frame. Adjusting Substeps allows you to control how the simulation time is broken up into calculation segments. Multiple solver iterations can occur per substep, per frame. Substeps are most useful with fast-moving objects with quick collisions, which might be missed if only calculated once per frame. You can set the number of substeps that your Maya Nucleus solver is using with the Substeps attribute in the Solver Attributes section of the nucleus Attribute Editor tab.
For more information on these attributes, see Solver Attributes and Quality Settings.
You can use collision layers to organize collisions between multiple objects that share the same Maya Nucleus solver. With the Collision Layer attribute in the nClothShape and nParticleShape Attribute Editor tab, you can specify in which collision layer an nCloth or nParticle object resides. nCloth and nParticle objects on the same collision layer collide normally. However, when Nucleus objects are on different layers, the objects on lower value layers will have priority over objects on higher value layers. For example, an nCloth object on collision layer 0.0 will push an nCloth object on collision layer 1.0, which in turn will push the nCloth object on collision layer 2.0. This collision priority occurs in the range set by the Collision Layer Range attribute in the nucleus Attribute Editor tab.
You can set the Collision Layer Range to specify how close two Nucleus objects must be in order for them to collide. If the differential between the Collision Layer values for the two objects is less than the Collision Layer Range, the objects can collide. For example, if object A has a Collision Layer value of 2 and object B has a Collision Layer value of 5, then the differential between their Collision Layer values is 3. Therefore, they can only collide when the Collision Layer Range value is less than 3.
For more information on using collision layers, see Setting collision layers.