Record Class PhysicalOrbitProvider
java.lang.Object
java.lang.Record
com.lightning.northstar.planet.data.orbit.PhysicalOrbitProvider
- All Implemented Interfaces:
OrbitProvider
@ParametersAreNonnullByDefault
public record PhysicalOrbitProvider(double gravitationalParameter, double semiMajorAxis, double eccentricity, double inclination, double ascendingNode, double argumentOfPeriapsis, double meanAnomaly)
extends Record
implements OrbitProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<PhysicalOrbitProvider> static final net.minecraft.resources.ResourceLocationFields inherited from interface com.lightning.northstar.planet.data.orbit.OrbitProvider
REGISTRY -
Constructor Summary
ConstructorsConstructorDescriptionPhysicalOrbitProvider(double gravitationalParameter, double semiMajorAxis, double eccentricity, double inclination, double ascendingNode, double argumentOfPeriapsis, double meanAnomaly) Creates an instance of aPhysicalOrbitProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleApproximate average radius of the orbit, in AUdoubleReturns the value of theargumentOfPeriapsisrecord component.doubleReturns the value of theascendingNoderecord component.org.joml.Vector3dcalculatePosition(double deltaDays, org.joml.Vector3d dest) static PhysicalOrbitProvidercreate(double gravitationalParameter, double semiMajorAxis, double eccentricity, double inclinationDeg, double longitudeOfAscendingNodeDeg, double argumentOfPeriapsisDeg, double meanAnomalyDeg) doubleReturns the value of theeccentricityrecord 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.doubleReturns the value of thegravitationalParameterrecord component.final inthashCode()Returns a hash code value for this object.doubleReturns the value of theinclinationrecord component.doubleReturns the value of themeanAnomalyrecord component.doubleReturns the value of thesemiMajorAxisrecord 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
-
PhysicalOrbitProvider
public PhysicalOrbitProvider(double gravitationalParameter, double semiMajorAxis, double eccentricity, double inclination, double ascendingNode, double argumentOfPeriapsis, double meanAnomaly) Creates an instance of aPhysicalOrbitProviderrecord class.- Parameters:
gravitationalParameter- the value for thegravitationalParameterrecord componentsemiMajorAxis- the value for thesemiMajorAxisrecord componenteccentricity- the value for theeccentricityrecord componentinclination- the value for theinclinationrecord componentascendingNode- the value for theascendingNoderecord componentargumentOfPeriapsis- the value for theargumentOfPeriapsisrecord componentmeanAnomaly- the value for themeanAnomalyrecord component
-
-
Method Details
-
create
public static PhysicalOrbitProvider create(double gravitationalParameter, double semiMajorAxis, double eccentricity, double inclinationDeg, double longitudeOfAscendingNodeDeg, double argumentOfPeriapsisDeg, double meanAnomalyDeg) -
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 '=='. -
gravitationalParameter
public double gravitationalParameter()Returns the value of thegravitationalParameterrecord component.- Returns:
- the value of the
gravitationalParameterrecord component
-
semiMajorAxis
public double semiMajorAxis()Returns the value of thesemiMajorAxisrecord component.- Returns:
- the value of the
semiMajorAxisrecord component
-
eccentricity
public double eccentricity()Returns the value of theeccentricityrecord component.- Returns:
- the value of the
eccentricityrecord 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
-
argumentOfPeriapsis
public double argumentOfPeriapsis()Returns the value of theargumentOfPeriapsisrecord component.- Returns:
- the value of the
argumentOfPeriapsisrecord component
-
meanAnomaly
public double meanAnomaly()Returns the value of themeanAnomalyrecord component.- Returns:
- the value of the
meanAnomalyrecord component
-