Package org.jbox2d.collision
Class RayCastOutput
java.lang.Object
org.jbox2d.collision.RayCastOutput
Ray-cast result data.
If an intersection is found, the hit position can be reconstructed as
p1 + fraction * (p2 - p1), where p1 and p2 come from
RayCastInput.
This object stores only the hit fraction and surface normal. It does not store the hit point directly.
https://www.iforce2d.net/b2dtut/raycasting- Author:
- Daniel Murphy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidset(RayCastOutput rayCastOutput) Copies all values from another ray-cast result.
-
Field Details
-
normal
Surface normal at the intersection point.This vector points away from the hit surface.
-
fraction
public float fractionFraction along the input ray where the intersection occurs.A value of
0is atp1; a value of1is atp2whenmaxFraction == 1.
-
-
Constructor Details
-
RayCastOutput
public RayCastOutput()Creates an empty ray-cast result.
-
-
Method Details
-
set
Copies all values from another ray-cast result.- Parameters:
rayCastOutput- The source result to copy from.
-