Class StarCluster
- java.lang.Object
-
- gaia.cu9.ari.gaiaorbit.scenegraph.SceneGraphNode
-
- gaia.cu9.ari.gaiaorbit.scenegraph.AbstractPositionEntity
-
- gaia.cu9.ari.gaiaorbit.scenegraph.StarCluster
-
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,I3DTextRenderable
,IModelRenderable
,IQuadRenderable
,IRenderable
,IFocus
,IProperMotion
,IStarContainer
,IPosition
public class StarCluster extends AbstractPositionEntity implements IFocus, IProperMotion, IModelRenderable, I3DTextRenderable, IQuadRenderable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gaia.cu9.ari.gaiaorbit.scenegraph.SceneGraphNode
SceneGraphNode.RenderGroup, SceneGraphNode.TLV3, SceneGraphNode.TLV3D
-
-
Field Summary
Fields Modifier and Type Field Description protected double
dist
protected float
fadeAlpha
Fade alpha between quad and model.protected float[]
labelcolor
protected int
nstars
protected Vector3d
pm
Proper motion in units/yearprotected com.badlogic.gdx.math.Vector3
pmSph
Proper motion in mas/yearprotected double
raddeg
protected double
ySinceEpoch
-
Fields inherited from class gaia.cu9.ari.gaiaorbit.scenegraph.AbstractPositionEntity
cc, coordinates, copy, distToCamera, octant, octantId, pos, posSph, size, viewAngle, viewAngleApparent
-
Fields inherited from class gaia.cu9.ari.gaiaorbit.scenegraph.SceneGraphNode
aux3d1, aux3d2, aux3d3, aux3d4, aux3f1, aux3f2, aux3f3, aux3f4, children, computed, ct, id, localTransform, name, namekey, numChildren, opacity, orientation, parent, parentkey, parentName, ROOT_NAME, sg, translation
-
-
Constructor Summary
Constructors Constructor Description StarCluster()
StarCluster(java.lang.String name, java.lang.String parentName, Vector3d pos, Vector3d pm, Vector3d posSph, com.badlogic.gdx.math.Vector3 pmSph, double raddeg, int nstars)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFocusableObjects(com.badlogic.gdx.utils.Array<IFocus> list)
Adds all the children that are focusable objects to the list.void
addHit(int screenX, int screenY, int w, int h, int pxdist, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)
Adds this focus to the hits list if it is hit by the [screenX, screenY] positionvoid
addHit(Vector3d p0, Vector3d p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)
Adds this focus to the hits list if it is hit by the given rayprotected void
addToRenderLists(ICamera camera)
Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.protected boolean
checkClickDistance(int screenX, int screenY, com.badlogic.gdx.math.Vector3 pos, NaturalCamera camera, com.badlogic.gdx.graphics.PerspectiveCamera pcamera, double pixelSize)
void
doneLoading(com.badlogic.gdx.assets.AssetManager manager)
float
getAbsmag()
Gets the absolute magnitudeVector3d
getAbsolutePosition(Vector3d aux)
Returns the absolute position of this entity in the native coordinates (equatorial system)float
getAppmag()
Gets the apparent magnitudelong
getCandidateId()
Returns the id of the focus candidate of this object.java.lang.String
getCandidateName()
Returns the name of the focus candidate of this object.double
getCandidateViewAngleApparent()
Returns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radiansVector3d
getClosestAbsolutePos(Vector3d out)
double
getClosestDistToCamera()
Same asIFocus.getDistToCamera()
java.lang.String
getClosestName()
Same asIFocus.getName()
IFocus
getFocus(java.lang.String name)
Prepares the candidate with the given namedouble
getMuAlpha()
Returns the mu alpha in mas/yrdouble
getMuDelta()
Returns the mu delta in mas/yrint
getNStars()
Quaterniond
getOrientationQuaternion()
Returns the orientation quaternion of this focusdouble
getRadialVelocity()
Returns the radial velocity in km/sRotationComponent
getRotationComponent()
Returns the rotation component of this focus<T extends SceneGraphNode>
TgetSimpleCopy()
Gets a copy of this object but does not copy its parent or childrenfloat
getTextOpacity()
Gets the text opacityboolean
hasAtmosphere()
void
initialize()
void
initModel()
boolean
isActive()
Returns whether this focus object is active or not.boolean
isCoordinatesTimeOverflow()
Checks whether this foucs is within its valid time range, so that it can be used as a focusboolean
isLabel()
Is it a label or another kind of text?void
makeFocus()
Hook that runs when the candidate is actually made focusvoid
render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)
Label renderingvoid
render(IntModelBatch modelBatch, float alpha, double t, RenderingContext rc)
Model renderingvoid
render(ExtShaderProgram shader, float alpha, IntMesh mesh, ICamera camera)
Billboard quad renderingboolean
renderText()
Tells whether the text must be rendered or not for this entityjava.lang.String
text()
Returns the textfloat[]
textColour()
Returns an array with the text colour in the fashion [r, g, b, a]void
textDepthBuffer()
Executes the blending for the textvoid
textPosition(ICamera cam, Vector3d out)
Sets the position of this text in the out vectorfloat
textScale()
Returns the text scale for the scale varying in the shaderfloat
textSize()
Returns the text sizevoid
updateLocal(ITimeFrameProvider time, ICamera camera)
Updates the local transform matrix.void
updateLocalValues(ITimeFrameProvider time, ICamera camera)
This function updates all the local values before the localTransform is updated.boolean
withinMagLimit()
Returns true if the focus is within the magnitude limit defined inGlobalConf
-
Methods inherited from class gaia.cu9.ari.gaiaorbit.scenegraph.AbstractPositionEntity
computeFuturePosition, getAbsoluteOrientation, getAbsolutePosition, getAlpha, getDelta, getDistToCamera, getHeight, getHeight, getHeight, getHeightScale, getNext, getOctant, getPos, getPosition, getPosition, getPosSph, getPredictedPosition, getRadius, getSize, getViewAngle, getViewAngleApparent, isCopy, mustUpdatePosition, render2DLabel, render2DLabel, render2DLabel, render2DLabel, render3DLabel, setColor, setColor, setCoordinates, setSize, setSize
-
Methods inherited from class gaia.cu9.ari.gaiaorbit.scenegraph.SceneGraphNode
add, add, addChild, addChild, addNodes, addToIndex, addToRender, dispose, getAggregatedChildren, getChildByName, getChildByNameAndType, getChildrenByType, getComponentType, getCt, getFirstStarAncestor, getId, getLineCopy, getName, getNode, getNode, getOpacity, getOrientation, getRoot, getSceneGraphDepth, getStarCount, getVelocity, insert, isInRender, isInRender, isValidPosition, isVisibilityOn, mustAddToIndex, removeChild, removeFromIndex, removeFromRender, returnToPool, setComputedFlag, setCt, setCt, setId, setName, setNamekey, setParent, setParentkey, setUp, toString, update, update, updateNames, updateNamesRec
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gaia.cu9.ari.gaiaorbit.scenegraph.IFocus
getAbsolutePosition, getAlpha, getCt, getDelta, getDistToCamera, getFirstStarAncestor, getHeight, getHeight, getHeight, getHeightScale, getId, getName, getNext, getOctant, getOrientation, getPos, getPosSph, getPredictedPosition, getRadius, getSceneGraphDepth, getSize, getViewAngle, getViewAngleApparent, isCopy
-
Methods inherited from interface gaia.cu9.ari.gaiaorbit.render.IRenderable
getComponentType, getDistToCamera, getOpacity
-
-
-
-
Field Detail
-
pm
protected Vector3d pm
Proper motion in units/year
-
pmSph
protected com.badlogic.gdx.math.Vector3 pmSph
Proper motion in mas/year
-
labelcolor
protected float[] labelcolor
-
dist
protected double dist
-
raddeg
protected double raddeg
-
nstars
protected int nstars
-
ySinceEpoch
protected double ySinceEpoch
-
fadeAlpha
protected float fadeAlpha
Fade alpha between quad and model. Attribute contains model opacity. Quad opacity is1-fadeAlpha
-
-
Method Detail
-
initModel
public void initModel()
-
initialize
public void initialize()
- Overrides:
initialize
in classSceneGraphNode
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager)
- Overrides:
doneLoading
in classAbstractPositionEntity
-
updateLocal
public void updateLocal(ITimeFrameProvider time, ICamera camera)
Updates the local transform matrix.- Overrides:
updateLocal
in classAbstractPositionEntity
- Parameters:
time
-
-
updateLocalValues
public void updateLocalValues(ITimeFrameProvider time, ICamera camera)
Description copied from class:AbstractPositionEntity
This function updates all the local values before the localTransform is updated. Position, rotations and scale must be updated in here.- Specified by:
updateLocalValues
in classAbstractPositionEntity
-
addToRenderLists
protected void addToRenderLists(ICamera camera)
Description copied from class:AbstractPositionEntity
Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.- Specified by:
addToRenderLists
in classAbstractPositionEntity
-
getAbsolutePosition
public Vector3d getAbsolutePosition(Vector3d aux)
Description copied from class:AbstractPositionEntity
Returns the absolute position of this entity in the native coordinates (equatorial system)- Specified by:
getAbsolutePosition
in interfaceIFocus
- Overrides:
getAbsolutePosition
in classAbstractPositionEntity
- Parameters:
aux
- Auxiliary vector to put the result in- Returns:
- The vector with the position
-
render
public void render(IntModelBatch modelBatch, float alpha, double t, RenderingContext rc)
Model rendering- Specified by:
render
in interfaceIModelRenderable
-
render
public void render(ExtShaderProgram shader, float alpha, IntMesh mesh, ICamera camera)
Billboard quad rendering- Specified by:
render
in interfaceIQuadRenderable
-
render
public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)
Label rendering- Specified by:
render
in interfaceI3DTextRenderable
- Parameters:
batch
- The sprite batchshader
- The shadersys
- The font render systemrc
- The render contextcamera
- The camera
-
hasAtmosphere
public boolean hasAtmosphere()
- Specified by:
hasAtmosphere
in interfaceIModelRenderable
-
renderText
public boolean renderText()
Description copied from interface:I3DTextRenderable
Tells whether the text must be rendered or not for this entity- Specified by:
renderText
in interfaceI3DTextRenderable
- Returns:
- True if text must be rendered
-
textColour
public float[] textColour()
Description copied from interface:I3DTextRenderable
Returns an array with the text colour in the fashion [r, g, b, a]- Specified by:
textColour
in interfaceI3DTextRenderable
- Returns:
- Array with the colour
-
textSize
public float textSize()
Description copied from interface:I3DTextRenderable
Returns the text size- Specified by:
textSize
in interfaceI3DTextRenderable
- Returns:
- The text size
-
textScale
public float textScale()
Description copied from interface:I3DTextRenderable
Returns the text scale for the scale varying in the shader- Specified by:
textScale
in interfaceI3DTextRenderable
- Returns:
- The scale
-
textPosition
public void textPosition(ICamera cam, Vector3d out)
Description copied from interface:I3DTextRenderable
Sets the position of this text in the out vector- Specified by:
textPosition
in interfaceI3DTextRenderable
out
- The out parameter with the result
-
text
public java.lang.String text()
Description copied from interface:I3DTextRenderable
Returns the text- Specified by:
text
in interfaceI3DTextRenderable
- Returns:
- The text
-
textDepthBuffer
public void textDepthBuffer()
Description copied from interface:I3DTextRenderable
Executes the blending for the text- Specified by:
textDepthBuffer
in interfaceI3DTextRenderable
-
isLabel
public boolean isLabel()
Description copied from interface:I3DTextRenderable
Is it a label or another kind of text?- Specified by:
isLabel
in interfaceI3DTextRenderable
- Returns:
- Whether this is a label
-
getCandidateId
public long getCandidateId()
Description copied from interface:IFocus
Returns the id of the focus candidate of this object. Defaults toIFocus.getId()
- Specified by:
getCandidateId
in interfaceIFocus
- Returns:
- The id of the candidate
-
getCandidateName
public java.lang.String getCandidateName()
Description copied from interface:IFocus
Returns the name of the focus candidate of this object. Defaults toIFocus.getName()
- Specified by:
getCandidateName
in interfaceIFocus
- Returns:
- The name of the candidate
-
isActive
public boolean isActive()
Description copied from interface:IFocus
Returns whether this focus object is active or not. Useful for particle groups
-
addFocusableObjects
public void addFocusableObjects(com.badlogic.gdx.utils.Array<IFocus> list)
Adds all the children that are focusable objects to the list.- Overrides:
addFocusableObjects
in classSceneGraphNode
- Parameters:
list
-
-
withinMagLimit
public boolean withinMagLimit()
Description copied from interface:IFocus
Returns true if the focus is within the magnitude limit defined inGlobalConf
- Specified by:
withinMagLimit
in interfaceIFocus
- Returns:
- True if focus within magnitude limit
-
getCandidateViewAngleApparent
public double getCandidateViewAngleApparent()
Description copied from interface:IFocus
Returns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians- Specified by:
getCandidateViewAngleApparent
in interfaceIFocus
- Returns:
- The apparent view angle in radians
-
getAppmag
public float getAppmag()
Description copied from interface:IFocus
Gets the apparent magnitude
-
getAbsmag
public float getAbsmag()
Description copied from interface:IFocus
Gets the absolute magnitude
-
getRotationComponent
public RotationComponent getRotationComponent()
Description copied from interface:IFocus
Returns the rotation component of this focus- Specified by:
getRotationComponent
in interfaceIFocus
- Returns:
- The rotation component. Can be null
-
getOrientationQuaternion
public Quaterniond getOrientationQuaternion()
Description copied from interface:IFocus
Returns the orientation quaternion of this focus- Specified by:
getOrientationQuaternion
in interfaceIFocus
- Returns:
- The orientation quaternion. Can be null
-
addHit
public void addHit(int screenX, int screenY, int w, int h, int pxdist, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)
Description copied from interface:IFocus
Adds this focus to the hits list if it is hit by the [screenX, screenY] position
-
addHit
public void addHit(Vector3d p0, Vector3d p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)
Description copied from interface:IFocus
Adds this focus to the hits list if it is hit by the given ray
-
checkClickDistance
protected boolean checkClickDistance(int screenX, int screenY, com.badlogic.gdx.math.Vector3 pos, NaturalCamera camera, com.badlogic.gdx.graphics.PerspectiveCamera pcamera, double pixelSize)
-
makeFocus
public void makeFocus()
Description copied from interface:IFocus
Hook that runs when the candidate is actually made focus
-
getFocus
public IFocus getFocus(java.lang.String name)
Description copied from interface:IFocus
Prepares the candidate with the given name
-
getClosestName
public java.lang.String getClosestName()
Description copied from interface:IFocus
Same asIFocus.getName()
- Specified by:
getClosestName
in interfaceIFocus
- Returns:
- The name
-
getClosestDistToCamera
public double getClosestDistToCamera()
Description copied from interface:IFocus
Same asIFocus.getDistToCamera()
- Specified by:
getClosestDistToCamera
in interfaceIFocus
- Returns:
- The distance to the camera in internal units
-
getClosestAbsolutePos
public Vector3d getClosestAbsolutePos(Vector3d out)
Description copied from interface:IFocus
- Specified by:
getClosestAbsolutePos
in interfaceIFocus
- Parameters:
out
- Vector3d where to put the return value- Returns:
- The absolute position, same as aux
-
isCoordinatesTimeOverflow
public boolean isCoordinatesTimeOverflow()
Description copied from interface:IFocus
Checks whether this foucs is within its valid time range, so that it can be used as a focus- Specified by:
isCoordinatesTimeOverflow
in interfaceIFocus
- Returns:
- Whether the focus object is within its valid time range
-
getMuAlpha
public double getMuAlpha()
Description copied from interface:IProperMotion
Returns the mu alpha in mas/yr- Specified by:
getMuAlpha
in interfaceIProperMotion
- Returns:
- The mu alpha in mas/yr
-
getMuDelta
public double getMuDelta()
Description copied from interface:IProperMotion
Returns the mu delta in mas/yr- Specified by:
getMuDelta
in interfaceIProperMotion
- Returns:
- The mu delta in mas/yr
-
getRadialVelocity
public double getRadialVelocity()
Description copied from interface:IProperMotion
Returns the radial velocity in km/s- Specified by:
getRadialVelocity
in interfaceIProperMotion
- Returns:
- The radial velocity in km/s
-
getNStars
public int getNStars()
-
getTextOpacity
public float getTextOpacity()
Description copied from interface:I3DTextRenderable
Gets the text opacity- Specified by:
getTextOpacity
in interfaceI3DTextRenderable
- Returns:
- Text opacity
-
getSimpleCopy
public <T extends SceneGraphNode> T getSimpleCopy()
Description copied from class:AbstractPositionEntity
Gets a copy of this object but does not copy its parent or children- Overrides:
getSimpleCopy
in classAbstractPositionEntity
- Returns:
- The copied object
-
-