Record Class FixedOrbitProvider
java.lang.Object
java.lang.Record
com.lightning.northstar.planet.data.orbit.FixedOrbitProvider
- All Implemented Interfaces:
OrbitProvider
@ParametersAreNonnullByDefault
public record FixedOrbitProvider(org.joml.Vector3f position)
extends Record
implements OrbitProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<FixedOrbitProvider> static final net.minecraft.resources.ResourceLocationFields inherited from interface com.lightning.northstar.planet.data.orbit.OrbitProvider
REGISTRY -
Constructor Summary
ConstructorsConstructorDescriptionFixedOrbitProvider(org.joml.Vector3f position) Creates an instance of aFixedOrbitProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleApproximate average radius of the orbit, in AUorg.joml.Vector3dcalculatePosition(double deltaDays, org.joml.Vector3d dest) final booleanIndicates whether some other object is "equal to" this one.org.joml.Vector3dgetRotationAxis(org.joml.Vector3d dest) doublegetVisualAngle(double deltaDays) Calculates the visual angle in radians at the given time.final inthashCode()Returns a hash code value for this object.org.joml.Vector3fposition()Returns the value of thepositionrecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.resources.ResourceLocationtype()
-
Field Details
-
TYPE
public static final net.minecraft.resources.ResourceLocation TYPE -
CODEC
-
-
Constructor Details
-
FixedOrbitProvider
public FixedOrbitProvider(org.joml.Vector3f position) Creates an instance of aFixedOrbitProviderrecord class.- Parameters:
position- the value for thepositionrecord component
-
-
Method Details
-
type
public net.minecraft.resources.ResourceLocation type()- Specified by:
typein interfaceOrbitProvider
-
getVisualAngle
public double getVisualAngle(double deltaDays) Description copied from interface:OrbitProviderCalculates the visual angle in radians at the given time. Used for rendering in the orrery.- Specified by:
getVisualAnglein interfaceOrbitProvider
-
getRotationAxis
public org.joml.Vector3d getRotationAxis(org.joml.Vector3d dest) - Specified by:
getRotationAxisin interfaceOrbitProvider
-
approximateRadius
public double approximateRadius()Description copied from interface:OrbitProviderApproximate average radius of the orbit, in AU- Specified by:
approximateRadiusin interfaceOrbitProvider
-
calculatePosition
public org.joml.Vector3d calculatePosition(double deltaDays, org.joml.Vector3d dest) - Specified by:
calculatePositionin interfaceOrbitProvider
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
position
public org.joml.Vector3f position()Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-