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.
public record RayHit(MeshInstance target, double distance, javax.vecmath.Vector3d normal)
extends Record
A ray hit is a record of a ray hitting a
MeshInstance
at a certain distance.-
Constructor Summary
ConstructorDescriptionRayHit
(MeshInstance target, double distance, javax.vecmath.Vector3d normal) 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.target()
Returns the value of thetarget
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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
Returns the value of thetarget
record component.- Returns:
- the value of the
target
record component
-
distance
public double distance()Returns the value of thedistance
record component.- Returns:
- the value of the
distance
record component
-
normal
public javax.vecmath.Vector3d normal()Returns the value of thenormal
record component.- Returns:
- the value of the
normal
record component
-