Package gaiasky.scene.component
Class ParticleSet
java.lang.Object
gaiasky.scene.component.ParticleSet
- All Implemented Interfaces:
com.badlogic.ashley.core.Component
,IDisposable
- Direct Known Subclasses:
StarSet
-
Field Summary
Modifier and TypeFieldDescriptionInteger[]
Integer[]
int
Candidate to focus.float[]
Mapping colorsfloat[]
Mapping colorsfloat
Noise factor for the color in [0,1]final Vector3d
Path of data fileboolean
Factor to apply to the data points, usually to normalise distancesReference to the current focus.double
FOCUS_MODE attributesint
Index of the particle acting as focus.Position of the current focusPosition in equatorial coordinates of the current focus in radiansdouble
FOCUS_MODE attributesdouble
FOCUS_MODE attributesdouble
FOCUS_MODE attributesstatic long
Integer[]
Integer[]
boolean
Flag indicating whether the particle set holds stars or particles.long
Stores the time when the last sort operation finished, in msdouble
double
The mean distance from the origin of all points in this group.Temporary storage for the mean position of this particle set, if it is given externally.double[]
double
double[]
Particle size limits for the quad renderer (using quads as GL_TRIANGLES).double[]
Particle size limits.List that contains the point data.float
Profile decay of the particles in the shaderFully qualified name of data provider classProximity particlesboolean
byte[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canSelect
(FilterView view) data()
Returns the list of particles.void
dispose
(com.badlogic.ashley.core.Entity entity) fetchPosition
(IParticleRecord pb, Vector3d campos, Vector3d destination, double deltaYears) Fetches the real position of the particle.generateIndex
(List<IParticleRecord> pointData) Generates the index (maps name to array index) and computes the geometric center of this groupget
(int index) Returns the current focus position, if any, in the out vector.getAbsolutePosition
(String name, Vector3b out) Returns the position of the particle with the given name, if any, in the out vector.double
getAlpha()
long
double
float[]
float[]
double
getDelta()
double
Returns the delta years to integrate the proper motion.double
double
Default size if not in data, 1e5 kmlong
getId()
double
double
double
getName()
String[]
getNames()
double
double
getRadius
(int i) Gets the name of a random particle in this groupdouble
getSize()
double
getSize
(int i) Returns the size of the particle at index idouble
double
boolean
isVisible
(int index) Checks whether the particle with the given index is visiblevoid
void
markForUpdate
(Render render) void
Regenerates the name indexvoid
setColorMax
(double[] colorMax) void
setColorMax
(float[] colorMax) void
setColorMin
(double[] colorMin) void
setColorMin
(float[] colorMin) void
setColornoise
(Double colorNoise) void
setColorNoise
(Double colorNoise) void
setData
(List<IParticleRecord> pointData) void
setData
(List<IParticleRecord> pointData, boolean regenerateIndex) void
setDatafile
(String datafile) void
void
setFocusIndex
(int index) void
setFocusIndex
(String name) void
setParticlesizelimits
(double[] sizeLimits) void
setParticleSizeLimits
(double[] sizeLimits) void
setPosition
(double[] pos) void
setPosition
(int[] pos) void
setPositionKm
(double[] pos) void
setPositionPc
(double[] pos) void
setPosKm
(double[] pos) void
setPosPc
(double[] pos) void
setProfiledecay
(Double profiledecay) void
setProfileDecay
(Double profileDecay) void
setProviderparams
(Map<String, Object> params) void
setVisible
(boolean visible, String name, Render render) void
setVisible
(int index, boolean visible, Render render) Sets the visibility of the particle with the given index.void
updateFocus
(ICamera camera) Updates the parameters of the focus, if the focus is active in this groupvoid
-
Field Details
-
idSeq
public static long idSeq -
D31
-
pointData
List that contains the point data. It contains only [x y z] -
isStars
public boolean isStarsFlag indicating whether the particle set holds stars or particles. -
provider
Fully qualified name of data provider class -
datafile
Path of data file -
providerParams
-
profileDecay
public float profileDecayProfile decay of the particles in the shader -
colorNoise
public float colorNoiseNoise factor for the color in [0,1] -
particleSizeLimitsPoint
public double[] particleSizeLimitsPointParticle size limits. Applies to legacy point render (using GL_POINTS). -
particleSizeLimits
public double[] particleSizeLimitsParticle 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 thatsize = tan(angle) * dist
-
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
Factor to apply to the data points, usually to normalise distances -
ccMin
public float[] ccMinMapping colors -
ccMax
public float[] ccMaxMapping colors -
lastSortTime
public long lastSortTimeStores the time when the last sort operation finished, in ms -
meanDistance
public double meanDistanceThe mean distance from the origin of all points in this group. Gives a sense of the scale. -
maxDistance
public double maxDistance -
minDistance
public double minDistance -
focus
Reference to the current focus. -
focusIndex
public int focusIndexIndex of the particle acting as focus. Negative if we have no focus here. -
candidateFocusIndex
public int candidateFocusIndexCandidate to focus. -
focusPosition
Position of the current focus -
focusPositionSph
Position in equatorial coordinates of the current focus in radians -
focusDistToCamera
public double focusDistToCameraFOCUS_MODE attributes -
focusSolidAngle
public double focusSolidAngleFOCUS_MODE attributes -
focusSolidAngleApparent
public double focusSolidAngleApparentFOCUS_MODE attributes -
focusSize
public double focusSizeFOCUS_MODE attributes -
proximity
Proximity particles -
disposed
public boolean disposed -
index
-
metadata
public double[] metadata -
indices1
-
indices2
-
active
-
background
-
visibilityArray
public byte[] visibilityArray -
updating
public volatile boolean updating -
updaterTask
-
lastSortCameraPos
-
cPosD
-
-
Constructor Details
-
ParticleSet
public ParticleSet()
-
-
Method Details
-
getColorMin
public float[] getColorMin() -
setColorMin
public void setColorMin(double[] colorMin) -
setColorMin
public void setColorMin(float[] colorMin) -
getColorMax
public float[] getColorMax() -
setColorMax
public void setColorMax(double[] colorMax) -
setColorMax
public void setColorMax(float[] colorMax) -
getMeanDistance
public double getMeanDistance() -
getMinDistance
public double getMinDistance() -
getMaxDistance
public double getMaxDistance() -
data
Returns the list of particles. -
setData
-
setData
-
regenerateIndex
public void regenerateIndex()Regenerates the name index -
generateIndex
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
-
setPosition
public void setPosition(double[] pos) -
setPosKm
public void setPosKm(double[] pos) -
setPositionKm
public void setPositionKm(double[] pos) -
setPosPc
public void setPosPc(double[] pos) -
setPositionPc
public void setPositionPc(double[] pos) -
setPosition
public void setPosition(int[] pos) -
setDatafile
-
setProviderparams
-
setFactor
-
setProfiledecay
-
setProfileDecay
-
setColornoise
-
setColorNoise
-
setParticleSizeLimits
public void setParticleSizeLimits(double[] sizeLimits) -
setParticlesizelimits
public void setParticlesizelimits(double[] sizeLimits) -
get
-
getRandomParticleName
Gets the name of a random particle in this group- Returns:
- The name of a random particle
-
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
-
getFocusSize
public double getFocusSize()Default size if not in data, 1e5 km- Returns:
- The size
-
setFocusIndex
-
getCandidateBean
-
getRadius
public double getRadius() -
getRadius
public double getRadius(int i) -
updateFocus
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() -
isVisible
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
-
setVisible
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 particlevisible
- Visibility flag
-
markForUpdate
-
getAbsolutePosition
Returns the current focus position, if any, in the out vector. -
getAbsolutePosition
Returns the position of the particle with the given name, if any, in the out vector. -
fetchPosition
public Vector3d fetchPosition(IParticleRecord pb, Vector3d campos, Vector3d destination, double deltaYears) Fetches the real position of the particle. It will apply the necessary integrations (i.e. proper motion).- Parameters:
pb
- The particle beancampos
- 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.destination
- The destination factordeltaYears
- The delta years- Returns:
- The vector for chaining
-
getDeltaYears
public double getDeltaYears()Returns the delta years to integrate the proper motion.- Returns:
- The current delta years.
-
getId
public long getId() -
getCandidateName
-
getName
-
getNames
-
getLocalizedName
-
getCandidateId
public long getCandidateId() -
getCandidateSolidAngleApparent
public double getCandidateSolidAngleApparent() -
getClosestName
-
canSelect
-
getPosSph
-
getAlpha
public double getAlpha() -
getDelta
public double getDelta() -
getDistToCamera
public double getDistToCamera() -
getSolidAngle
public double getSolidAngle() -
getSolidAngleApparent
public double getSolidAngleApparent() -
dispose
public void dispose(com.badlogic.ashley.core.Entity entity) - Specified by:
dispose
in interfaceIDisposable
-