front-end / back-end: AIMFormationCross
| FormationCross
inherits from: AIMFormation
| Formation
Source code available on GitHub.
This behaviour arranges the agent as part of a formation with the shape of a cross. You can find the source code in our GitHub repository.
Similar to our other formation behaviours that are based on AIMFormation
, Formation
respectively, the position is based on the properties of the base class. The formation grows automatically in-depth, while the last layer may be sparse if there might be not enough agents to fill the last layer appropriately.
The formation can be built in 2D as well as in 3D, as shown in Figure 1. You can switch between both modes using the Shape
property.
Figure 1: Shows the cross formation in 2D (planar) and 3D (spatial).
This component has got the following specific properties.
Property | Description |
---|---|
Shape | Defines if the formation should be built in 2D (planar) or 3D (spatial). |
UpVector | Defines the default axis for the width of the formation, i.e., you can flip the reference direction in which the formation is built. If set to [0,0,0], the XY-plane is used, and the Z-axis is up in case of a planar formation. For a spatial formation, the XZ-axis is used for width and depth, while the Y-axis is up and used for the height. |
In this formation, the agents are aligned along different axes. Hence, they are distributed equally among them. There might be not enough agents to cover all these positions to fill the last layer. Thus the last layer may be shorter than the others. This formation serves as an advanced example in addition to Formation Line to give you hints for writing a custom formation. Therefore, we published the source code in our GitHub repository.