java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.RShapeCast
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A shape cast with an
RVec3
start location.-
Constructor Summary
ConstructorsConstructorDescriptionRShapeCast
(ConstShape shape, Vec3Arg scale, RMat44Arg comStart, Vec3Arg offset) Instantiate a shape cast with the specified parameters.RShapeCast
(ConstShape shape, Vec3Arg scale, RMat44Arg comStart, Vec3Arg offset, ConstAaBox wsBounds) Instantiate a shape cast with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionCopy the starting center of mass.Copy the direction.getPointOnRay
(float fraction) Return a point on the ray with the specified fraction.getShape()
Access the shape.static RShapeCast
sFromWorldTransform
(ConstShape shape, Vec3Arg scale, RMat44Arg worldTransform, Vec3Arg direction) Create a shape cast using a world transform instead of a center-of-mass transform.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
RShapeCast
Instantiate a shape cast with the specified parameters.- Parameters:
shape
- the shape to use (not null, unaffected)scale
- the scale vector to use (not null, unaffected)comStart
- the desired start position (not null, unaffected)offset
- the desired end offset from the start (not null, unaffected)
-
RShapeCast
public RShapeCast(ConstShape shape, Vec3Arg scale, RMat44Arg comStart, Vec3Arg offset, ConstAaBox wsBounds) Instantiate a shape cast with the specified parameters.- Parameters:
shape
- the shape to use (not null, unaffected)scale
- the scale vector to use (not null, unaffected)comStart
- the desired start position (not null, unaffected)offset
- the desired end offset from the start (not null, unaffected)wsBounds
- the world-space bounds to use (not null, unaffected)
-
-
Method Details
-
sFromWorldTransform
public static RShapeCast sFromWorldTransform(ConstShape shape, Vec3Arg scale, RMat44Arg worldTransform, Vec3Arg direction) Create a shape cast using a world transform instead of a center-of-mass transform.- Parameters:
shape
- the shape to use (not null, unaffected)scale
- the scale to apply (not null, unaffected)worldTransform
- the world transform to use (not null, unaffected)direction
- the direction of casting (not null, unaffected)- Returns:
- a new object
-
getCenterOfMassStart
Copy the starting center of mass. The shape cast is unaffected. (native attribute: mCenterOfMassStart)- Returns:
- a new location vector
-
getDirection
Copy the direction. The shape cast is unaffected. (native attribute: mDirection)- Returns:
- a new direction vector
-
getPointOnRay
Return a point on the ray with the specified fraction. The shape cast is unaffected.- Parameters:
fraction
- (0→start of ray, 1→end of ray)- Returns:
- a new location vector
-
getShape
Access the shape. The shape cast is unaffected. (native attribute: mShape)- Returns:
- a new JVM object with the pre-existing native object assigned
-