Package net.citizensnpcs.api.ai.flocking
Class AlignmentBehavior
java.lang.Object
net.citizensnpcs.api.ai.flocking.AlignmentBehavior
- All Implemented Interfaces:
FlockBehavior
Implements alignment flocking with a particular weight i.e. steering a flock of NPCs in line with each other.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetVector
(NPC npc, Collection<NPC> nearby) Returns the displacement vector to be combined with otherFlockBehavior
vectors by aFlocker
.
-
Constructor Details
-
AlignmentBehavior
public AlignmentBehavior(double weight)
-
-
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
-