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 Summary
ConstructorsConstructorDescriptionVRPoseImpl(VRBodyPartData head, VRBodyPartData mainHand, VRBodyPartData offHand, boolean isLeftHanded, float playerScale) Creates an instance of aVRPoseImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getBodyPartData(PlayerBodyPart bodyPart) floatGets the scale of the player in VR, calculated usingplayerHeightScale * worldScalefinal inthashCode()Returns a hash code value for this object.head()Returns the value of theheadrecord component.booleanReturns the value of theisLeftHandedrecord component.mainHand()Returns the value of themainHandrecord component.offHand()Returns the value of theoffHandrecord component.floatReturns the value of theplayerScalerecord component.relativeToPosition(net.minecraft.world.phys.Vec3 position) Returns a newVRPosewhose body part positions are offset relative to the given position.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
VRPoseImpl
public VRPoseImpl(VRBodyPartData head, VRBodyPartData mainHand, VRBodyPartData offHand, boolean isLeftHanded, float playerScale) Creates an instance of aVRPoseImplrecord class.- Parameters:
head- the value for theheadrecord componentmainHand- the value for themainHandrecord componentoffHand- the value for theoffHandrecord componentisLeftHanded- the value for theisLeftHandedrecord componentplayerScale- the value for theplayerScalerecord component
-
-
Method Details
-
getBodyPartData
- Specified by:
getBodyPartDatain interfaceVRPose
-
isLeftHanded
public boolean isLeftHanded()Returns the value of theisLeftHandedrecord component.- Specified by:
isLeftHandedin interfaceVRPose- Returns:
- the value of the
isLeftHandedrecord component
-
getPlayerScale
public float getPlayerScale()Description copied from interface:VRPoseGets the scale of the player in VR, calculated usingplayerHeightScale * worldScale- Specified by:
getPlayerScalein interfaceVRPose- Returns:
- player scale
-
relativeToPosition
Description copied from interface:VRPoseReturns a newVRPosewhose body part positions are offset relative to the given position.- Specified by:
relativeToPositionin interfaceVRPose- Parameters:
position- the reference position- Returns:
- a new
VRPosewith positions relative to the reference position
-
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 '=='. -
head
Returns the value of theheadrecord component.- Returns:
- the value of the
headrecord component
-
mainHand
Returns the value of themainHandrecord component.- Returns:
- the value of the
mainHandrecord component
-
offHand
Returns the value of theoffHandrecord component.- Returns:
- the value of the
offHandrecord component
-
playerScale
public float playerScale()Returns the value of theplayerScalerecord component.- Returns:
- the value of the
playerScalerecord component
-