Interface ConstLinearCurve
- All Superinterfaces:
AutoCloseable,Comparable<JoltPhysicsObject>,ConstJoltPhysicsObject
- All Known Implementing Classes:
LinearCurve
Read-only access to a
LinearCurve. (native type:
const LinearCurve)-
Method Summary
Modifier and TypeMethodDescriptionintCount the points in the curve.floatgetMaxX()Return the highest X value.floatgetMinX()Return the lowest X value.floatgetPointX(int pointIndex) Return the X value of the specified point.floatgetPointY(int pointIndex) Return the Y value of the specified point.floatgetValue(float x) Return the Y value for the specified X.voidsaveBinaryState(StreamOut stream) Write the curve to the specified stream.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
countPoints
int countPoints()Count the points in the curve. The curve is unaffected.- Returns:
- the count (≥0)
-
getMaxX
float getMaxX()Return the highest X value. The curve is unaffected.- Returns:
- the highest X value
-
getMinX
float getMinX()Return the lowest X value. The curve is unaffected.- Returns:
- the lowest X value
-
getPointX
float getPointX(int pointIndex) Return the X value of the specified point. The curve is unaffected.- Parameters:
pointIndex- the index of the point (≥0)- Returns:
- the point's X value
-
getPointY
float getPointY(int pointIndex) Return the Y value of the specified point. The curve is unaffected.- Parameters:
pointIndex- the index of the point (≥0)- Returns:
- the point's Y value
-
getValue
float getValue(float x) Return the Y value for the specified X. The curve is unaffected.- Parameters:
x- the input X value- Returns:
- the interpolated Y value
-
saveBinaryState
Write the curve to the specified stream. The curve is unaffected.- Parameters:
stream- where to write objects (notnull)
-