Record Class VRPoseImpl

java.lang.Object
java.lang.Record
net.timtaran.interactivemc.util.vr.data.VRPoseImpl
All Implemented Interfaces:
VRPose

public record VRPoseImpl(VRBodyPartData head, VRBodyPartData mainHand, VRBodyPartData offHand, boolean isLeftHanded, float playerScale) extends Record implements VRPose
  • Constructor Details

    • VRPoseImpl

      public VRPoseImpl(VRBodyPartData head, VRBodyPartData mainHand, VRBodyPartData offHand, boolean isLeftHanded, float playerScale)
      Creates an instance of a VRPoseImpl record class.
      Parameters:
      head - the value for the head record component
      mainHand - the value for the mainHand record component
      offHand - the value for the offHand record component
      isLeftHanded - the value for the isLeftHanded record component
      playerScale - the value for the playerScale record component
  • Method Details

    • getBodyPartData

      public VRBodyPartData getBodyPartData(PlayerBodyPart bodyPart)
      Specified by:
      getBodyPartData in interface VRPose
    • isLeftHanded

      public boolean isLeftHanded()
      Returns the value of the isLeftHanded record component.
      Specified by:
      isLeftHanded in interface VRPose
      Returns:
      the value of the isLeftHanded record component
    • getPlayerScale

      public float getPlayerScale()
      Description copied from interface: VRPose
      Gets the scale of the player in VR, calculated using playerHeightScale * worldScale
      Specified by:
      getPlayerScale in interface VRPose
      Returns:
      player scale
    • relativeToPosition

      public VRPoseImpl relativeToPosition(net.minecraft.world.phys.Vec3 position)
      Description copied from interface: VRPose
      Returns a new VRPose whose body part positions are offset relative to the given position.
      Specified by:
      relativeToPosition in interface VRPose
      Parameters:
      position - the reference position
      Returns:
      a new VRPose with positions relative to the reference position
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • head

      public VRBodyPartData head()
      Returns the value of the head record component.
      Returns:
      the value of the head record component
    • mainHand

      public VRBodyPartData mainHand()
      Returns the value of the mainHand record component.
      Returns:
      the value of the mainHand record component
    • offHand

      public VRBodyPartData offHand()
      Returns the value of the offHand record component.
      Returns:
      the value of the offHand record component
    • playerScale

      public float playerScale()
      Returns the value of the playerScale record component.
      Returns:
      the value of the playerScale record component