Class PhysicsSweepTestResult

java.lang.Object
com.jme3.bullet.collision.PhysicsSweepTestResult

public final class PhysicsSweepTestResult extends Object
Represent the results of a Bullet sweep test.
  • Field Details

    • logger

      public static final Logger logger
      message logger for this class
  • Method Details

    • getCollisionObject

      public PhysicsCollisionObject getCollisionObject()
      Access the collision object that was hit.
      Returns:
      the pre-existing instance (not null)
    • getHitFraction

      public float getHitFraction()
      Read the fraction of the way between the transforms (from=0, to=1, ≥0, ≤1)
      Returns:
      fraction (from=0, to=1, ≥0, ≤1)
    • getHitNormalLocal

      public com.jme3.math.Vector3f getHitNormalLocal(com.jme3.math.Vector3f storeResult)
      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()
      Read 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()
      Read 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