Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Atoms has a behaviour module called

To synchronize agents you can use the "sync" modules.

THis module

It is

usefull

particularly useful with horse/rider setup or any other setup where you need to

syncronize

synchronize or constraint agents

of

from different

agents group

groups.

Let's see an example of a horse/rider setup.


Asset preparation

Since atoms syncronize the agents the animation clips used by the 2 agents must by sincronyzed during the creatin of the fbx from the animation scene.Usually the horse skeleton has an extra joint and the rig of the rider is constrained to this joint or your agents will be synced by Atoms during the simulation, their animation clips should be synchronized before you export them to an animation clip file (i.e. Fbx).

A good practice is to add an extra joint to the horse and constrain the rider main pelvis to it. Alternatively you can bake the animation of the rider main pelvis and the copy this animation it to the horse extra joint.

Export the animation clip clips as usual and load them inside atoms Atoms alongside with also the their agent typetypes.


Set the agent group order

Create two agent groups with a layout module (i.e. grid

or paint

layout

module

) and a clip reader or state machine module. On the first agent group set the

horse as agent type

"agentType" to "horse", and on the second one set

the

it to "rider".

During the simulation Atoms

cumpute

computes sequentially the agent groups in the scene

, so

. In this case the agent

gorup with

group containing the horses

must

should be computed first

since is the driver agent. To

. In order to do that you

can

should select the horse agent group and then the rider agent group

and then

in this order. Then press the sync command from the Atoms shelf.

Image Modified

Or you can connect the messagge

Under the hood a connection is made between the "message" attribute of the horse

agent

group

to theĀ  parentAgentGroup message

and the "parentAgentGroup" attribute of the rider

agent

group.



Adding the sync module

The last ste step is to do is add the sync module to the rider agent group. This module copied for each agent some metadata from parent copies some metadatas from the parent to the child agents. It also override overrides the current layout module, so for this reason you need to set the rider in the agent type attribute of the sync module . The you mast set the parent joint "agentType" field to "rider". You must also set the "parentJoint" name (the driver joint) and the rider "joint" name (the driven joint). You can add also

Finally, you might as well add an offset and active activate the keepOffset checkbox to mantain maintain the child joint animation. If the keepOffset is off then the module applies a normal constriant constraint without offset. If you need to copie copy more metadametadatas, expand the "metadata attribute " list of the modules and add the metadata names you want copy from the parent agentagents.

Rewind the scene and you will see the riders constrained to the horses.