Class AligningSteeringAlgorithm
- java.lang.Object
-
- org.arakhne.afc.agentmotion.steering.AligningSteeringAlgorithm
-
- All Implemented Interfaces:
Serializable,Cloneable,AligningMotionAlgorithm
public class AligningSteeringAlgorithm extends Object implements AligningMotionAlgorithm, Serializable, Cloneable
Agent is changing its oriented for being align to the target vector.This algorithm uses accelerations.
- 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 intapproximationFactorApproximation factor.protected doubledecelerationAngleAngle to the target under which the agent could decelerate.protected doublestopAngleAngle to the target under which the agent could stop.
-
Constructor Summary
Constructors Constructor Description AligningSteeringAlgorithm(double stopAngle, double decelerationAngle, int approximationFactor)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecalculate(Vector2D<?,?> orientation, double angularSpeed, double maxAngularAcceleration, Vector2D<?,?> target)Calculate the rotation for being aligned to the target vector.AligningSteeringAlgorithmclone()Clone this algorithm.
-
-
-
Field Detail
-
stopAngle
protected final double stopAngle
Angle to the target under which the agent could stop.
-
decelerationAngle
protected final double decelerationAngle
Angle to the target under which the agent could decelerate.
-
approximationFactor
protected final int approximationFactor
Approximation factor.
-
-
Constructor Detail
-
AligningSteeringAlgorithm
public AligningSteeringAlgorithm(double stopAngle, double decelerationAngle, int approximationFactor)Constructor.- Parameters:
stopAngle- the angle to the target under which the agent could stop.decelerationAngle- the angle the target under which the agent could decelerate.approximationFactor- the factor used for approximate the deceleration. It must be greater than 1.
-
-
Method Detail
-
clone
@Pure public AligningSteeringAlgorithm clone()
Description copied from interface:AligningMotionAlgorithmClone this algorithm.- Specified by:
clonein interfaceAligningMotionAlgorithm- Overrides:
clonein classObject- Returns:
- the clone.
-
calculate
public double calculate(Vector2D<?,?> orientation, double angularSpeed, double maxAngularAcceleration, Vector2D<?,?> target)
Description copied from interface:AligningMotionAlgorithmCalculate the rotation for being aligned to the target vector.- Specified by:
calculatein interfaceAligningMotionAlgorithm- Parameters:
orientation- is the current orientation of the entity.angularSpeed- is the current angular speed of the entity.maxAngularAcceleration- is the maximal angular speed or acceleration of the entity.target- is the vector to match.- Returns:
- the agent motion.
-
-