java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.RayCast
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A ray cast with a single-precision start location.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCopy the end offset.Copy the start location.getPointOnRay
(float fraction) Return a point on the ray with the specified fraction.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
RayCast
Instantiate a ray cast with the specified endpoints.- Parameters:
startLocation
- the desired start location (not null, unaffected)offset
- the desired end offset from the start (not null, unaffected)
-
-
Method Details
-
getDirection
Copy the end offset. The ray cast is unaffected. (native attribute: mDirection)- Returns:
- a new offset vector (relative to the start location)
-
getOrigin
Copy the start location. The ray cast is unaffected. (native attribute: mOrigin)- Returns:
- a new location vector
-
getPointOnRay
Return a point on the ray with the specified fraction. The ray cast is unaffected.- Parameters:
fraction
- (0→start of ray, 1→end of ray)- Returns:
- a new location vector
-