use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class Trajectory method multiply.
@SuppressWarnings("DuplicatedCode")
default Trajectory multiply(double xMultiplier, double yMultiplier, double zMultiplier) {
Function<PointXYZ, PointXYZ> nextMarkerFunction = InternalTrajectoryUtils.nextMarkerFunction(this);
Function<PointXYZ, Boolean> isDoneFunction = InternalTrajectoryUtils.isDoneFunction(this);
Function<PointXYZ, Double> speedFunction = InternalTrajectoryUtils.speedFunction(this);
Supplier<String> _toString = this::toString;
PointXYZ mult = new PointXYZ(xMultiplier, yMultiplier, Angle.fromDeg(zMultiplier));
return new Trajectory() {
@Override
public PointXYZ nextMarker(PointXYZ current) {
return nextMarkerFunction.apply(current.multiply(mult)).multiply(mult);
}
@Override
public boolean isDone(PointXYZ current) {
return isDoneFunction.apply(current.multiply(mult));
}
@Override
public double speed(PointXYZ current) {
return speedFunction.apply(current.multiply(mult));
}
@Override
public String toString() {
return _toString.get();
}
};
}
use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class LinearTrajectoryBuilder method goTo.
/**
* Go to a specific point.
*
* @param target the target point.
*/
public LinearTrajectoryBuilder goTo(PointXYZ target) {
trajectories.add(new LinearTrajectory(target, speed, tolerance, angleTolerance));
last = target;
return this;
}
use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class TrajectoryBuilder method linearTo.
public TrajectoryBuilder linearTo(PointXYZ target, double speed) {
trajectories.add(new LinearTrajectory(target, speed, tolerance, angleTolerance));
lastPoint = target;
return this;
}
use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class AngleSplineTrajectory method nextMarker.
@Override
public PointXYZ nextMarker(PointXYZ current) {
double x = current.x() + step;
PointXY interpolatedPoint = spline.interpolate(x);
Angle interpolatedAngle = angleSpline.getAngleTarget(x);
return interpolatedPoint.withHeading(interpolatedAngle);
}
use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class AbstractTrajectory method nextMarker.
@Override
public PointXYZ nextMarker(PointXYZ current) {
current = applyModifiers(current, nextMarkerInputModifiers);
PointXYZ nextMarker = abstractNextMarker(current);
nextMarker = applyModifiers(nextMarker, nextMarkerOutputModifiers);
return nextMarker;
}
Aggregations