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[]
cc
Base colorprotected IBodyCoordinates
coordinates
Coordinates provider.boolean
copy
Is this just a copy?double
distToCamera
The distance to the camera from the focus center.OctreeNode
octant
Its pagejava.lang.Long
octantId
The id of the octant it belongs to, if anyVector3d
pos
Position of this entity in the local reference system.Vector2d
posSph
Position in the equatorial system; ra, dec.float
size
Size factor in internal units.double
viewAngle
The view angle, in radians.double
viewAngleApparent
The 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 protected
AbstractPositionEntity()
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 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.Vector3d
computeFuturePosition()
void
doneLoading(com.badlogic.gdx.assets.AssetManager manager)
Matrix4d
getAbsoluteOrientation(Matrix4d aux)
Vector3d
getAbsolutePosition(Vector3d aux)
Returns the absolute position of this entity in the native coordinates (equatorial system)Vector3d
getAbsolutePosition(java.lang.String name, Vector3d aux)
double
getAlpha()
double
getDelta()
double
getDistToCamera()
Returns the current distance to the camera in internal units.double
getHeight(Vector3d camPos)
double
getHeight(Vector3d camPos, boolean useFuturePosition)
double
getHeight(Vector3d camPos, Vector3d nextPos)
double
getHeightScale()
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.OctreeNode
getOctant()
Vector3d
getPos()
Vector3d
getPosition()
Vector3d
getPosition(Vector3d aux)
Returns the position of this entity in the internal reference system.Vector2d
getPosSph()
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.double
getRadius()
Returns the radius in internal units<T extends SceneGraphNode>
TgetSimpleCopy()
Gets a copy of this object but does not copy its parent or childrendouble
getSize()
Returns the size (diameter) of this entity in internal units.double
getViewAngle()
Returns the current view angle of this entity, in radians.double
getViewAngleApparent()
Returns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.boolean
isCopy()
protected boolean
mustUpdatePosition(ITimeFrameProvider time)
Whether position must be recomputed for this entity.protected void
render2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, java.lang.String label, float x, float y)
protected void
render2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, java.lang.String label, float x, float y, float scale)
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)
protected void
render2DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, RenderingContext rc, BitmapFont font, ICamera camera, java.lang.String label, Vector3d pos3d)
protected void
render3DLabel(ExtSpriteBatch batch, ExtShaderProgram shader, BitmapFont font, ICamera camera, RenderingContext rc, java.lang.String label, Vector3d pos, float scale, float size)
void
setColor(double[] color)
void
setColor(float[] color)
void
setCoordinates(IBodyCoordinates coord)
void
setSize(java.lang.Double size)
Sets the absolute size (diameter) of this entityvoid
setSize(java.lang.Long size)
Sets the absolute size (diameter) of this entityvoid
updateLocal(ITimeFrameProvider time, ICamera camera)
Updates the local transform matrix.abstract void
updateLocalValues(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_KM
by 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:
doneLoading
in 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:
updateLocal
in 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:
getSimpleCopy
in 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:
getPosition
in interfaceIPosition
- Overrides:
getPosition
in classSceneGraphNode
-
-