Class ParticleSet

java.lang.Object
gaiasky.scene.component.ParticleSet
All Implemented Interfaces:
com.badlogic.ashley.core.Component, IDisposable
Direct Known Subclasses:
StarSet

public class ParticleSet extends Object implements com.badlogic.ashley.core.Component, IDisposable
  • Field Details Link icon

    • idSeq Link icon

      public static long idSeq
    • B31 Link icon

      protected final Vector3b B31
    • B32 Link icon

      protected final Vector3b B32
    • B33 Link icon

      protected final Vector3b B33
    • B34 Link icon

      protected final Vector3b B34
    • D31 Link icon

      protected final Vector3d D31
    • D32 Link icon

      protected final Vector3d D32
    • D33 Link icon

      protected final Vector3d D33
    • pointData Link icon

      public List<IParticleRecord> pointData
      List that contains the point data. It contains only [x y z].
    • renderParticles Link icon

      public boolean renderParticles
      This flag enables muting particle rendering.
    • isStars Link icon

      public boolean isStars
      Flag indicating whether the particle set holds stars or particles (extended or not).
    • isExtended Link icon

      public boolean isExtended
      Flag indicating whether the particle set holds extended particles.
    • renderSetLabel Link icon

      public boolean renderSetLabel
      Whether to render the global set label or not.
    • numLabels Link icon

      public int numLabels
      Number of labels to render for this group.
    • provider Link icon

      public String provider
      Fully qualified name of data provider class.
    • datafile Link icon

      public String datafile
      Path of data file.
    • providerParams Link icon

      public Map<String,Object> providerParams
    • modelFile Link icon

      public String modelFile
      Model file to use (obj, g3db, g3dj, gltf, glb). If present, modelType and modelParams are ignored. The model should have only positions (vector-3), normals (vector-3) and texture coordinates (vector-2) as vertex attributes. Only the first mesh of the model is used. Textures, lighting and material are ignored.
    • model Link icon

      public IntModel model
      The loaded model pointed by modelFile.
    • modelType Link icon

      public String modelType
      Default model type to use for the particles of this set. Typically, this should be set to quad, but allows for other model types.
    • modelParams Link icon

      public Map<String,Object> modelParams
      Parameters for the model, in case 'modelType' is used.
    • modelPrimitive Link icon

      public int modelPrimitive
      Render primitive. Triangles by default.
    • profileDecay Link icon

      public float profileDecay
      Profile decay of the particles in the shader, when using quads.
    • colorNoise Link icon

      public float colorNoise
      Noise factor for the color in [0,1].
    • fixedAngularSize Link icon

      public double fixedAngularSize
      Fixed angular size for all particles in this set, in radians. Applies only to quads. Negative to disable.
    • particleSizeLimitsPoint Link icon

      public double[] particleSizeLimitsPoint
      Particle size limits. Applies to legacy point render (using GL_POINTS).
    • particleSizeLimits Link icon

      public double[] particleSizeLimits
      Particle size limits for the quad renderer (using quads as GL_TRIANGLES). This will be multiplied by the distance to the particle in the shader, so that size = tan(angle) * dist.
    • textureFiles Link icon

      public String[] textureFiles
      Texture files to use for rendering the particles, at random. Applies only to quads.
    • textureArray Link icon

      public com.badlogic.gdx.graphics.TextureArray textureArray
      Reference to the texture array containing the textures for this set, if any. Applies only to quads.
    • meanPosition Link icon

      public Vector3d meanPosition
      Temporary storage for the mean position of this particle set, if it is given externally. If this is set, the mean position is not computed from the positions of all the particles automatically.
    • factor Link icon

      public Double factor
      Factor to apply to the data points, usually to normalise distances.
    • ccMin Link icon

      public float[] ccMin
      Mapping colors.
    • ccMax Link icon

      public float[] ccMax
      Mapping colors.
    • forceLabel Link icon

      public Set<Integer> forceLabel
      Particles for which forceLabel is enabled.
    • labelColors Link icon

      public Map<Integer,float[]> labelColors
      Particles with special label colors.
    • lastSortTime Link icon

      public long lastSortTime
      Stores the time when the last sort operation finished, in ms.
    • meanDistance Link icon

      public double meanDistance
      The mean distance from the origin of all points in this group. Gives a sense of the scale.
    • maxDistance Link icon

      public double maxDistance
    • minDistance Link icon

      public double minDistance
    • epochJd Link icon

      public double epochJd
      Epoch for positions/proper motions in julian days.
    • currDeltaYears Link icon

      public double currDeltaYears
      Current computed epoch time.
    • focus Link icon

      public IParticleRecord focus
      Reference to the current focus.
    • focusIndex Link icon

      public int focusIndex
      Index of the particle acting as focus. Negative if we have no focus here.
    • candidateFocusIndex Link icon

      public int candidateFocusIndex
      Candidate to focus.
    • focusPosition Link icon

      public Vector3b focusPosition
      Position of the current focus.
    • focusPositionSph Link icon

      public Vector2d focusPositionSph
      Position in equatorial coordinates of the current focus in radians.
    • focusDistToCamera Link icon

      public double focusDistToCamera
      FOCUS_MODE attributes.
    • focusSolidAngle Link icon

      public double focusSolidAngle
      FOCUS_MODE attributes.
    • focusSolidAngleApparent Link icon

      public double focusSolidAngleApparent
      FOCUS_MODE attributes.
    • focusSize Link icon

      public double focusSize
      FOCUS_MODE attributes.
    • proximity Link icon

      public Proximity proximity
      Proximity particles.
    • disposed Link icon

      public boolean disposed
    • index Link icon

      public Map<String,Integer> index
    • metadata Link icon

      public double[] metadata
    • indices1 Link icon

      public Integer[] indices1
    • indices2 Link icon

      public Integer[] indices2
    • active Link icon

      public Integer[] active
    • background Link icon

      public Integer[] background
    • visibilityArray Link icon

      public byte[] visibilityArray
    • updating Link icon

      public final AtomicBoolean updating
    • updaterTask Link icon

      public ParticleSetUpdaterTask updaterTask
    • lastSortCameraPos Link icon

      public Vector3b lastSortCameraPos
    • cPosD Link icon

      public Vector3b cPosD
  • Constructor Details Link icon

    • ParticleSet Link icon

      public ParticleSet()
  • Method Details Link icon

    • getColorMin Link icon

      public float[] getColorMin()
    • setColorMin Link icon

      public void setColorMin(double[] colorMin)
    • setColorMin Link icon

      public void setColorMin(float[] colorMin)
    • getColorMax Link icon

      public float[] getColorMax()
    • setColorMax Link icon

      public void setColorMax(double[] colorMax)
    • setColorMax Link icon

      public void setColorMax(float[] colorMax)
    • getMeanDistance Link icon

      public double getMeanDistance()
    • getMinDistance Link icon

      public double getMinDistance()
    • getMaxDistance Link icon

      public double getMaxDistance()
    • data Link icon

      public List<IParticleRecord> data()
      Returns the list of particles.
    • setData Link icon

      public void setData(List<IParticleRecord> pointData)
    • setData Link icon

      public void setData(List<IParticleRecord> pointData, boolean regenerateIndex)
    • regenerateIndex Link icon

      public void regenerateIndex()
      Regenerates the name index
    • generateIndex Link icon

      public Map<String,Integer> generateIndex(List<IParticleRecord> pointData)
      Generates the index (maps name to array index) and computes the geometric center of this group
      Parameters:
      pointData - The data
      Returns:
      An map{string,int} mapping names to indices
    • setMeanPosition Link icon

      public void setMeanPosition(double[] pos)
    • setPosition Link icon

      public void setPosition(double[] pos)
    • setPosKm Link icon

      public void setPosKm(double[] pos)
    • setMeanPositionKm Link icon

      public void setMeanPositionKm(double[] pos)
    • setPositionKm Link icon

      public void setPositionKm(double[] pos)
    • setPosPc Link icon

      public void setPosPc(double[] pos)
    • setMeanPositionPc Link icon

      public void setMeanPositionPc(double[] pos)
    • setPositionPc Link icon

      public void setPositionPc(double[] pos)
    • setPosition Link icon

      public void setPosition(int[] pos)
    • setDataFile Link icon

      public void setDataFile(String dataFile)
    • setDatafile Link icon

      public void setDatafile(String dataFile)
    • setProviderParams Link icon

      public void setProviderParams(Map<String,Object> params)
    • setProviderparams Link icon

      public void setProviderparams(Map<String,Object> params)
    • setFactor Link icon

      public void setFactor(Double factor)
    • setProfiledecay Link icon

      public void setProfiledecay(Double profiledecay)
    • setProfileDecay Link icon

      public void setProfileDecay(Double profileDecay)
    • setColornoise Link icon

      public void setColornoise(Double colorNoise)
    • setColorNoise Link icon

      public void setColorNoise(Double colorNoise)
    • setFixedAngularSize Link icon

      public void setFixedAngularSize(Double fixedAngularSize)
      Set fixed angular size, in radians.
    • setFixedAngularSizeRad Link icon

      public void setFixedAngularSizeRad(Double fixedAngularSizeRad)
      Set fixed angular size, in radians.
    • setFixedAngularSizeDeg Link icon

      public void setFixedAngularSizeDeg(Double fixedAngularSizeDeg)
      Set fixed angular size, in degrees.
    • setParticleSizeLimits Link icon

      public void setParticleSizeLimits(double[] sizeLimits)
    • setParticlesizelimits Link icon

      public void setParticlesizelimits(double[] sizeLimits)
    • setTexture Link icon

      public void setTexture(String texture)
    • setTextures Link icon

      public void setTextures(String[] textures)
    • setRenderParticles Link icon

      public void setRenderParticles(Boolean renderParticles)
    • setRenderSetLabel Link icon

      public void setRenderSetLabel(Boolean renderSetLabel)
    • setExtended Link icon

      public void setExtended(Boolean extended)
    • setNumLabels Link icon

      public void setNumLabels(Long numLabels)
    • get Link icon

      public IParticleRecord get(int index)
    • getRandomParticleName Link icon

      public String getRandomParticleName()
      Gets the name of a random particle in this group
      Returns:
      The name of a random particle
    • setModelType Link icon

      public void setModelType(String modelType)
    • setModelParams Link icon

      public void setModelParams(Map<String,Object> params)
    • setModelPrimitive Link icon

      public void setModelPrimitive(String modelPrimitive)
    • getSize Link icon

      public double getSize()
    • getSize Link icon

      public double getSize(int i)
      Returns the size of the particle at index i
      Parameters:
      i - The index
      Returns:
      The size
    • getFocusSize Link icon

      public double getFocusSize()
      Default size if not in data, 1e5 km
      Returns:
      The size
    • setFocusIndex Link icon

      public void setFocusIndex(String name)
    • getCandidateBean Link icon

      public IParticleRecord getCandidateBean()
    • getRadius Link icon

      public double getRadius()
    • getRadius Link icon

      public double getRadius(int i)
    • updateFocus Link icon

      public void updateFocus(ICamera camera)
      Updates the parameters of the focus, if the focus is active in this group
      Parameters:
      camera - The current camera
    • updateFocusDataPos Link icon

      public void updateFocusDataPos()
    • setFocusIndex Link icon

      public void setFocusIndex(int index)
    • makeFocus Link icon

      public void makeFocus()
    • isVisible Link icon

      public boolean isVisible(int index)
      Checks whether the particle with the given index is visible
      Parameters:
      index - The index of the particle
      Returns:
      The visibility of the particle
    • setVisible Link icon

      public void setVisible(boolean visible, String name, Render render)
    • setVisible Link icon

      public void setVisible(int index, boolean visible, Render render)
      Sets the visibility of the particle with the given index. If the visibility has changed, it marks the particle group for update.
      Parameters:
      index - The index of the particle
      visible - Visibility flag
    • markForUpdate Link icon

      public void markForUpdate(Render render)
    • getAbsolutePosition Link icon

      public Vector3b getAbsolutePosition(String name, Instant date, Vector3b out)
      Returns the position of the object with the given name at the given date, if any, in the out vector.
      Parameters:
      date - The date at which to get the position. If null, the position is given at the current simulation date.
      out - The out vector.
    • getAbsolutePosition Link icon

      public Vector3b getAbsolutePosition(IParticleRecord object, Instant date, Vector3b out)
      Returns the position of the given object at the given date, if any, in the out vector.
      Parameters:
      date - The date at which to get the position. If null, the position is given at the current simulation date.
      out - The out vector.
    • getAbsolutePosition Link icon

      public Vector3b getAbsolutePosition(Instant date, Vector3b out)
      Returns the current focus position at the given date, if any, in the out vector.
      Parameters:
      date - The date at which to get the position. If null, the position is given at the current simulation date.
      out - The out vector.
    • getAbsolutePosition Link icon

      public Vector3b getAbsolutePosition(Vector3b out)
      Returns the current focus position, if any, in the out vector.
    • getAbsolutePosition Link icon

      public Vector3b getAbsolutePosition(String name, Vector3b out)
      Returns the absolute position of the particle with the given name.
      Parameters:
      name - The name.
      out - The out vector.
      Returns:
      The absolute position in the out vector.
    • getAbsolutePosition Link icon

      public Vector3d getAbsolutePosition(String name, Vector3d out)
      Returns the absolute position of the particle with the given name.
      Parameters:
      name - The name.
      out - The out vector.
      Returns:
      The absolute position in the out vector.
    • fetchPositionDouble Link icon

      public Vector3d fetchPositionDouble(IParticleRecord pb, Vector3b camPos, Vector3d out, double deltaYears)
      Fetches the real position of the particle. It will apply the necessary integrations (i.e. proper motion). Double-precision version.
      Parameters:
      pb - The particle bean
      camPos - The position of the camera. If null, the camera position is not subtracted so that the coordinates are given in the global reference system instead of the camera reference system.
      out - The output vector
      deltaYears - The delta years
      Returns:
      The vector for chaining
    • fetchPosition Link icon

      public Vector3b fetchPosition(IParticleRecord pb, Vector3b camPos, Vector3b out, double deltaYears)
      Fetches the real position of the particle. It will apply the necessary integrations (i.e. proper motion). Arbitrary-precision version.
      Parameters:
      pb - The particle bean
      camPos - The position of the camera. If null, the camera position is not subtracted so that the coordinates are given in the global reference system instead of the camera reference system.
      out - The output vector
      deltaYears - The delta years
      Returns:
      The vector for chaining
    • setEpoch Link icon

      public void setEpoch(Double epochJd)
      Sets the epoch to use for the stars in this set.
      Parameters:
      epochJd - The epoch in julian days (days since January 1, 4713 BCE).
    • setEpochJd Link icon

      public void setEpochJd(Double epochJd)
      Sets the epoch to use for the stars in this set.
      Parameters:
      epochJd - The epoch in julian days (days since January 1, 4713 BCE).
    • getDeltaYears Link icon

      public double getDeltaYears()
      Returns the delta years to integrate the proper motion.
      Returns:
      The current delta years.
    • getId Link icon

      public long getId()
    • getName Link icon

      public String getName()
    • getNames Link icon

      public String[] getNames()
    • getLocalizedName Link icon

      public String getLocalizedName()
    • getCandidateId Link icon

      public long getCandidateId()
    • getCandidateName Link icon

      public String getCandidateName()
    • getCandidateSolidAngleApparent Link icon

      public double getCandidateSolidAngleApparent()
    • getClosestName Link icon

      public String getClosestName()
    • canSelect Link icon

      public boolean canSelect(FilterView view)
    • getPosSph Link icon

      public Vector2d getPosSph()
    • getAlpha Link icon

      public double getAlpha()
    • getDelta Link icon

      public double getDelta()
    • getDistToCamera Link icon

      public double getDistToCamera()
    • getSolidAngle Link icon

      public double getSolidAngle()
    • getSolidAngleApparent Link icon

      public double getSolidAngleApparent()
    • isWireframe Link icon

      public boolean isWireframe()
    • isBillboard Link icon

      public boolean isBillboard()
    • setForceLabel Link icon

      public void setForceLabel(Boolean forceLabel, String name)
    • isForceLabel Link icon

      public boolean isForceLabel(String name)
    • setLabelColor Link icon

      public void setLabelColor(float[] color, String name)
    • dispose Link icon

      public void dispose(com.badlogic.ashley.core.Entity entity)
      Specified by:
      dispose in interface IDisposable