Class Trajectory
java.lang.Object
gaiasky.scene.component.Trajectory
- All Implemented Interfaces:
com.badlogic.ashley.core.Component
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe body representation type for this orbit/trajectory.static enumOrientation model for this orbit/trajectory.static enumSampling strategy for the orbit component. -
Field Summary
FieldsModifier and TypeFieldDescriptiondoublecom.badlogic.ashley.core.EntityThe entity that employs this trajectory/orbit.float[]Body color.Control the body/trajectory representation for this object.booleanWhether to close the trajectory (connect end point to start point) or notdoubleCurrent orbit completion -- current delta from t0.floatOrbits with a body fade out as the camera get closer to the body.floatOrbits with a body fade out as the camera get closer to the body.booleanstatic final Logger.LogThe orientation model.booleanWhether the orbit must be refreshed when out of boundsbooleanChanges the way in which transformations are applied to the orbit objects.intNumber of samples for the orbit data provider.Orbit component object.longlongbooleanWhether to show the orbit as a trail or not.floatPoint sizeClass<? extends IOrbitDataProvider> booleanRefreshing statedoubleFor orbits that need to be refreshed (i.e.Strategy to use to sample the orbit.floatThe bottom mapping position for the trail.floatMinimum opacity value of the trail. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidsetBody(com.badlogic.ashley.core.Entity entity, double radius) voidsetBody(com.badlogic.ashley.core.Entity entity, double radius, float distDown, float distUp) voidsetBodyColor(double[] color) voidsetBodyRepresentation(String representation) Sets the body representation for this trajectory.voidsetClosedLoop(Boolean closedLoop) voidsetFadeDistanceDown(Double distDown) voidsetFadeDistanceUp(Double distUp) voidvoidsetMultiplier(Double scaleFactor) voidsetNewmethod(Boolean newMethod) voidsetNumSamples(Long numSamples) voidsetOnlybody(Boolean onlyBody) Deprecated.voidsetOnlyBody(Boolean onlyBody) Deprecated.Use {setBodyRepresentation(String)} instead.voidvoidsetOrbitProvider(String provider) voidsetOrbitScaleFactor(Double scaleFactor) voidsetOrbittrail(Boolean trail) voidsetOrientationModel(String model) Sets the orientation model as a string.voidsetPointcolor(double[] color) voidsetPointColor(double[] color) voidsetPointsize(Double pointSize) voidsetPointsize(Long pointSize) voidsetPointSize(Double pointSize) voidsetPointSize(Long pointSize) voidsetProvider(String provider) voidsetRefreshRate(Double refhreshRate) voidsetSampling(String sampling) voidvoidsetTrailMap(Double trailMap) voidsetTrailMinOpacity(Double trailMin)
-
Field Details
-
logger
-
body
public com.badlogic.ashley.core.Entity bodyThe entity that employs this trajectory/orbit. This is **not** the orbit object, but the actual planet/moon/spacecraft object. -
curr
-
alpha
public double alpha -
localTransformD
-
provider
-
multiplier
-
providerClass
-
providerInstance
-
oc
Orbit component object. -
bodyRepresentation
Control the body/trajectory representation for this object. Note that the body can only be represented when using orbital elements. -
newMethod
public boolean newMethodChanges the way in which transformations are applied to the orbit objects. Asteroids have this set to true. -
coord
public double coordCurrent orbit completion -- current delta from t0. -
model
The orientation model. -
isInOrbitalElementsGroup
public boolean isInOrbitalElementsGroup -
refreshing
public boolean refreshingRefreshing state -
numSamples
public int numSamplesNumber of samples for the orbit data provider. -
sampling
Strategy to use to sample the orbit. -
orbitStartMs
public long orbitStartMs -
orbitEndMs
public long orbitEndMs -
mustRefresh
public boolean mustRefreshWhether the orbit must be refreshed when out of bounds -
closedLoop
public boolean closedLoopWhether to close the trajectory (connect end point to start point) or not -
orbitTrail
public boolean orbitTrailWhether to show the orbit as a trail or not. A trail fades the orbit line as it gets further away from the object. -
trailMap
public float trailMapThe bottom mapping position for the trail. The orbit trail assigns an opacity value to each point of the orbit, where 1 is the location of the object and 0 is the other end. This mapping parameter defines the location in the orbit (in [0,1]) where we map the opacity value of 0. Set to 0 to have a full trail. Set to 0.5 to have a trail that spans half the orbit. Set to 1 to have no orbit at all. -
trailMinOpacity
public float trailMinOpacityMinimum opacity value of the trail. Set this > 0 to raise the global opacity level of the orbit. Effectively, the opacity of the orbit will be mapped from this value to 1. -
params
-
bodyColor
public float[] bodyColorBody color. Color to use to represent the body in orbital elements trajectories, when thebodyRepresentationattribute enables the representation of the body for this trajectory. -
pointSize
public float pointSizePoint size -
distUp
public float distUpOrbits with a body fade out as the camera get closer to the body. This is the far distance, in body radius units, where the orbit starts the fade (mapped to 1). This attribute only has effect if this trajectory has a body. -
distDown
public float distDownOrbits with a body fade out as the camera get closer to the body. This is the near distance, in body radius units, where the orbit ends the fade (mapped to 0). This attribute only has effect if this trajectory has a body. -
refreshRate
public double refreshRateFor orbits that need to be refreshed (i.e. not implemented as orbital elements, but via samples), this is the orbit refresh rate, in [0,1]. Set to 0 to recompute only every period, and set to 1 to recompute as often as possible. Set to negative to use the default re-computation heuristic. This can help reduce the seams between the trajectory lines computed in the past cycle and the current cycle in orbits which are very open.
-
-
Constructor Details
-
Trajectory
public Trajectory()
-
-
Method Details
-
setOrientationModel
Sets the orientation model as a string.- Parameters:
model- The orientation model.
-
setModel
-
setPointSize
-
setPointsize
-
setPointSize
-
setPointsize
-
setBodyColor
public void setBodyColor(double[] color) -
setPointColor
public void setPointColor(double[] color) -
setPointcolor
public void setPointcolor(double[] color) -
setClosedLoop
-
setOrbitProvider
-
setProvider
-
setOrbit
-
setOrbitScaleFactor
-
setMultiplier
-
setOnlyBody
Deprecated.Use {setBodyRepresentation(String)} instead.Mutes the orbit line in orbital elements trajectories.- Parameters:
onlyBody- Whether to display only the body for this trajectory.
-
setOnlybody
Deprecated.Use {setBodyRepresentation(String)} instead.Alias method, @seesetOnlyBody(Boolean). -
isOnlyBody
public boolean isOnlyBody() -
setBodyRepresentation
Sets the body representation for this trajectory.- Parameters:
representation- The body representation model. SeeTrajectory.OrbitBodyRepresentationfor more information.
-
setNewmethod
-
setTrail
-
setTrailMap
-
setTrailMinOpacity
-
setOrbittrail
-
setNumSamples
-
setSampling
-
setFadeDistanceUp
-
setFadeDistanceDown
-
setRefreshRate
-
setBody
public void setBody(com.badlogic.ashley.core.Entity entity, double radius) -
setBody
public void setBody(com.badlogic.ashley.core.Entity entity, double radius, float distDown, float distUp)
-
setBodyRepresentation(String)} instead.