Record Class RayHit
java.lang.Object
java.lang.Record
com.marginallyclever.ro3.raypicking.RayHit
- Record Components:
target
- the MeshInstance that theRay
intersected.distance
- the distance from theRay
origin to the point of contact.normal
- the normal of theMesh
at the point of contact, in world space.point
- the point of contact in world space.
public record RayHit(MeshInstance target, double distance, javax.vecmath.Vector3d normal, javax.vecmath.Point3d point)
extends Record
A ray hit is a record of a ray hitting a
MeshInstance
at a certain distance.-
Constructor Summary
ConstructorsConstructorDescriptionRayHit
(MeshInstance target, double distance, javax.vecmath.Vector3d normal, javax.vecmath.Point3d point) Creates an instance of aRayHit
record class. -
Method Summary
Modifier and TypeMethodDescriptiondouble
distance()
Returns the value of thedistance
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.javax.vecmath.Vector3d
normal()
Returns the value of thenormal
record component.javax.vecmath.Point3d
point()
Returns the value of thepoint
record component.target()
Returns the value of thetarget
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
RayHit
public RayHit(MeshInstance target, double distance, javax.vecmath.Vector3d normal, javax.vecmath.Point3d point) Creates an instance of aRayHit
record class.
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
target
-
distance
-
normal
-
point
-