Interface PointNInt<P extends PointNInt<P,R>, R extends com.github.tommyettinger.crux.PointN<?>>
- Type Parameters:
P- should be the subclassing type itselfR- should be a wildcard-generic type for a sub-interface ofPointN, such asPoint3<?>
- All Superinterfaces:
com.github.tommyettinger.crux.PointN<P>, com.github.tommyettinger.crux.PointNInt<P,R>
public interface PointNInt<P extends PointNInt<P,R>, R extends com.github.tommyettinger.crux.PointN<?>>
extends com.github.tommyettinger.crux.PointNInt<P,R>
Groups functionality common to points with int components, in any dimension.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanintget(int index) Gets the component at the specified index.default Pinterpolate(R target, float alpha, com.github.tommyettinger.digital.Interpolations.Interpolator interpolation) Callslerp(PointN, float)with the alpha determined by the giveninterpolation.Linear-interpolates from this point toward target, moving a distance proportional to alpha and changing this point in-place if possible.setAt(int index, int value) Sets the component at the specified index to the specified value.Methods inherited from interface com.github.tommyettinger.crux.PointN
add, cpy, div, divide, dst, dst2, isUnit, isUnit, isZero, isZero, len, len2, minus, mutable, nor, plus, rank, scl, set, setZero, sub, times
-
Method Details
-
floatingPoint
-
get
int get(int index) Gets the component at the specified index. Kotlin-compatible using square-bracket indexing. -
setAt
Sets the component at the specified index to the specified value. -
lerp
Linear-interpolates from this point toward target, moving a distance proportional to alpha and changing this point in-place if possible. If this point is notPointN.mutable(), this will return a new or pooled point. The alpha is expected to be in the 0 to 1 range, inclusive.- Specified by:
lerpin interfacecom.github.tommyettinger.crux.PointNInt<P extends PointNInt<P,R>, R extends com.github.tommyettinger.crux.PointN<?>> - Parameters:
target- any point with the same dimension to move towardalpha- between 0 and 1, inclusive- Returns:
- this point after modifications, if possible, or a new PointNInt if this is immutable
-
interpolate
default P interpolate(R target, float alpha, com.github.tommyettinger.digital.Interpolations.Interpolator interpolation) Callslerp(PointN, float)with the alpha determined by the giveninterpolation. Simply returnslerp(target, interpolation.apply(alpha)).- Parameters:
target- any point with the same dimension to move towardalpha- between 0 and 1, inclusiveinterpolation- an Interpolator from digital, such asInterpolations.smooth- Returns:
- this point after modifications, if possible, or a new PointNInt if this is immutable
-