Package com.github.stephengold.joltjni
Class PathConstraintPath
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.PathConstraintPath
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstPathConstraintPath,ConstSerializableObject,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
PathConstraintPathHermite
The path for a path constraint.
-
Method Summary
Modifier and TypeMethodDescriptionfloatgetClosestPoint(Vec3Arg location, float fractionHint) Return the path amount of the location on the path that's closest to the specified location.floatReturn the path amount of the end of the path.voidgetPointOnPath(float amount, Vec3 storeLocation, Vec3 storeTangent, Vec3 storeNormal, Vec3 storeBinormal) Calculate the location, normal, and binormal of the location on the path with the specified path amount.intCount the active references to the nativePathConstraintPath.booleanTest whether the path is looping.voidsaveBinaryState(StreamOut stream) Save the path to the specified binary stream.voidMark the nativePathConstraintPathas embedded.voidsetIsLooping(boolean setting) Alter whether the path is looping.protected final voidsetVirtualAddressAsCoOwner(long pathVa) Assign a native object (assuming there's none already assigned) and designate the JVM object as a co-owner.static PathResultsRestoreFromBinaryState(StreamIn stream) Read a path from the specified binary stream.toRef()Create a counted reference to the nativePathConstraintPath.Methods inherited from class com.github.stephengold.joltjni.SerializableObject
getRttiMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRtti
-
Method Details
-
setIsLooping
public void setIsLooping(boolean setting) Alter whether the path is looping.- Parameters:
setting-truefor looping, orfalsefor no looping (default=false)
-
sRestoreFromBinaryState
Read a path from the specified binary stream.- Parameters:
stream- where to read objects (not null)- Returns:
- a new object
-
setVirtualAddressAsCoOwner
protected final void setVirtualAddressAsCoOwner(long pathVa) Assign a native object (assuming there's none already assigned) and designate the JVM object as a co-owner.- Parameters:
pathVa- the virtual address of the native object to assign (not zero)
-
getClosestPoint
Return the path amount of the location on the path that's closest to the specified location. The path is unaffected.- Specified by:
getClosestPointin interfaceConstPathConstraintPath- Parameters:
location- the input location (in system coordinates, not null, unaffected)fractionHint- where to start searching- Returns:
- the path amount (≥0)
-
getPathMaxFraction
public float getPathMaxFraction()Return the path amount of the end of the path. The path is unaffected.- Specified by:
getPathMaxFractionin interfaceConstPathConstraintPath- Returns:
- the path amount (≥0)
-
getPointOnPath
public void getPointOnPath(float amount, Vec3 storeLocation, Vec3 storeTangent, Vec3 storeNormal, Vec3 storeBinormal) Calculate the location, normal, and binormal of the location on the path with the specified path amount. The path is unaffected.- Specified by:
getPointOnPathin interfaceConstPathConstraintPath- Parameters:
amount- the path amount (≥0)storeLocation- storage for the location (in system coordinates)storeTangent- storage for the tangent direction (in system coordinates)storeNormal- storage for the normal direction (in system coordinates)storeBinormal- storage for the binormal direction (in system coordinates)
-
isLooping
public boolean isLooping()Test whether the path is looping. The path is unaffected.- Specified by:
isLoopingin interfaceConstPathConstraintPath- Returns:
trueif looping, otherwisefalse
-
saveBinaryState
Save the path to the specified binary stream. The path is unaffected.- Specified by:
saveBinaryStatein interfaceConstPathConstraintPath- Parameters:
stream- the stream to write to (not null)
-
getRefCount
public int getRefCount()Count the active references to the nativePathConstraintPath. The path is unaffected.- Specified by:
getRefCountin interfaceRefTarget- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativePathConstraintPathas embedded.- Specified by:
setEmbeddedin interfaceRefTarget
-
toRef
Create a counted reference to the nativePathConstraintPath.
-