Package gaiasky.scenegraph
Class CosmicRuler
- java.lang.Object
-
- gaiasky.scenegraph.SceneGraphNode
-
- gaiasky.scenegraph.CosmicRuler
-
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,IObserver,I3DTextRenderable,ILineRenderable,IRenderable,IStarContainer,IPosition
public class CosmicRuler extends SceneGraphNode implements I3DTextRenderable, ILineRenderable, IObserver
Cosmic ruler between two objects
-
-
Field Summary
-
Fields inherited from class gaiasky.scenegraph.SceneGraphNode
aux3d1, aux3d2, aux3d3, aux3d4, aux3f1, aux3f2, aux3f3, aux3f4, cc, children, computed, coordinates, copy, ct, distToCamera, id, localTransform, namekey, names, numChildren, octant, octantId, opacity, orientation, parent, parentkey, parentName, pos, posSph, ROOT_NAME, size, translation, viewAngle, viewAngleApparent
-
-
Constructor Summary
Constructors Constructor Description CosmicRuler()CosmicRuler(java.lang.String name0, java.lang.String name1)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddToRenderLists(ICamera camera)Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.intgetGlPrimitive()floatgetLineWidth()java.lang.StringgetName0()java.lang.StringgetName1()floatgetTextOpacity()Gets the text opacitybooleanhasAttached()Returns true if the ruler is attached to at least one object.booleanhasObject0()booleanhasObject1()booleanisLabel()Is it a label or another kind of text?voidnotify(Events event, java.lang.Object... data)voidrender(LineRenderSystem renderer, ICamera camera, float alpha)voidrender(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)Renders the textbooleanrenderText()Tells whether the text must be rendered or not for this entitybooleanrulerOk()voidsetName0(java.lang.String name0)voidsetName1(java.lang.String name1)java.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 sizevoidupdateLocalValues(ITimeFrameProvider time, ICamera camera)This function updates all the local values before the localTransform is updated.-
Methods inherited from class gaiasky.scenegraph.SceneGraphNode
add, add, addChild, addChild, addFocusableObjects, addName, addNodes, addToIndex, addToRender, computeFuturePosition, dispose, doneLoading, getAbsoluteOrientation, getAbsolutePosition, getAbsolutePosition, getAggregatedChildren, getAlpha, getChildByName, getChildByNameAndType, getChildrenByType, getComponentType, getCt, getDelta, getDistToCamera, getFirstStarAncestor, getHeight, getHeight, getHeight, getHeightScale, getId, getLineCopy, getName, getNames, getNext, getNode, getNode, getOctant, getOpacity, getOrientation, getPos, getPosition, getPosition, getPosSph, getPredictedPosition, getRadius, getRoot, getSceneGraphDepth, getSimpleCopy, getSize, getStarCount, getUnrotatedPos, getVelocity, getViewAngle, getViewAngleApparent, hasName, hasName, initialize, insert, insert, isCopy, isInRender, isInRender, isValidPosition, isVisibilityOn, mustAddToIndex, mustUpdatePosition, namesConcat, removeChild, removeFromIndex, removeFromRender, render2DLabel, render2DLabel, render2DLabel, render2DLabel, render3DLabel, render3DLabel, returnToPool, setColor, setColor, setComputedFlag, setCoordinates, setCt, setCt, setId, setLabelcolor, setLabelcolor, setName, setNamekey, setNames, setParent, setParentkey, setSize, setSize, setUp, toString, update, update, updateLocal, updateNames, updateNamesRec
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gaiasky.render.IRenderable
getComponentType, getDistToCamera, getOpacity
-
-
-
-
Method Detail
-
getLineWidth
public float getLineWidth()
- Specified by:
getLineWidthin interfaceILineRenderable
-
render
public void render(LineRenderSystem renderer, ICamera camera, float alpha)
- Specified by:
renderin interfaceILineRenderable
-
render
public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)
Description copied from interface:I3DTextRenderableRenders the text- Specified by:
renderin interfaceI3DTextRenderable- Parameters:
batch- The sprite batchshader- The shadersys- The font render systemrc- The render contextcamera- The camera
-
addToRenderLists
protected void addToRenderLists(ICamera camera)
Description copied from class:SceneGraphNodeAdds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.- Overrides:
addToRenderListsin classSceneGraphNode
-
updateLocalValues
public void updateLocalValues(ITimeFrameProvider time, ICamera camera)
Description copied from class:SceneGraphNodeThis function updates all the local values before the localTransform is updated. Position, rotations and scale must be updated in here.- Overrides:
updateLocalValuesin classSceneGraphNode
-
getName0
public java.lang.String getName0()
-
setName0
public void setName0(java.lang.String name0)
-
getName1
public java.lang.String getName1()
-
setName1
public void setName1(java.lang.String name1)
-
rulerOk
public boolean rulerOk()
-
hasAttached
public boolean hasAttached()
Returns true if the ruler is attached to at least one object.- Returns:
- Ture if the ruler is attached.
-
hasObject0
public boolean hasObject0()
-
hasObject1
public boolean hasObject1()
-
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
-
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
-
getTextOpacity
public float getTextOpacity()
Description copied from interface:I3DTextRenderableGets the text opacity- Specified by:
getTextOpacityin interfaceI3DTextRenderable- Returns:
- Text opacity
-
notify
public void notify(Events event, java.lang.Object... data)
-
getGlPrimitive
public int getGlPrimitive()
- Specified by:
getGlPrimitivein interfaceILineRenderable
-
-