Class PhysicsRayTestResult

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

public class PhysicsRayTestResult extends Object
Contains the results of a PhysicsSpace rayTest. Read data only in callback method, object is reused
  • Constructor Details

    • PhysicsRayTestResult

      public PhysicsRayTestResult()
    • PhysicsRayTestResult

      public PhysicsRayTestResult(PhysicsCollisionObject collisionObject, Vector3f hitNormalLocal, float hitFraction, boolean normalInWorldSpace)
  • Method Details

    • getCollisionObject

      public PhysicsCollisionObject getCollisionObject()
      Returns:
      the PhysicsObject the ray collided with
    • getHitNormalLocal

      public Vector3f getHitNormalLocal()
      Returns:
      the normal of the collision in the objects local space
    • getHitFraction

      public float getHitFraction()
      The hitFraction is the fraction of the ray length (yeah, I know) at which the collision occurred. If e.g. the ray test was from 0,0,0 to 0,6,0 and the hitFraction is 0.5 then the collision occurred at 0,3,0
      Returns:
      the hitFraction
    • isNormalInWorldSpace

      public boolean isNormalInWorldSpace()
      Returns:
      the normalInWorldSpace
    • fill

      public void fill(PhysicsCollisionObject collisionObject, Vector3f hitNormalLocal, float hitFraction, boolean normalInWorldSpace)