Record Class PosRot
java.lang.Object
java.lang.Record
com.hammy275.immersivemc.common.util.PosRot
public record PosRot(net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 lookAngle, float pitch, float yaw, float roll)
extends Record
An object holding both a position and pitch/yaw/roll. Works the same as IVRData.
Note that pitch, yaw, and roll should be in degrees for consistency with IVRData.
-
Constructor Summary
ConstructorDescriptionPosRot
(net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 lookAngle, float pitch, float yaw, float roll) Creates an instance of aPosRot
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.net.minecraft.world.phys.Vec3
float
getPitch()
float
getRoll()
float
getYaw()
final int
hashCode()
Returns a hash code value for this object.net.minecraft.world.phys.Vec3
Returns the value of thelookAngle
record component.float
pitch()
Returns the value of thepitch
record component.net.minecraft.world.phys.Vec3
position()
Returns the value of theposition
record component.float
roll()
Returns the value of theroll
record component.final String
toString()
Returns a string representation of this record class.float
yaw()
Returns the value of theyaw
record component.
-
Constructor Details
-
PosRot
public PosRot(net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 lookAngle, float pitch, float yaw, float roll) Creates an instance of aPosRot
record class.- Parameters:
position
- the value for theposition
record componentlookAngle
- the value for thelookAngle
record componentpitch
- the value for thepitch
record componentyaw
- the value for theyaw
record componentroll
- the value for theroll
record component
-
-
Method Details
-
getLookAngle
public net.minecraft.world.phys.Vec3 getLookAngle() -
getPitch
public float getPitch() -
getYaw
public float getYaw() -
getRoll
public float getRoll() -
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 '=='. -
position
public net.minecraft.world.phys.Vec3 position()Returns the value of theposition
record component.- Returns:
- the value of the
position
record component
-
lookAngle
public net.minecraft.world.phys.Vec3 lookAngle()Returns the value of thelookAngle
record component.- Returns:
- the value of the
lookAngle
record component
-
pitch
public float pitch()Returns the value of thepitch
record component.- Returns:
- the value of the
pitch
record component
-
yaw
public float yaw()Returns the value of theyaw
record component.- Returns:
- the value of the
yaw
record component
-
roll
public float roll()Returns the value of theroll
record component.- Returns:
- the value of the
roll
record component
-