Class FacingAlgorithm
- java.lang.Object
-
- org.arakhne.afc.agentmotion.common.FacingAlgorithm
-
- All Implemented Interfaces:
Serializable
,Cloneable
,FacingMotionAlgorithm
public class FacingAlgorithm extends Object implements FacingMotionAlgorithm, Serializable, Cloneable
Agent is changing its orientation for facing the target point.This algorithm uses speeds or accelerations depending of the seeking algorithm to delegate to.
- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:51
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- agentmotion
-
-
Field Summary
Fields Modifier and Type Field Description protected AligningMotionAlgorithm
aligning
Aligning algorithm to delegate to.
-
Constructor Summary
Constructors Constructor Description FacingAlgorithm(AligningMotionAlgorithm aligning)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
calculate(Point2D<?,?> position, Vector2D<?,?> orientation, double angularSpeed, double maxAngular, Point2D<?,?> target)
Calculate the rotation for facing the target point.FacingAlgorithm
clone()
Clone this algorithm.boolean
equals(Object obj)
int
hashCode()
-
-
-
Field Detail
-
aligning
protected final AligningMotionAlgorithm aligning
Aligning algorithm to delegate to.
-
-
Constructor Detail
-
FacingAlgorithm
public FacingAlgorithm(AligningMotionAlgorithm aligning)
Constructor.- Parameters:
aligning
- the aligning algorithm to delegate to.
-
-
Method Detail
-
clone
@Pure public FacingAlgorithm clone()
Description copied from interface:FacingMotionAlgorithm
Clone this algorithm.- Specified by:
clone
in interfaceFacingMotionAlgorithm
- Overrides:
clone
in classObject
- Returns:
- the clone.
-
calculate
public double calculate(Point2D<?,?> position, Vector2D<?,?> orientation, double angularSpeed, double maxAngular, Point2D<?,?> target)
Description copied from interface:FacingMotionAlgorithm
Calculate the rotation for facing the target point.- Specified by:
calculate
in interfaceFacingMotionAlgorithm
- Parameters:
position
- is the current position of the entity.orientation
- is the current orientation of the entity.angularSpeed
- is the current angular speed of the entity.maxAngular
- is the maximal angular speed or acceleration of the entity.target
- is the point to face to.- Returns:
- the agent motion.
-
-