Package com.solibri.geometry.primitive2d
Interface Ray2d
- All Known Subinterfaces:
MRay2d
public interface Ray2d
Read-only interface to handle 2-dimensional rays.
- Since:
- 9.10.2
-
Method Summary
Modifier and Type Method Description static Ray2dcreate(Vector2d origin, Vector2d direction)Returns a ray with the given origin and direction.static Ray2dcreate(Ray2d other)Returns a deep copy of the given ray.Vector2dgetDirection()Returns the direction of this ray.Vector2dgetOrigin()Returns the origin of this ray.Optional<MVector2d>intersect(Ray2d ray)Returns an optional containing the intersection point between the rays if present, an empty optional otherwise.booleanintersects(AABB2d aabb)Returns true if the ray intersects with the bounding rectangle, false otherwise.booleanintersects(Ray2d ray)Returns true if the rays intersect, false otherwise.
-
Method Details
-
create
Returns a deep copy of the given ray.- Parameters:
other- the other ray- Returns:
- a deep copy of the given ray
- Since:
- 9.10.2
-
create
Returns a ray with the given origin and direction.- Parameters:
origin- the origin of the raydirection- the direction of the ray- Returns:
- a ray with the given origin and direction
- Since:
- 9.10.2
-
getOrigin
Vector2d getOrigin()Returns the origin of this ray.- Returns:
- the origin of this ray
- Since:
- 9.10.2
-
getDirection
Vector2d getDirection()Returns the direction of this ray.- Returns:
- the direction of this ray
- Since:
- 9.10.2
-
intersects
Returns true if the rays intersect, false otherwise.- Parameters:
ray- the ray with which this ray is checked for intersection- Returns:
- true if the rays intersect, false otherwise
- Since:
- 9.10.2
-
intersect
Returns an optional containing the intersection point between the rays if present, an empty optional otherwise.- Parameters:
ray- the ray with which this ray is checked for intersection- Returns:
- an optional containing the intersection point between the rays if present, an empty optional otherwise
- Since:
- 9.10.2
-
intersects
Returns true if the ray intersects with the bounding rectangle, false otherwise.- Parameters:
aabb- the axis-aligned bounding rectangle with which this is checked for intersection- Returns:
- true if the ray intersects with the bounding rectangle, false otherwise
- Since:
- 9.10.2
-