Package net.citizensnpcs.api.ai.flocking
Class SeparationBehavior
java.lang.Object
net.citizensnpcs.api.ai.flocking.SeparationBehavior
- All Implemented Interfaces:
FlockBehavior
Implements separation flocking with a particular weight i.e. steering a flock of NPCs away from each other.
- See Also:
-
Constructor Summary
ConstructorDescriptionSeparationBehavior
(double weight) SeparationBehavior
(double weight, double separation) -
Method Summary
Modifier and TypeMethodDescriptiongetVector
(NPC npc, Collection<NPC> nearby) Returns the displacement vector to be combined with otherFlockBehavior
vectors by aFlocker
.
-
Constructor Details
-
SeparationBehavior
public SeparationBehavior(double weight) -
SeparationBehavior
public SeparationBehavior(double weight, double separation)
-
-
Method Details
-
getVector
Description copied from interface:FlockBehavior
Returns the displacement vector to be combined with otherFlockBehavior
vectors by aFlocker
.- Specified by:
getVector
in interfaceFlockBehavior
- Parameters:
nearby
- the set of NPCs to consider for flocking purposes- Returns:
- the displacement
Vector
-