Package org.jbox2d.collision
Class RayCastInput
java.lang.Object
org.jbox2d.collision.RayCastInput
Ray-cast query input data.
A ray is a directed line segment used to test whether it intersects a fixture.
The ray starts at p1 and extends toward p2. The tested
segment is p1 + t * (p2 - p1) for 0 <= t <= maxFraction.
- Author:
- Daniel Murphy
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty ray-cast input.RayCastInput(Vec2 p1, Vec2 p2, float maxFraction) Creates an ray-cast input. -
Method Summary
Modifier and TypeMethodDescriptionvoidset(RayCastInput rayCastInput) Copies all values from another ray-cast input.
-
Field Details
-
p1
The start point of the ray. -
p2
The end point used to define the ray direction.The direction vector is
(p2 - p1). -
maxFraction
public float maxFractionThe maximum normalized distance along the ray to test for intersection.1tests the full segment fromp1top2; smaller values shorten the tested segment.
-
-
Constructor Details
-
RayCastInput
public RayCastInput()Creates an empty ray-cast input. -
RayCastInput
Creates an ray-cast input.- Parameters:
p1- The start point of the ray.p2- The end point used to define the ray direction.maxFraction- The maximum normalized distance along the ray to test for intersection.
-
-
Method Details
-
set
Copies all values from another ray-cast input.- Parameters:
rayCastInput- The source input to copy from.
-