Package dev.latvian.mods.klib.math
Record Class Rotation
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.math.Rotation
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRotation(float yaw, float pitch, float roll, Rotation.Type type) Creates an instance of aRotationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Rotationcompute(net.minecraft.world.phys.Vec3 source, net.minecraft.world.phys.Vec3 target) static Rotationcompute(net.minecraft.world.phys.Vec3 source, net.minecraft.world.phys.Vec3 target, float roll) static Rotationdeg(float yaw) static Rotationdeg(float yaw, float pitch) static Rotationdeg(float yaw, float pitch, float roll) static Rotationdeg(net.minecraft.world.phys.Vec2 rotation) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisNone()booleanbooleannet.minecraft.world.phys.Vec3lookVec3(double dist) lookVec3f(float dist) static Rotationof(@Nullable net.minecraft.world.entity.Entity entity, float delta) floatpitch()Returns the value of thepitchrecord component.floatpitchDeg()floatpitchRad()static Rotationrad(float yaw) static Rotationrad(float yaw, float pitch) static Rotationrad(float yaw, float pitch, float roll) floatroll()Returns the value of therollrecord component.floatrollDeg()floatrollRad()org.joml.Matrix3frotateYXZ(org.joml.Matrix3f mat) org.joml.Matrix4frotateYXZ(org.joml.Matrix4f mat) org.joml.Matrix3frotateZXY(org.joml.Matrix3f mat) org.joml.Matrix4frotateZXY(org.joml.Matrix4f mat) toDeg()toRad()toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.floatyaw()Returns the value of theyawrecord component.floatyawDeg()floatyawRad()
-
Field Details
-
Constructor Details
-
Rotation
Creates an instance of aRotationrecord class.- Parameters:
yaw- the value for theyawrecord componentpitch- the value for thepitchrecord componentroll- the value for therollrecord componenttype- the value for thetyperecord component
-
-
Method Details
-
deg
-
deg
-
deg
-
deg
-
rad
-
rad
-
rad
-
of
public static Rotation of(@Nullable @Nullable net.minecraft.world.entity.Entity entity, float delta) -
compute
public static Rotation compute(net.minecraft.world.phys.Vec3 source, net.minecraft.world.phys.Vec3 target, float roll) -
compute
public static Rotation compute(net.minecraft.world.phys.Vec3 source, net.minecraft.world.phys.Vec3 target) -
yawDeg
public float yawDeg() -
pitchDeg
public float pitchDeg() -
rollDeg
public float rollDeg() -
yawRad
public float yawRad() -
pitchRad
public float pitchRad() -
rollRad
public float rollRad() -
toDeg
-
toRad
-
lerp
-
lookVec3
public net.minecraft.world.phys.Vec3 lookVec3(double dist) -
lookVec3f
-
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. -
isNone
public boolean isNone() -
isYawOnly
public boolean isYawOnly() -
rotateYXZ
public org.joml.Matrix4f rotateYXZ(org.joml.Matrix4f mat) -
rotateYXZ
public org.joml.Matrix3f rotateYXZ(org.joml.Matrix3f mat) -
rotateZXY
public org.joml.Matrix4f rotateZXY(org.joml.Matrix4f mat) -
rotateZXY
public org.joml.Matrix3f rotateZXY(org.joml.Matrix3f mat) -
isSimilar
-
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 '=='. -
yaw
public float yaw()Returns the value of theyawrecord component.- Returns:
- the value of the
yawrecord component
-
pitch
public float pitch()Returns the value of thepitchrecord component.- Returns:
- the value of the
pitchrecord component
-
roll
public float roll()Returns the value of therollrecord component.- Returns:
- the value of the
rollrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-