Interface ConstTransformedShape
- All Superinterfaces:
Comparable<JoltPhysicsObject>
,ConstJoltPhysicsObject
- All Known Implementing Classes:
TransformedShape
Read-only access to a
TransformedShape
. (native type: const
TransformedShape)-
Method Summary
Modifier and TypeMethodDescriptionboolean
castRay
(RRayCast raycast, RayCastResult storeResult) Cast a ray and find the closest hit.void
castRay
(RRayCast raycast, RayCastSettings settings, CastRayCollector collector, ShapeFilter shapeFilter) Cast a narrow-phase ray and collect any hits.void
castShape
(RShapeCast shapeCast, ShapeCastSettings settings, RVec3Arg base, CastShapeCollector collector, ShapeFilter shapeFilter) Cast a narrow-phase shape and collect any hits.void
collectTransformedShapes
(ConstAaBox box, TransformedShapeCollector collector, ShapeFilter shapeFilter) Collect transformed shapes for all leaf shapes of the current shape that collide with the specified bounding box.void
collidePoint
(RVec3Arg point, CollidePointCollector collector, ShapeFilter shapeFilter) Collect collisions with the specified point.void
collideShape
(ConstShape testShape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector) Collect collisions with the specified shape.void
collideShape
(ConstShape testShape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector, ShapeFilter shapeFilter) Collect collisions with the specified shape.void
copyDebugTriangles
(FloatBuffer storeBuffer) Copy the vertex coordinates of the shape's debug mesh to the specified buffer.int
Count the triangles in the shape's debug mesh.Access the underlying coordinate transform.getShape()
Access the underlying collision shape.Copy the location of the center of mass.Copy the rotation of the shape.Copy the scale factors of the shape.void
getSupportingFace
(int subShapeId, Vec3Arg direction, RVec3Arg base, SupportingFace storeFace) Get the vertices of the face that provides support in the specified direction.int
getTrianglesNext
(GetTrianglesContext storeContext, int maxTriangles, FloatBuffer storeVertices) Collect triangles for debug visualization.void
getTrianglesStart
(GetTrianglesContext storeContext, ConstAaBox box, RVec3Arg base) Prepare to collect triangles in the specified box for debug visualization.Return the bounding box including convex radius.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
castRay
Cast a ray and find the closest hit. The shape is unaffected.- Parameters:
raycast
- the test ray (not null, unaffected)storeResult
- storage for the result (not null, modified)- Returns:
true
if a hit was found, otherwisefalse
-
castRay
void castRay(RRayCast raycast, RayCastSettings settings, CastRayCollector collector, ShapeFilter shapeFilter) Cast a narrow-phase ray and collect any hits. The shape is unaffected.- Parameters:
raycast
- the test ray (not null, unaffected)settings
- the raycast configuration options to use (not null, unaffected)collector
- the hit collector to use (not null)shapeFilter
- the shape filter to apply (not null, unaffected)
-
castShape
void castShape(RShapeCast shapeCast, ShapeCastSettings settings, RVec3Arg base, CastShapeCollector collector, ShapeFilter shapeFilter) Cast a narrow-phase shape and collect any hits. The shape is unaffected.- Parameters:
shapeCast
- the desired shape cast (not null, unaffected)settings
- the collision settings to use (not null, unaffected)base
- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)collector
- the hit collector to use (not null)shapeFilter
- the shape filter to apply (not null, unaffected)
-
collectTransformedShapes
void collectTransformedShapes(ConstAaBox box, TransformedShapeCollector collector, ShapeFilter shapeFilter) Collect transformed shapes for all leaf shapes of the current shape that collide with the specified bounding box. The shape is unaffected.- Parameters:
box
- the region of interest (in system coordinates)collector
- the hit collector to use (not null)shapeFilter
- the shape filter to apply (not null, unaffected)
-
collidePoint
Collect collisions with the specified point. The shape is unaffected.- Parameters:
point
- the location of the point to test (not null, unaffected)collector
- the hit collector to use (not null)shapeFilter
- the shape filter to apply (not null, unaffected)
-
collideShape
void collideShape(ConstShape testShape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector) Collect collisions with the specified shape. The shape is unaffected.- Parameters:
testShape
- the shape to test (not null, unaffected)shapeScale
- the scaling vector for the test shape (not null, unaffected)comTransform
- the coordinate transform to apply to the test shape's center of mass (not null, unaffected)settings
- the collision settings to use (not null, unaffected)base
- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)collector
- the hit collector to use (not null)
-
collideShape
void collideShape(ConstShape testShape, Vec3Arg shapeScale, RMat44Arg comTransform, CollideShapeSettings settings, RVec3Arg base, CollideShapeCollector collector, ShapeFilter shapeFilter) Collect collisions with the specified shape. The shape is unaffected.- Parameters:
testShape
- the shape to test (not null, unaffected)shapeScale
- the scaling vector for the test shape (not null, unaffected)comTransform
- the coordinate transform to apply to the test shape's center of mass (not null, unaffected)settings
- the collision settings to use (not null, unaffected)base
- the base location for reporting hits (not null, unaffected, (0,0,0)→world coordinates)collector
- the hit collector to use (not null)shapeFilter
- the shape filter to apply (not null, unaffected)
-
copyDebugTriangles
Copy the vertex coordinates of the shape's debug mesh to the specified buffer. The shape is unaffected.- Parameters:
storeBuffer
- the buffer to fill with vertex coordinates (not null, modified)
-
countDebugTriangles
int countDebugTriangles()Count the triangles in the shape's debug mesh. The shape is unaffected.- Returns:
- the count (>0)
-
getCenterOfMassTransform
RMat44Arg getCenterOfMassTransform()Access the underlying coordinate transform. The shape is unaffected.- Returns:
- a new JVM object with the pre-existing native object assigned
-
getShape
ConstShape getShape()Access the underlying collision shape. The current instance is unaffected.- Returns:
- a new JVM object with the pre-existing native object assigned
-
getShapePositionCom
RVec3 getShapePositionCom()Copy the location of the center of mass. The shape is unaffected.- Returns:
- a new object
-
getShapeRotation
Quat getShapeRotation()Copy the rotation of the shape. The shape is unaffected.- Returns:
- a new object
-
getShapeScale
Float3 getShapeScale()Copy the scale factors of the shape. The shape is unaffected.- Returns:
- a new object
-
getSupportingFace
Get the vertices of the face that provides support in the specified direction. The shape is unaffected.- Parameters:
subShapeId
- which sub-shape to usedirection
- the test direction (in world coordinates, not null, unaffected)base
- the base location for reporting face vertices (not null, unaffected, (0,0,0)→world coordinates)storeFace
- storage for face vertices (not null)
-
getTrianglesNext
Collect triangles for debug visualization. The shape is unaffected.- Parameters:
storeContext
- storage for communication withgetTrianglesStart()
maxTriangles
- the maximum number of triangles to collectstoreVertices
- storage for triangle vertices- Returns:
- the number of triangles collected, or 0 if no more triangles are available
-
getTrianglesStart
Prepare to collect triangles in the specified box for debug visualization. The shape is unaffected.- Parameters:
storeContext
- storage for communication withgetTrianglesNext()
box
- the region of interest (in system coordinates, not null, unaffected)base
- the base location for reporting triangle vertices (not null, unaffected, (0,0,0)→world coordinates)
-
getWorldSpaceBounds
AaBox getWorldSpaceBounds()Return the bounding box including convex radius. The shape is unaffected.- Returns:
- a new, mutable box (in system coordinates)
-