java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.RRayCast
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
A ray cast with an
RVec3 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, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, targetVaOrZero, toString, va
-
Constructor Details
-
RRayCast
public RRayCast(double xx, double yy, double zz, float dx, float dy, float dz) Instantiate a ray cast with the specified endpoints.- Parameters:
xx- the desired X coordinate of the start locationyy- the desired Y coordinate of the start locationzz- the desired Z coordinate of the start locationdx- the X component of the end offset from the startdy- the Y component of the end offset from the startdz- the Z component of the end offset from the start
-
RRayCast
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
-