Class RayIntersectionImpl
java.lang.Object
cz.fidentis.analyst.data.mesh.impl.MeshPointImpl
cz.fidentis.analyst.data.ray.impl.RayIntersectionImpl
- All Implemented Interfaces:
IPosition
,MeshPoint
,RayIntersection
,Serializable
,Comparable<RayIntersection>
The implementation of a ray intersection.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRayIntersectionImpl
(javax.vecmath.Point3d position, javax.vecmath.Vector3d normal, MeshTriangleImpl tri, boolean directHit) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
double
Returns distance from the ray's origin to this ray intersection.Returns hit triangleint
hashCode()
boolean
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 class cz.fidentis.analyst.data.mesh.impl.MeshPointImpl
getCurvature, getNormal, getPosition, getTexCoord, setCurvature, setNormal, setPosition, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface cz.fidentis.analyst.data.mesh.MeshPoint
getCurvature, getNormal, getPosition, getTexCoord, setCurvature, setNormal, setPosition
-
Constructor Details
-
RayIntersectionImpl
public RayIntersectionImpl(javax.vecmath.Point3d position, javax.vecmath.Vector3d normal, MeshTriangleImpl tri, boolean directHit) Constructor.- Parameters:
position
- Intersection position, must not benull
normal
- normal of MeshPointtri
- triangle with which the ray intersects. Must not benull
directHit
- determines whether theposition
is in the ray's direction- Throws:
IllegalArgumentException
- if some parameter is null
-
-
Method Details
-
getDistance
public double getDistance()Description copied from interface:RayIntersection
Returns distance from the ray's origin to this ray intersection.- Specified by:
getDistance
in interfaceRayIntersection
- Returns:
- distance from the ray's origin to this ray intersection
-
getHitTriangle
Description copied from interface:RayIntersection
Returns hit triangle- Specified by:
getHitTriangle
in interfaceRayIntersection
- Returns:
- hit triangle
-
isDirectHit
public boolean isDirectHit()Description copied from interface:RayIntersection
Determines if the ray intersection is in the direction of the ray (direct hit) or i opposite direction (indirect hit)- Specified by:
isDirectHit
in interfaceRayIntersection
- Returns:
true
if the hit is in the ray's direction
-
setDistance
public void setDistance(javax.vecmath.Point3d rayOrigin) Description copied from interface:RayIntersection
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.- Specified by:
setDistance
in interfaceRayIntersection
- Parameters:
rayOrigin
- The origin of the ray that has been used to compute this intersection
-
hashCode
public int hashCode()- Overrides:
hashCode
in classMeshPointImpl
-
equals
- Overrides:
equals
in classMeshPointImpl
-
compareTo
- Specified by:
compareTo
in interfaceComparable<RayIntersection>
- Specified by:
compareTo
in interfaceRayIntersection
-