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
ConstructorsConstructorDescriptionSeparationBehavior(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 otherFlockBehaviorvectors by aFlocker.
-
Constructor Details
-
SeparationBehavior
public SeparationBehavior(double weight) -
SeparationBehavior
public SeparationBehavior(double weight, double separation)
-
-
Method Details
-
getVector
Description copied from interface:FlockBehaviorReturns the displacement vector to be combined with otherFlockBehaviorvectors by aFlocker.- Specified by:
getVectorin interfaceFlockBehavior- Parameters:
nearby- the set of NPCs to consider for flocking purposes- Returns:
- the displacement
Vector
-