Record Class WorldHitResult
java.lang.Object
java.lang.Record
com.render.api.world.WorldHitResult
public record WorldHitResult(WorldObject<?> object, long pickId, long instanceHandle, net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 normal, double distance, int triangleIndex)
extends Record
Result of scene picking against a retained object or instance.
-
Constructor Summary
ConstructorsConstructorDescriptionWorldHitResult(WorldObject<?> object, long pickId, long instanceHandle, net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 normal, double distance, int triangleIndex) Creates an instance of aWorldHitResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubledistance()Returns the value of thedistancerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of theinstanceHandlerecord component.net.minecraft.world.phys.Vec3normal()Returns the value of thenormalrecord component.WorldObject<?> object()Returns the value of theobjectrecord component.longpickId()Returns the value of thepickIdrecord component.net.minecraft.world.phys.Vec3position()Returns the value of thepositionrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetriangleIndexrecord component.
-
Constructor Details
-
WorldHitResult
public WorldHitResult(WorldObject<?> object, long pickId, long instanceHandle, net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 normal, double distance, int triangleIndex) Creates an instance of aWorldHitResultrecord class.- Parameters:
object- the value for theobjectrecord componentpickId- the value for thepickIdrecord componentinstanceHandle- the value for theinstanceHandlerecord componentposition- the value for thepositionrecord componentnormal- the value for thenormalrecord componentdistance- the value for thedistancerecord componenttriangleIndex- the value for thetriangleIndexrecord component
-
-
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 thecomparemethod from their corresponding wrapper classes. -
object
Returns the value of theobjectrecord component.- Returns:
- the value of the
objectrecord component
-
pickId
public long pickId()Returns the value of thepickIdrecord component.- Returns:
- the value of the
pickIdrecord component
-
instanceHandle
public long instanceHandle()Returns the value of theinstanceHandlerecord component.- Returns:
- the value of the
instanceHandlerecord component
-
position
public net.minecraft.world.phys.Vec3 position()Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
normal
public net.minecraft.world.phys.Vec3 normal()Returns the value of thenormalrecord component.- Returns:
- the value of the
normalrecord component
-
distance
public double distance()Returns the value of thedistancerecord component.- Returns:
- the value of the
distancerecord component
-
triangleIndex
public int triangleIndex()Returns the value of thetriangleIndexrecord component.- Returns:
- the value of the
triangleIndexrecord component
-