Package gaiasky.scene.task
Class ParticleSetUpdaterTask
java.lang.Object
gaiasky.scene.task.ParticleSetUpdaterTask
The task to update particle sets. A full update operation happens in two steps:
- Update metadata: particle metadata like positions and proper motions are updated.
- Sort particles: particles are sorted w.r.t. their distance to the camera and brightness.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final double
protected static final double
protected static final double
protected static final double
-
Constructor Summary
ConstructorsConstructorDescriptionParticleSetUpdaterTask
(com.badlogic.ashley.core.Entity entity, ParticleSet particleSet) -
Method Summary
Modifier and TypeMethodDescriptionstatic double
brightnessProxy
(float absMag, double distanceSquared) Computes a proxy to the star brightness given its absolute magnitude and distance squared.void
dispose()
void
Event notification call.void
run()
void
Triggers the update task if the requirements for it are met: Set is not updating. Opacity is not 0. Time since last update is not larger than updateInterval*2. The camera has moved a lot. Time is on and very fast.
-
Field Details
-
UPDATE_INTERVAL_S
protected static final double UPDATE_INTERVAL_S- See Also:
-
UPDATE_INTERVAL_S_2
protected static final double UPDATE_INTERVAL_S_2- See Also:
-
CAM_DX_TH
protected static final double CAM_DX_TH -
CAM_DX_TH_SQ
protected static final double CAM_DX_TH_SQ
-
-
Constructor Details
-
ParticleSetUpdaterTask
-
-
Method Details
-
update
Triggers the update task if the requirements for it are met:- Set is not updating.
- Opacity is not 0.
- Time since last update is not larger than updateInterval*2.
- The camera has moved a lot.
- Time is on and very fast.
- Parameters:
camera
- The camera.
-
run
public void run() -
brightnessProxy
public static double brightnessProxy(float absMag, double distanceSquared) Computes a proxy to the star brightness given its absolute magnitude and distance squared. Uses a pre-computed table to avoidFastMath.pow(double, double)
calls.- Parameters:
absMag
- The absolute magnitude.distanceSquared
- The distance^2 to the star.- Returns:
- A proxy to the brightness, useful for comparing stars.
-
notify
Description copied from interface:IObserver
Event notification call. -
dispose
public void dispose()
-