Package com.jme3.bullet.collision
Class PhysicsRayTestResult
java.lang.Object
com.jme3.bullet.collision.PhysicsRayTestResult
Contains the results of a PhysicsSpace rayTest.
Read data only in callback method, object is reused
-
Constructor Summary
ConstructorDescriptionPhysicsRayTestResult
(PhysicsCollisionObject collisionObject, Vector3f hitNormalLocal, float hitFraction, boolean normalInWorldSpace) -
Method Summary
Modifier and TypeMethodDescriptionvoid
fill
(PhysicsCollisionObject collisionObject, Vector3f hitNormalLocal, float hitFraction, boolean normalInWorldSpace) float
The hitFraction is the fraction of the ray length (yeah, I know) at which the collision occurred.boolean
-
Constructor Details
-
PhysicsRayTestResult
public PhysicsRayTestResult() -
PhysicsRayTestResult
public PhysicsRayTestResult(PhysicsCollisionObject collisionObject, Vector3f hitNormalLocal, float hitFraction, boolean normalInWorldSpace)
-
-
Method Details
-
getCollisionObject
- Returns:
- the PhysicsObject the ray collided with
-
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)
-