| bug structure |
| action layers |
Maya particles are dumb. In fact, they are just mass points on which fields (such as gravity or vortex) can apply forces. Particles position in space is changed by these forces. As this is kind of dull, let's put some brain in the particles (I'll call them bugs from now on) and use the principles of behavioural animation to animate them - well, letting them animate themselves maybe the better term.
Behaviour of a bug can be divided into different layers [1].
Action Selection > Steering > Locomotion
Action Selection: "High level goals" - they are defined by you, the animator. What is the bug's motivation to move? Maybe you want them to reach the other side of a table. You have to set up a set of steering desires, bugs should follow, to accomplish this goal. Maybe you have got to combine or blend different steering desires, or change them over time. The node bbCombineForces helps you to do this.
Steering: Steering desires are the used to decompose the action selection goal into subgoals. Getting to the other side of the table is the main motivation, but bugs also don't want to collide with each other, stick together with the other bugs in the swarm, don't crash into obstacles etc.. bbSteeringDesire node let's you define such desires. It produces desired forces, which bugs may follow - depending on how the forces are combined (bbCombineForces).
Locomotion: This is, where it gets physical. After a desired force is computed (using the above nodes), bugs try to self apply the forces and move accordingly. In the current version of bRAINbUGZ, this is done using the Maya particle physical simulation engine. As this does not completly fit needs for behavioural animation, its output is modified using a runtime expression (bbClampSpeed).
| bug properties |
The following table shows you all the properties a bug has. As I wanted to use the Maya particles engine (particle cashing, emitters, fields - it was to tempting, to use all this features for behavioural animation, too), properties are not defined in one data structure, but in different nodes. The third column shows you where to change them.
| Property | Data Type | Description | Node |
| Mass | double | - bugs with different masses, but the same strength (indicated
through the maximum force) react differently on change of orientation
or speed - heavy bodies usually react slower than light ones |
particle |
| Position | MVector | - current position in world space | particle |
| Velocity | MVector | - current velocity - vector defines the direction the bug is heading (bugs are always aligned with their velocities) - vector length defines current bug speed |
particle |
| Maximum Force | double | - maximum force the bug can apply to itself -the bigger this value, the more strength the bug has, the faster it can change orientation or speed. |
bbSteeringDesire |
| Minimum Speed | double | - minimum speed the bug can take - setting a minimum speed can be useful, if you want to force the bugs not to stop |
particle (use bbClampSpeed) |
| Maximum Speed | double | - maximum speed the bug can take | particle (use bbClampSpeed) |
| [Diameter] | [todo] |