Package gaiasky.scenegraph
Class ShapeObject
java.lang.Object
gaiasky.scenegraph.SceneGraphNode
gaiasky.scenegraph.ShapeObject
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,I3DTextRenderable,IModelRenderable,IRenderable,IFocus,IStarContainer,IVisibilitySwitch,IPosition
public class ShapeObject
extends SceneGraphNode
implements IFocus, IModelRenderable, I3DTextRenderable
-
Field Summary
Fields inherited from class gaiasky.scenegraph.SceneGraphNode
B31, B32, B33, B34, cc, children, computed, coordinates, copy, ct, D31, D32, D33, D34, distToCamera, F31, F32, F33, F34, forceLabel, id, labelcolor, lastStateChangeTimeMs, localizedNameIndex, localTransform, names, numChildren, octant, octantId, opacity, orientation, parent, parentName, pos, posSph, ROOT_NAME, size, translation, viewAngle, viewAngleApparent, visible -
Constructor Summary
ConstructorsConstructorDescriptionShapeObject(String[] names, String parentName, IFocus track, String trackName, boolean showLabel) ShapeObject(String[] names, String parentName, IFocus track, String trackName, boolean showLabel, float[] color) ShapeObject(String[] names, String parentName, Vector3b pos, String trackName, boolean showLabel) ShapeObject(String[] names, String parentName, Vector3b pos, String trackName, boolean showLabel, float[] color) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFocusableObjects(com.badlogic.gdx.utils.Array<IFocus> list) Adds all the children that are focusable objects to the list.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] position.voidaddHit(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 ray.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.voiddoneLoading(com.badlogic.gdx.assets.AssetManager manager) floatGets the absolute magnitude.Returns the absolute position of this entity in the native coordinates (equatorial system) and internal unitsfloatGets the apparent magnitude.longReturns the id of the focus candidate of this object.Returns the name of the focus candidate of this object.doubleReturns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians.Same asIFocus.getAbsolutePosition(Vector3b).doubleSame asIFocus.getDistToCamera().Same asIFocus.getName().Prepares the candidate with the given name.Returns the orientation quaternion of this focus.Returns the rotation component of this focus.<T extends SceneGraphNode>
TGets a copy of this object but does not copy its parent or children.floatGets the text opacitygetTrack()booleanvoidvoidbooleanisActive()Returns whether this focus object is active or not.booleanChecks whether this foucs is within its valid time range, so that it can be used as a focus.booleanisLabel()Is it a label or another kind of text?voidHook that runs when the candidate is actually made focus.voidrender(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera) Label renderingvoidrender(IntModelBatch modelBatch, float alpha, double t, RenderingContext rc, SceneGraphRenderer.RenderGroup group) Model renderingbooleanTells whether the text must be rendered or not for this entityvoidsetColor(double[] color) Sets the object color, as an RGBA double array.voidsetColor(float[] color) Sets the object color, as an RGBA float array.voidtext()Returns the textfloat[]Returns an array with the text colour in the fashion [r, g, b, a]voidExecutes the blending for the textvoidtextPosition(ICamera cam, Vector3d out) Sets the position of this text in the out vectorfloatReturns 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.Methods inherited from class gaiasky.scenegraph.SceneGraphNode
add, add, addChild, addChild, addName, addNodes, addToIndex, addToRender, computeFuturePosition, dispose, getAbsoluteOrientation, getAbsolutePosition, getAggregatedChildren, getAlpha, getChildByName, getChildByNameAndType, getChildrenByComponentType, getChildrenByType, getColor, getComponentType, getCoordinates, getCt, getDelta, getDescription, getDistToCamera, getFirstStarAncestor, getHeight, getHeight, getHeight, getHeightScale, getId, getLabelcolor, getLineCopy, getLocalizedName, getName, getNames, getNext, getNode, getNode, getOctant, getOpacity, getOrientation, getPos, getPosition, getPosition, getPosSph, getPredictedPosition, getRadius, getRoot, getSceneGraphDepth, getSize, getStarCount, getUnrotatedPos, getVelocity, getViewAngle, getViewAngleApparent, getVisibilityOpacityFactor, hasCt, hasName, hasName, insert, isCopy, isForceLabel, isForceLabel, isInRender, isInRender, isValidPosition, isVisibilityOn, isVisible, isVisible, isVisible, isVisibleGroup, isVisibleGroup, msSinceStateChange, mustAddToIndex, mustUpdatePosition, namesConcat, removeChild, removeFromIndex, removeFromRender, render2DLabel, render2DLabel, render2DLabel, render2DLabel, render3DLabel, render3DLabel, returnToPool, setComputedFlag, setCoordinates, setCt, setCt, setDescription, setForcelabel, setForceLabel, setForceLabel, setId, setLabelcolor, setLabelcolor, setLabelcolor, setName, setName, setNames, setParent, setPos, setSize, setSize, setUp, setVisible, setVisible, setVisibleGroup, shouldRender, toString, update, update, updateLocalizedName, updateLocalizedNameRecursiveMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gaiasky.scenegraph.IFocus
getAbsolutePosition, getAlpha, getColor, getCt, getDelta, getDistToCamera, getFirstStarAncestor, getHeight, getHeight, getHeight, getHeightScale, getId, getLocalizedName, getName, getNames, getNext, getOctant, getOrientation, getPos, getPosSph, getPredictedPosition, getRadius, getSceneGraphDepth, getSize, getViewAngle, getViewAngleApparent, hasName, hasName, isCopyMethods inherited from interface gaiasky.render.IRenderable
getComponentType, getDistToCamera, getOpacity
-
Constructor Details
-
ShapeObject
-
ShapeObject
-
ShapeObject
-
ShapeObject
-
-
Method Details
-
setModel
-
initModel
public void initModel() -
initialize
public void initialize()- Overrides:
initializein classSceneGraphNode
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager) - Overrides:
doneLoadingin classSceneGraphNode
-
setColor
public void setColor(double[] color) Description copied from class:SceneGraphNodeSets the object color, as an RGBA double array.- Overrides:
setColorin classSceneGraphNode- Parameters:
color- The color.
-
setColor
public void setColor(float[] color) Description copied from class:SceneGraphNodeSets the object color, as an RGBA float array.- Overrides:
setColorin classSceneGraphNode- Parameters:
color- The color.
-
updateLocal
Updates the local transform matrix.- Overrides:
updateLocalin classSceneGraphNode- Parameters:
time- The time frame provider.camera- The camera.
-
updateLocalValues
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
-
addToRenderLists
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
-
getAbsolutePosition
Description copied from class:SceneGraphNodeReturns the absolute position of this entity in the native coordinates (equatorial system) and internal units- Specified by:
getAbsolutePositionin interfaceIFocus- Overrides:
getAbsolutePositionin classSceneGraphNode- 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, SceneGraphRenderer.RenderGroup group) Model rendering- Specified by:
renderin interfaceIModelRenderable
-
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
-
hasAtmosphere
public boolean hasAtmosphere()- Specified by:
hasAtmospherein interfaceIModelRenderable
-
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
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
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
-
getTrack
-
getTrackName
-
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.
-
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. -
addFocusableObjects
Adds all the children that are focusable objects to the list.- Overrides:
addFocusableObjectsin classSceneGraphNode- Parameters:
list- The list of focusable objects.
-
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
Description copied from interface:IFocusReturns the rotation component of this focus.- Specified by:
getRotationComponentin interfaceIFocus- Returns:
- The rotation component. Can be null.
-
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
Description copied from interface:IFocusPrepares the candidate with the given name. -
getClosestName
Description copied from interface:IFocusSame asIFocus.getName().- Specified by:
getClosestNamein interfaceIFocus- Returns:
- The name.
-
getClosestDistToCamera
public double getClosestDistToCamera()Description copied from interface:IFocusSame asIFocus.getDistToCamera().- Specified by:
getClosestDistToCamerain interfaceIFocus- Returns:
- The distance to the camera in internal units.
-
getClosestAbsolutePos
Description copied from interface:IFocusSame asIFocus.getAbsolutePosition(Vector3b).- Specified by:
getClosestAbsolutePosin 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: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.
-
getTextOpacity
public float getTextOpacity()Description copied from interface:I3DTextRenderableGets the text opacity- Specified by:
getTextOpacityin interfaceI3DTextRenderable- Returns:
- Text opacity
-
getSimpleCopy
Description copied from class:SceneGraphNodeGets a copy of this object but does not copy its parent or children.- Overrides:
getSimpleCopyin classSceneGraphNode- Returns:
- The copied object.
-