// setup cube geometry
Box box = new Box(1,1,1);
Body b1 = new Body("default", box);
// select a point (5,1,0) and the raydirection (-1,0,0)
Vector3 point = new Vector3(2, 5, 9);
Vector3 direction = new Vector3(0.5,0.5,0.5).sub(point);
// do the raycast
double lambda = raycast.run(box, null, point, direction, new Vector3(), new Vector3(), 0, envelope, epsilon, false );
// calculate the point
Vector3 p = point.add(direction.multiply(lambda));
// expected point
Vector3 e = new Vector3(0.5,0.5,0.5);
// the hitpoint must be within the envelope
assertTrue( p.sub(e).norm() < envelope+epsilon);
}