Package cz.fidentis.analyst.data.ray
Interface RayIntersection
- All Superinterfaces:
Comparable<RayIntersection>
,IPosition
,MeshPoint
,Serializable
- All Known Implementing Classes:
RayIntersectionImpl
A single ray intersection. The natural ordering sorts ray intersections
by their distance from the ray's origin (regardless on the direction, i.e.,
absolute values is taken into account). In case of the same absolute values
of the distances, an object with positive distance is preferred (is defined
as smaller) over the one with negative value.
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(RayIntersection other) double
Returns distance from the ray's origin to this ray intersection.Returns hit triangleboolean
Determines if the ray intersection is in the direction of the ray (direct hit) or i opposite direction (indirect hit)void
setDistance
(javax.vecmath.Point3d rayOrigin) Set the distance of the intersection point from the ray's origin.Methods inherited from interface cz.fidentis.analyst.data.mesh.MeshPoint
getCurvature, getNormal, getPosition, getTexCoord, setCurvature, setNormal, setPosition
-
Method Details
-
getDistance
double getDistance()Returns distance from the ray's origin to this ray intersection.- Returns:
- distance from the ray's origin to this ray intersection
-
getHitTriangle
MeshTriangle getHitTriangle()Returns hit triangle- Returns:
- hit triangle
-
isDirectHit
boolean isDirectHit()Determines if the ray intersection is in the direction of the ray (direct hit) or i opposite direction (indirect hit)- Returns:
true
if the hit is in the ray's direction
-
setDistance
void setDistance(javax.vecmath.Point3d rayOrigin) Set the distance of the intersection point from the ray's origin. If the intersection point lies in the opposite direction than ray's normal, then a negative distance is set.- Parameters:
rayOrigin
- The origin of the ray that has been used to compute this intersection
-
compareTo
- Specified by:
compareTo
in interfaceComparable<RayIntersection>
-