Class KaijuSeparationMovement
Separation steering behaviour.
Inherited Members
Namespace: KaijuSolutions.Agents.Movement
Syntax
public class KaijuSeparationMovement : KaijuAreaMovement
Constructors
KaijuSeparationMovement(KaijuAgent, Single, Single, ICollection<UInt32>, Single)
Create a separation movement.
Declaration
public KaijuSeparationMovement(KaijuAgent agent, float distance = 10F, float coefficient = 10F, ICollection<uint> identifiers = null, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this is assigned to. |
| System.Single | distance | The distance to avoid other KaijuAgents from. |
| System.Single | coefficient | The coefficient to use for inverse square law separation. Zero will use linear separation. |
| System.Collections.Generic.ICollection<System.UInt32> | identifiers | What types of KaijuAgents to avoid. |
| System.Single | weight | The weight of this KaijuMovement. |
Fields
DefaultCoefficient
The default Coefficient for separation movements.
Declaration
public const float DefaultCoefficient = 10F
Field Value
| Type | Description |
|---|---|
| System.Single |
DefaultDistance
The default Distance for separation movements.
Declaration
public const float DefaultDistance = 10F
Field Value
| Type | Description |
|---|---|
| System.Single |
Properties
Coefficient
The coefficient to use for inverse square law separation. Zero will use linear separation.
Declaration
public float Coefficient { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Interacting
The KaijuAgents currently detected this movement is moving in relation to.
Declaration
public IReadOnlyCollection<KaijuAgent> Interacting { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<KaijuAgent> |
Methods
EditorRenderVisualizations(Vector3)
Render the visualization of the KaijuMovement. The position of the Agent.
Declaration
protected override void EditorRenderVisualizations(Vector3 position)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position |
Overrides
EditorVisualizationColor()
Get the color for visualizations.
Declaration
protected override Color EditorVisualizationColor()
Returns
| Type | Description |
|---|---|
| Color | The color for visualizations |
Overrides
Get(KaijuAgent, Single, Single, ICollection<UInt32>, Single)
Get a separation movement.
Declaration
public static KaijuSeparationMovement Get(KaijuAgent agent, float distance = 10F, float coefficient = 10F, ICollection<uint> identifiers = null, float weight = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuAgent | agent | The KaijuAgent this is assigned to. |
| System.Single | distance | The distance to avoid other KaijuAgents from. |
| System.Single | coefficient | The coefficient to use for inverse square law separation. Zero will use linear separation. |
| System.Collections.Generic.ICollection<System.UInt32> | identifiers | What types of KaijuAgents to avoid. |
| System.Single | weight | The weight of this KaijuMovement. |
Returns
| Type | Description |
|---|---|
| KaijuSeparationMovement | Get a separation movement for the KaijuAgent. |
Move(Vector2, Single)
Get the KaijuMovement.
Declaration
public override Vector2 Move(Vector2 position, float delta)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | The position of the Agent. |
| System.Single | delta | The time step. |
Returns
| Type | Description |
|---|---|
| Vector2 | The calculated move vector. |
Overrides
Reset()
Perform any needed reset operations.
Declaration
protected override void Reset()