Package gaiasky.scenegraph
Class Loc
- java.lang.Object
-
- gaiasky.scenegraph.SceneGraphNode
-
- gaiasky.scenegraph.AbstractPositionEntity
-
- gaiasky.scenegraph.Loc
-
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,I3DTextRenderable,ILineRenderable,IRenderable,IFocus,IStarContainer,IPosition
public class Loc extends AbstractPositionEntity implements IFocus, I3DTextRenderable, ILineRenderable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gaiasky.scenegraph.SceneGraphNode
SceneGraphNode.RenderGroup, SceneGraphNode.TLV3, SceneGraphNode.TLV3D
-
-
Field Summary
-
Fields inherited from class gaiasky.scenegraph.AbstractPositionEntity
cc, coordinates, copy, distToCamera, octant, octantId, pos, posSph, size, viewAngle, viewAngleApparent
-
Fields inherited from class gaiasky.scenegraph.SceneGraphNode
aux3d1, aux3d2, aux3d3, aux3d4, aux3f1, aux3f2, aux3f3, aux3f4, children, computed, ct, id, localTransform, namekey, names, numChildren, opacity, orientation, parent, parentkey, parentName, ROOT_NAME, sg, translation
-
-
Constructor Summary
Constructors Constructor Description Loc()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHit(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] positionvoidaddHit(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 voidaddToRenderLists(ICamera camera)Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.floatgetAbsmag()Gets the absolute magnitudeVector3dgetAbsolutePosition(Vector3d out)Returns the absolute position of this entity in the native coordinates (equatorial system) and internal unitsfloatgetAppmag()Gets the apparent magnitudelonggetCandidateId()Returns the id of the focus candidate of this object.java.lang.StringgetCandidateName()Returns the name of the focus candidate of this object.doublegetCandidateViewAngleApparent()Returns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radiansVector3dgetClosestAbsolutePos(Vector3d out)doublegetClosestDistToCamera()Same asIFocus.getDistToCamera()java.lang.StringgetClosestName()Same asIFocus.getName()IFocusgetFocus(java.lang.String name)Prepares the candidate with the given nameintgetGlPrimitive()floatgetLineWidth()com.badlogic.gdx.math.Vector2getLocation()QuaterniondgetOrientationQuaternion()Returns the orientation quaternion of this focusRotationComponentgetRotationComponent()Returns the rotation component of this focusfloatgetTextOpacity()Gets the text opacityvoidinitialize()booleanisActive()Returns whether this focus object is active or not.booleanisCoordinatesTimeOverflow()Checks whether this foucs is within its valid time range, so that it can be used as a focusbooleanisLabel()Is it a label or another kind of text?voidmakeFocus()Hook that runs when the candidate is actually made focusbooleanmustAddToIndex()Whether to add this node to the indexvoidrender(LineRenderSystem renderer, ICamera camera, float alpha)voidrender(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)Label rendering.booleanrenderText()Tells whether the text must be rendered or not for this entityvoidsetDistFactor(java.lang.Double distFactor)voidsetLocation(double[] pos)voidsetName(java.lang.String name)voidsetSize(java.lang.Double size)Sets the absolute size of this entityvoidsetSize(java.lang.Long size)Sets the absolute size (diameter) of this entityjava.lang.Stringtext()Returns the textfloat[]textColour()Returns an array with the text colour in the fashion [r, g, b, a]voidtextDepthBuffer()Executes the blending for the textvoidtextPosition(ICamera cam, Vector3d out)Sets the position of this text in the out vectorfloattextScale()Returns the text scale for the scale varying in the shaderfloattextSize()Returns the text sizevoidupdateLocal(ITimeFrameProvider time, ICamera camera)Updates the local transform matrix.voidupdateLocalValues(ITimeFrameProvider time, ICamera camera)This function updates all the local values before the localTransform is updated.booleanwithinMagLimit()Returns true if the focus is within the magnitude limit defined inGlobalConf-
Methods inherited from class gaiasky.scenegraph.AbstractPositionEntity
computeFuturePosition, doneLoading, getAbsoluteOrientation, getAbsolutePosition, getAlpha, getDelta, getDistToCamera, getHeight, getHeight, getHeight, getHeightScale, getNext, getOctant, getPos, getPosition, getPosition, getPosSph, getPredictedPosition, getRadius, getSimpleCopy, getSize, getViewAngle, getViewAngleApparent, isCopy, mustUpdatePosition, render2DLabel, render2DLabel, render2DLabel, render2DLabel, render3DLabel, setColor, setColor, setCoordinates, setLabelcolor, setLabelcolor
-
Methods inherited from class gaiasky.scenegraph.SceneGraphNode
add, add, addChild, addChild, addFocusableObjects, addName, addNodes, addToIndex, addToRender, dispose, getAggregatedChildren, getChildByName, getChildByNameAndType, getChildrenByType, getComponentType, getCt, getFirstStarAncestor, getId, getLineCopy, getName, getNames, getNode, getNode, getOpacity, getOrientation, getRoot, getSceneGraphDepth, getStarCount, getVelocity, hasName, hasName, insert, insert, isInRender, isInRender, isValidPosition, isVisibilityOn, namesConcat, removeChild, removeFromIndex, removeFromRender, returnToPool, setComputedFlag, setCt, setCt, setId, setNamekey, setNames, 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 gaiasky.scenegraph.IFocus
getAbsolutePosition, getAlpha, getCt, getDelta, getDistToCamera, getFirstStarAncestor, getHeight, getHeight, getHeight, getHeightScale, getId, getName, getNames, getNext, getOctant, getOrientation, getPos, getPosSph, getPredictedPosition, getRadius, getSceneGraphDepth, getSize, getViewAngle, getViewAngleApparent, hasName, hasName, isCopy
-
Methods inherited from interface gaiasky.render.IRenderable
getComponentType, getDistToCamera, getOpacity
-
-
-
-
Method Detail
-
initialize
public void initialize()
- Overrides:
initializein classSceneGraphNode
-
addToRenderLists
protected void addToRenderLists(ICamera camera)
Description copied from class:AbstractPositionEntityAdds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.- Specified by:
addToRenderListsin classAbstractPositionEntity
-
updateLocal
public void updateLocal(ITimeFrameProvider time, ICamera camera)
Description copied from class:AbstractPositionEntityUpdates the local transform matrix.- Overrides:
updateLocalin classAbstractPositionEntity
-
updateLocalValues
public void updateLocalValues(ITimeFrameProvider time, ICamera camera)
Description copied from class:AbstractPositionEntityThis function updates all the local values before the localTransform is updated. Position, rotations and scale must be updated in here.- Specified by:
updateLocalValuesin classAbstractPositionEntity
-
getAbsolutePosition
public Vector3d getAbsolutePosition(Vector3d out)
Description copied from class:AbstractPositionEntityReturns the absolute position of this entity in the native coordinates (equatorial system) and internal units- Specified by:
getAbsolutePositionin interfaceIFocus- Overrides:
getAbsolutePositionin classAbstractPositionEntity- Parameters:
out- Auxiliary vector to put the result in- Returns:
- The vector with the position
-
getLocation
public com.badlogic.gdx.math.Vector2 getLocation()
-
setLocation
public void setLocation(double[] pos)
-
renderText
public boolean renderText()
Description copied from interface:I3DTextRenderableTells whether the text must be rendered or not for this entity- Specified by:
renderTextin interfaceI3DTextRenderable- Returns:
- True if text must be rendered
-
render
public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)
Label rendering.- Specified by:
renderin interfaceI3DTextRenderable- Parameters:
batch- The sprite batchshader- The shadersys- The font render systemrc- The render contextcamera- The camera
-
textColour
public float[] textColour()
Description copied from interface:I3DTextRenderableReturns an array with the text colour in the fashion [r, g, b, a]- Specified by:
textColourin interfaceI3DTextRenderable- Returns:
- Array with the colour
-
textSize
public float textSize()
Description copied from interface:I3DTextRenderableReturns the text size- Specified by:
textSizein interfaceI3DTextRenderable- Returns:
- The text size
-
textScale
public float textScale()
Description copied from interface:I3DTextRenderableReturns the text scale for the scale varying in the shader- Specified by:
textScalein interfaceI3DTextRenderable- Returns:
- The scale
-
textPosition
public void textPosition(ICamera cam, Vector3d out)
Description copied from interface:I3DTextRenderableSets the position of this text in the out vector- Specified by:
textPositionin interfaceI3DTextRenderableout- The out parameter with the result
-
text
public java.lang.String text()
Description copied from interface:I3DTextRenderableReturns the text- Specified by:
textin interfaceI3DTextRenderable- Returns:
- The text
-
textDepthBuffer
public void textDepthBuffer()
Description copied from interface:I3DTextRenderableExecutes the blending for the text- Specified by:
textDepthBufferin interfaceI3DTextRenderable
-
isLabel
public boolean isLabel()
Description copied from interface:I3DTextRenderableIs it a label or another kind of text?- Specified by:
isLabelin interfaceI3DTextRenderable- Returns:
- Whether this is a label
-
setSize
public void setSize(java.lang.Double size)
Sets the absolute size of this entity- Overrides:
setSizein classAbstractPositionEntity- Parameters:
size-
-
setSize
public void setSize(java.lang.Long size)
Description copied from class:AbstractPositionEntitySets the absolute size (diameter) of this entity- Overrides:
setSizein classAbstractPositionEntity- Parameters:
size- The diameter in internal units
-
setDistFactor
public void setDistFactor(java.lang.Double distFactor)
-
setName
public void setName(java.lang.String name)
- Overrides:
setNamein classSceneGraphNode
-
getTextOpacity
public float getTextOpacity()
Description copied from interface:I3DTextRenderableGets the text opacity- Specified by:
getTextOpacityin interfaceI3DTextRenderable- Returns:
- Text opacity
-
mustAddToIndex
public boolean mustAddToIndex()
Description copied from class:SceneGraphNodeWhether to add this node to the index- Overrides:
mustAddToIndexin classSceneGraphNode- Returns:
- True if the node needs to be added to the index.
-
getLineWidth
public float getLineWidth()
- Specified by:
getLineWidthin interfaceILineRenderable
-
render
public void render(LineRenderSystem renderer, ICamera camera, float alpha)
- Specified by:
renderin interfaceILineRenderable
-
getGlPrimitive
public int getGlPrimitive()
- Specified by:
getGlPrimitivein interfaceILineRenderable
-
getCandidateId
public long getCandidateId()
Description copied from interface:IFocusReturns the id of the focus candidate of this object. Defaults toIFocus.getId()- Specified by:
getCandidateIdin interfaceIFocus- Returns:
- The id of the candidate
-
getClosestName
public java.lang.String getClosestName()
Description copied from interface:IFocusSame asIFocus.getName()- Specified by:
getClosestNamein interfaceIFocus- Returns:
- The name
-
getCandidateName
public java.lang.String getCandidateName()
Description copied from interface:IFocusReturns the name of the focus candidate of this object. Defaults toIFocus.getName()- Specified by:
getCandidateNamein interfaceIFocus- Returns:
- The name of the candidate
-
isActive
public boolean isActive()
Description copied from interface:IFocusReturns whether this focus object is active or not. Useful for particle groups
-
withinMagLimit
public boolean withinMagLimit()
Description copied from interface:IFocusReturns true if the focus is within the magnitude limit defined inGlobalConf- Specified by:
withinMagLimitin interfaceIFocus- Returns:
- True if focus within magnitude limit
-
getClosestAbsolutePos
public Vector3d getClosestAbsolutePos(Vector3d out)
Description copied from interface:IFocus- Specified by:
getClosestAbsolutePosin interfaceIFocus- Parameters:
out- Vector3d where to put the return value- Returns:
- The absolute position, same as aux
-
getClosestDistToCamera
public double getClosestDistToCamera()
Description copied from interface:IFocusSame asIFocus.getDistToCamera()- Specified by:
getClosestDistToCamerain interfaceIFocus- Returns:
- The distance to the camera in internal units
-
getCandidateViewAngleApparent
public double getCandidateViewAngleApparent()
Description copied from interface:IFocusReturns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians- Specified by:
getCandidateViewAngleApparentin interfaceIFocus- Returns:
- The apparent view angle in radians
-
getAppmag
public float getAppmag()
Description copied from interface:IFocusGets the apparent magnitude
-
getAbsmag
public float getAbsmag()
Description copied from interface:IFocusGets the absolute magnitude
-
getRotationComponent
public RotationComponent getRotationComponent()
Description copied from interface:IFocusReturns the rotation component of this focus- Specified by:
getRotationComponentin interfaceIFocus- Returns:
- The rotation component. Can be null
-
getOrientationQuaternion
public Quaterniond getOrientationQuaternion()
Description copied from interface:IFocusReturns the orientation quaternion of this focus- Specified by:
getOrientationQuaternionin 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:IFocusAdds 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:IFocusAdds this focus to the hits list if it is hit by the given ray
-
makeFocus
public void makeFocus()
Description copied from interface:IFocusHook that runs when the candidate is actually made focus
-
getFocus
public IFocus getFocus(java.lang.String name)
Description copied from interface:IFocusPrepares the candidate with the given name
-
isCoordinatesTimeOverflow
public boolean isCoordinatesTimeOverflow()
Description copied from interface:IFocusChecks whether this foucs is within its valid time range, so that it can be used as a focus- Specified by:
isCoordinatesTimeOverflowin interfaceIFocus- Returns:
- Whether the focus object is within its valid time range
-
-