Class AbstractPositionEntity
- java.lang.Object
-
- gaia.cu9.ari.gaiaorbit.scenegraph.SceneGraphNode
-
- gaia.cu9.ari.gaiaorbit.scenegraph.AbstractPositionEntity
-
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,IStarContainer,IPosition
- Direct Known Subclasses:
Area,CelestialBody,ConstellationBoundaries,CosmicRuler,FadeNode,Loc,MilkyWay,StarCluster,VertsObject
public abstract class AbstractPositionEntity extends SceneGraphNode
A base abstract graphical entity with the basics.
-
-
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 float[]ccBase colorprotected IBodyCoordinatescoordinatesCoordinates provider.booleancopyIs this just a copy?doubledistToCameraThe distance to the camera from the focus center.OctreeNodeoctantIts pagejava.lang.LongoctantIdThe id of the octant it belongs to, if anyVector3dposPosition of this entity in the local reference system.Vector2dposSphPosition in the equatorial system; ra, dec.floatsizeSize factor in internal units.doubleviewAngleThe view angle, in radians.doubleviewAngleApparentThe view angle corrected with the field of view angle, in radians.-
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 Modifier Constructor Description protectedAbstractPositionEntity()AbstractPositionEntity(SceneGraphNode parent)AbstractPositionEntity(java.lang.String name)AbstractPositionEntity(java.lang.String name, SceneGraphNode parent)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidaddToRenderLists(ICamera camera)Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.Vector3dcomputeFuturePosition()voiddoneLoading(com.badlogic.gdx.assets.AssetManager manager)Matrix4dgetAbsoluteOrientation(Matrix4d aux)Vector3dgetAbsolutePosition(Vector3d aux)Returns the absolute position of this entity in the native coordinates (equatorial system)Vector3dgetAbsolutePosition(java.lang.String name, Vector3d aux)doublegetAlpha()doublegetDelta()doublegetDistToCamera()Returns the current distance to the camera in internal units.doublegetHeight(Vector3d camPos)doublegetHeight(Vector3d camPos, boolean useFuturePosition)doublegetHeight(Vector3d camPos, Vector3d nextPos)doublegetHeightScale()IFocusgetNext(ITimeFrameProvider time, ICamera camera, boolean force)Gets a copy of this entity which mimics its state in the next time step with position, orientation, etc.OctreeNodegetOctant()Vector3dgetPos()Vector3dgetPosition()Vector3dgetPosition(Vector3d aux)Returns the position of this entity in the internal reference system.Vector2dgetPosSph()Vector3dgetPredictedPosition(Vector3d aux, ITimeFrameProvider time, ICamera camera, boolean force)Gets the position of this entity in the next time step in the internal reference system using the given time provider and the given camera.doublegetRadius()Returns the radius in internal units<T extends SceneGraphNode>
TgetSimpleCopy()Gets a copy of this object but does not copy its parent or childrendoublegetSize()Returns the size (diameter) of this entity in internal units.doublegetViewAngle()Returns the current view angle of this entity, in radians.doublegetViewAngleApparent()Returns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.booleanisCopy()protected booleanmustUpdatePosition(ITimeFrameProvider time)Whether position must be recomputed for this entity.protected voidrender2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, java.lang.String label, float x, float y)protected voidrender2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, java.lang.String label, float x, float y, float scale)protected voidrender2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, java.lang.String label, float x, float y, float scale, int align)protected voidrender2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, java.lang.String label, Vector3d pos3d)protected voidrender3DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, BitmapFont font, ICamera camera, RenderingContext rc, java.lang.String label, Vector3d pos, float scale, float size)voidsetColor(double[] color)voidsetColor(float[] color)voidsetCoordinates(IBodyCoordinates coord)voidsetSize(java.lang.Double size)Sets the absolute size (diameter) of this entityvoidsetSize(java.lang.Long size)Sets the absolute size (diameter) of this entityvoidupdateLocal(ITimeFrameProvider time, ICamera camera)Updates the local transform matrix.abstract voidupdateLocalValues(ITimeFrameProvider time, ICamera camera)This function updates all the local values before the localTransform is updated.-
Methods inherited from class gaia.cu9.ari.gaiaorbit.scenegraph.SceneGraphNode
add, add, addChild, addChild, addFocusableObjects, addNodes, addToIndex, addToRender, dispose, getAggregatedChildren, getChildByName, getChildByNameAndType, getChildrenByType, getComponentType, getCt, getFirstStarAncestor, getId, getLineCopy, getName, getNode, getNode, getOpacity, getOrientation, getRoot, getSceneGraphDepth, getStarCount, getVelocity, initialize, insert, isInRender, isInRender, isValidPosition, isVisibilityOn, mustAddToIndex, removeChild, removeFromIndex, removeFromRender, returnToPool, setComputedFlag, setCt, setCt, setId, setName, setNamekey, setParent, setParentkey, setUp, toString, update, update, updateNames, updateNamesRec
-
-
-
-
Field Detail
-
pos
public Vector3d pos
Position of this entity in the local reference system. The units areConstants.U_TO_KMby default.
-
coordinates
protected IBodyCoordinates coordinates
Coordinates provider. Helps updating the position at each time step.
-
posSph
public Vector2d posSph
Position in the equatorial system; ra, dec.
-
size
public float size
Size factor in internal units.
-
distToCamera
public double distToCamera
The distance to the camera from the focus center.
-
viewAngle
public double viewAngle
The view angle, in radians.
-
viewAngleApparent
public double viewAngleApparent
The view angle corrected with the field of view angle, in radians.
-
cc
public float[] cc
Base color
-
copy
public boolean copy
Is this just a copy?
-
octantId
public java.lang.Long octantId
The id of the octant it belongs to, if any
-
octant
public OctreeNode octant
Its page
-
-
Constructor Detail
-
AbstractPositionEntity
protected AbstractPositionEntity()
-
AbstractPositionEntity
public AbstractPositionEntity(java.lang.String name, SceneGraphNode parent)
-
AbstractPositionEntity
public AbstractPositionEntity(SceneGraphNode parent)
-
AbstractPositionEntity
public AbstractPositionEntity(java.lang.String name)
-
-
Method Detail
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager)
- Overrides:
doneLoadingin classSceneGraphNode
-
getPos
public Vector3d getPos()
-
isCopy
public boolean isCopy()
-
getPosition
public Vector3d getPosition(Vector3d aux)
Returns the position of this entity in the internal reference system.- Parameters:
aux- The vector where the result will be put- Returns:
- The aux vector with the position
-
getNext
public IFocus getNext(ITimeFrameProvider time, ICamera camera, boolean force)
Gets a copy of this entity which mimics its state in the next time step with position, orientation, etc.- Returns:
- A copy of this entity in the next time step
-
getPredictedPosition
public Vector3d getPredictedPosition(Vector3d aux, ITimeFrameProvider time, ICamera camera, boolean force)
Gets the position of this entity in the next time step in the internal reference system using the given time provider and the given camera.- Parameters:
aux- The out vector where the result will be stored.time- The time frame provider.camera- The camera.force- Whether to force the computation if time is off.- Returns:
- The aux vector for chaining.
-
mustUpdatePosition
protected boolean mustUpdatePosition(ITimeFrameProvider time)
Whether position must be recomputed for this entity. By default, only when time is on- Parameters:
time- The current time- Returns:
- True if position should be recomputed for this entity
-
getAbsolutePosition
public Vector3d getAbsolutePosition(Vector3d aux)
Returns the absolute position of this entity in the native coordinates (equatorial system)- Parameters:
aux- Auxiliary vector to put the result in- Returns:
- The vector with the position
-
updateLocal
public void updateLocal(ITimeFrameProvider time, ICamera camera)
Updates the local transform matrix.- Overrides:
updateLocalin classSceneGraphNode- Parameters:
time-
-
addToRenderLists
protected abstract 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.
-
updateLocalValues
public abstract void updateLocalValues(ITimeFrameProvider time, ICamera camera)
This function updates all the local values before the localTransform is updated. Position, rotations and scale must be updated in here.- Parameters:
time-camera-
-
getRadius
public double getRadius()
Returns the radius in internal units- Returns:
- The radius of the object, in internal units
-
getHeight
public double getHeight(Vector3d camPos)
-
getHeight
public double getHeight(Vector3d camPos, boolean useFuturePosition)
-
getHeightScale
public double getHeightScale()
-
getSize
public double getSize()
Returns the size (diameter) of this entity in internal units.- Returns:
- The size in internal units.
-
setSize
public void setSize(java.lang.Double size)
Sets the absolute size (diameter) of this entity- Parameters:
size- The diameter in internal units
-
setSize
public void setSize(java.lang.Long size)
Sets the absolute size (diameter) of this entity- Parameters:
size- The diameter in internal units
-
getPosSph
public Vector2d getPosSph()
-
getAlpha
public double getAlpha()
-
getDelta
public double getDelta()
-
setColor
public void setColor(double[] color)
-
setColor
public void setColor(float[] color)
-
getOctant
public OctreeNode getOctant()
-
computeFuturePosition
public Vector3d computeFuturePosition()
-
getSimpleCopy
public <T extends SceneGraphNode> T getSimpleCopy()
Gets a copy of this object but does not copy its parent or children- Overrides:
getSimpleCopyin classSceneGraphNode- Returns:
- The copied object
-
getDistToCamera
public double getDistToCamera()
Returns the current distance to the camera in internal units.- Returns:
- The current distance to the camera, in internal units.
-
getViewAngle
public double getViewAngle()
Returns the current view angle of this entity, in radians.- Returns:
- The view angle in radians.
-
getViewAngleApparent
public double getViewAngleApparent()
Returns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.- Returns:
- The apparent view angle in radians.
-
render2DLabel
protected void render2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, java.lang.String label, Vector3d pos3d)
-
render2DLabel
protected void render2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, java.lang.String label, float x, float y)
-
render2DLabel
protected void render2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, java.lang.String label, float x, float y, float scale)
-
render2DLabel
protected void render2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, java.lang.String label, float x, float y, float scale, int align)
-
render3DLabel
protected void render3DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, BitmapFont font, ICamera camera, RenderingContext rc, java.lang.String label, Vector3d pos, float scale, float size)
-
setCoordinates
public void setCoordinates(IBodyCoordinates coord)
-
getPosition
public Vector3d getPosition()
- Specified by:
getPositionin interfaceIPosition- Overrides:
getPositionin classSceneGraphNode
-
-