Record Class SimpleOrbitProvider
java.lang.Object
java.lang.Record
com.lightning.northstar.planet.data.orbit.SimpleOrbitProvider
- Record Components:
durationDays- how long does it take for the orbit a full circle around the central bodyradius- the orbit radius in AUinclination- the orbit inclination in radiansascendingNode- the ascending node angle in radiansinitialMeanAnomaly- the offset angle at the start of the world (base planets use J2000) in radians
- All Implemented Interfaces:
OrbitProvider
@ParametersAreNonnullByDefault
public record SimpleOrbitProvider(double durationDays, double radius, double inclination, double ascendingNode, double initialMeanAnomaly)
extends Record
implements OrbitProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SimpleOrbitProvider> static final net.minecraft.resources.ResourceLocationFields inherited from interface com.lightning.northstar.planet.data.orbit.OrbitProvider
REGISTRY -
Constructor Summary
ConstructorsConstructorDescriptionSimpleOrbitProvider(double durationDays, double radius, double inclination, double ascendingNode, double initialMeanAnomaly) Creates an instance of aSimpleOrbitProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleApproximate average radius of the orbit, in AUdoubleReturns the value of theascendingNoderecord component.org.joml.Vector3dcalculatePosition(double deltaDays, org.joml.Vector3d dest) static SimpleOrbitProvidercreate(double durationDays, double radius, double inclinationDeg, double ascendingNodeDeg, double initialMeanAnomalyDeg) doubleReturns the value of thedurationDaysrecord component.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.doubleReturns the value of theinclinationrecord component.doubleReturns the value of theinitialMeanAnomalyrecord component.doubleradius()Returns the value of theradiusrecord 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
-
SimpleOrbitProvider
public SimpleOrbitProvider(double durationDays, double radius, double inclination, double ascendingNode, double initialMeanAnomaly) Creates an instance of aSimpleOrbitProviderrecord class.- Parameters:
durationDays- the value for thedurationDaysrecord componentradius- the value for theradiusrecord componentinclination- the value for theinclinationrecord componentascendingNode- the value for theascendingNoderecord componentinitialMeanAnomaly- the value for theinitialMeanAnomalyrecord component
-
-
Method Details
-
create
public static SimpleOrbitProvider create(double durationDays, double radius, double inclinationDeg, double ascendingNodeDeg, double initialMeanAnomalyDeg) -
type
public net.minecraft.resources.ResourceLocation type()- Specified by:
typein interfaceOrbitProvider
-
approximateRadius
public double approximateRadius()Description copied from interface:OrbitProviderApproximate average radius of the orbit, in AU- Specified by:
approximateRadiusin 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
-
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 with '=='. -
durationDays
public double durationDays()Returns the value of thedurationDaysrecord component.- Returns:
- the value of the
durationDaysrecord component
-
radius
public double radius()Returns the value of theradiusrecord component.- Returns:
- the value of the
radiusrecord component
-
inclination
public double inclination()Returns the value of theinclinationrecord component.- Returns:
- the value of the
inclinationrecord component
-
ascendingNode
public double ascendingNode()Returns the value of theascendingNoderecord component.- Returns:
- the value of the
ascendingNoderecord component
-
initialMeanAnomaly
public double initialMeanAnomaly()Returns the value of theinitialMeanAnomalyrecord component.- Returns:
- the value of the
initialMeanAnomalyrecord component
-