Class OrbitElementsSet

java.lang.Object
gaiasky.scene.component.OrbitElementsSet
All Implemented Interfaces:
com.badlogic.ashley.core.Component

public class OrbitElementsSet extends Object implements com.badlogic.ashley.core.Component
Aggregates children entities (typically orbits) so that they are treated as one, especially in terms of GPU draw calls.
  • Field Details

    • B31

      protected final Vector3Q B31
    • D31

      protected final Vector3D D31
    • D32

      protected final Vector3D D32
    • alwaysUpdate

      public com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity> alwaysUpdate
    • initialUpdate

      public boolean initialUpdate
    • pointData

      public List<IParticleRecord> pointData
      Particle data.
    • focus

      public IParticleRecord focus
      Reference to the current focus.
    • focusIndex

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

      public int candidateFocusIndex
      Candidate to focus.
    • focusPosition

      public Vector3Q focusPosition
      Position of the current focus.
    • focusPositionSph

      public Vector2D focusPositionSph
      Position in equatorial coordinates of the current focus in radians.
    • focusDistToCamera

      public double focusDistToCamera
      FOCUS_MODE attributes.
    • focusSolidAngle

      public double focusSolidAngle
      FOCUS_MODE attributes.
    • focusSolidAngleApparent

      public double focusSolidAngleApparent
      FOCUS_MODE attributes.
    • focusSize

      public double focusSize
      FOCUS_MODE attributes.
    • index

      public FastObjectIntMap<String> index
      Name to array index.
    • profileDecay

      public float profileDecay
      Profile decay of the particles in the shader, when using quads and plain ParticleSet.ShadingType.
    • colorNoise

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

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

      public String datafile
      Pointer to the data file.
    • sizeNoise

      public double sizeNoise
      The noise in the size determination for particles. This only has effect if particles themselves do not provide a size. In that case, the final size is computed as clamp(body.size + rand.gaussian() * body.size * sizeNoise).
    • particleSizeLimits

      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.
    • textureAttribute

      public String textureAttribute
      The texture attribute is an attribute in the original table that points to the texture to use. Ideally, it should be an integer value from 1 to n, where n is the number of textures.
    • textureFiles

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

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

      public ParticleSet.ShadingType shadingType
      The shading type, for lighting the particles.
    • sphericalPower

      public float sphericalPower
      Controls how sharply the sphere edges darken (higher values = more pronounced sphere appearance with darker edges).
  • Constructor Details

    • OrbitElementsSet

      public OrbitElementsSet()
  • Method Details

    • markForUpdate

      public void markForUpdate(Render render)
    • data

      public List<IParticleRecord> data()
      Returns the list of particles.
    • setDataFile

      public void setDataFile(String dataFile)
    • setData

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

      public void setPointData(List<IParticleRecord> pointData)
    • setProfileDecay

      public void setProfileDecay(Double profileDecay)
    • setProfiledecay

      @Deprecated public void setProfiledecay(Double profiledecay)
      Deprecated.
    • setColorNoise

      public void setColorNoise(Double colorNoise)
    • setColornoise

      public void setColornoise(Double colorNoise)
    • setSizeNoise

      public void setSizeNoise(Double sizeNoise)
      Set the size noise.
    • setParticleSizeLimitsDeg

      public void setParticleSizeLimitsDeg(double[] sizeLimits)
    • setParticleSizeLimits

      public void setParticleSizeLimits(double[] sizeLimits)
    • setParticlesizelimits

      public void setParticlesizelimits(double[] sizeLimits)
    • setTextureAttribute

      public void setTextureAttribute(String textureAttribute)
    • setTexture

      public void setTexture(String texture)
    • setTextures

      public void setTextures(String[] textures)
    • setShadingType

      public void setShadingType(int type)
    • setShadingType

      public void setShadingType(String type)
    • setSphericalPower

      public void setSphericalPower(Double power)
    • regenerateIndex

      public void regenerateIndex()
      Regenerates the name index
    • generateIndex

      public FastObjectIntMap<String> 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
    • setFocusIndex

      public void setFocusIndex(String name)
    • getId

      public long getId()
    • getName

      public String getName()
    • getNames

      public String[] getNames()
    • hasName

      public boolean hasName(String candidate)
    • hasName

      public boolean hasName(String candidate, boolean matchCase)
    • getLocalizedName

      public String getLocalizedName()
    • getCandidateId

      public long getCandidateId()
    • getCandidateName

      public String getCandidateName()
    • getPosSph

      public Vector2D getPosSph()
    • getAlpha

      public double getAlpha()
    • getDelta

      public double getDelta()
    • getDistToCamera

      public double getDistToCamera()
    • getSolidAngle

      public double getSolidAngle()
    • getSolidAngleApparent

      public double getSolidAngleApparent()
    • fetchPositionDouble

      public Vector3D fetchPositionDouble(IParticleRecord p, Vector3Q camPos, Vector3D out, Instant t)
    • getAbsolutePosition

      public Vector3Q getAbsolutePosition(Instant date, Vector3Q 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

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

      public Vector3Q getAbsolutePosition(String name, Instant date, Vector3Q 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

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

      public double getSize()
    • getSize

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

      public double getRadius()
    • getRadius

      public double getRadius(int i)
    • getFocusSize

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

      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

      public void updateFocusDataPos()
    • setFocusIndex

      public void setFocusIndex(int index)
    • makeFocus

      public void makeFocus()