Package com.jme3.bullet.collision
Class PhysicsSweepTestResult
java.lang.Object
com.jme3.bullet.collision.PhysicsSweepTestResult
Represent the results of a Bullet sweep test.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionAccess the collision object that was hit.float
Return the fraction of the way between the transforms (from=0, to=1, ≥0, ≤1)getHitNormalLocal
(Vector3f storeResult) Copy the normal vector at the point of contact.int
Return the part index at the point of contact.int
Return the triangle index at the point of contact.
-
Field Details
-
logger
message logger for this class
-
-
Method Details
-
getCollisionObject
Access the collision object that was hit.- Returns:
- the pre-existing instance (not null)
-
getHitFraction
public float getHitFraction()Return the fraction of the way between the transforms (from=0, to=1, ≥0, ≤1)- Returns:
- fraction (from=0, to=1, ≥0, ≤1)
-
getHitNormalLocal
Copy the normal vector at the point of contact.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- a unit vector (in physics-space coordinates, either storeResult or a new vector, not null)
-
partIndex
public int partIndex()Return the part index at the point of contact.If shape that was hit is compound or convex, the index is undefined.
If the shape is a GImpactCollisionShape or MeshCollisionShape, the index identifies an IndexedMesh.
If the shape is a HeightfieldCollisionShape, the index identifies a grid row.
- Returns:
- the index of the collision-shape part (≥0) or -1 if undefined
-
triangleIndex
public int triangleIndex()Return the triangle index at the point of contact.If shape that was hit is convex, the index is undefined.
If shape is a CompoundCollisionShape, the index identifies a child shape.
If the shape is a GImpactCollisionShape or MeshCollisionShape, the index identifies a triangle in an IndexedMesh.
If the shape is a HeightfieldCollisionShape, the index indicates a grid column.
- Returns:
- the index of the collision-shape triangle (≥0) or -1 if undefined
-