Package gaiasky.scenegraph
Class MilkyWay
- java.lang.Object
-
- gaiasky.scenegraph.SceneGraphNode
-
- gaiasky.scenegraph.AbstractPositionEntity
-
- gaiasky.scenegraph.MilkyWay
-
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,I3DTextRenderable
,IRenderable
,IStarContainer
,IPosition
public class MilkyWay extends AbstractPositionEntity implements I3DTextRenderable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gaiasky.scenegraph.SceneGraphNode
SceneGraphNode.RenderGroup, SceneGraphNode.TLV3, SceneGraphNode.TLV3D
-
-
Field Summary
Fields Modifier and Type Field Description java.util.List<? extends ParticleGroup.ParticleBean>
bulgeData
java.util.List<? extends ParticleGroup.ParticleBean>
dustData
java.util.List<? extends ParticleGroup.ParticleBean>
gasData
GalaxydataComponent
gc
java.util.List<? extends ParticleGroup.ParticleBean>
hiiData
protected java.lang.String
provider
java.util.List<? extends ParticleGroup.ParticleBean>
starData
LoadStatus
status
Status of data in the GPU-
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 MilkyWay()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.void
doneLoading(com.badlogic.gdx.assets.AssetManager manager)
com.badlogic.gdx.math.Vector2
getFadeIn()
com.badlogic.gdx.math.Vector2
getFadeOut()
java.lang.String
getProvider()
float
getTextOpacity()
Gets the text opacityvoid
initialize()
boolean
isLabel()
Is it a label or another kind of text?void
render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)
Label rendering.boolean
renderText()
Tells whether the text must be rendered or not for this entityvoid
setFadein(double[] fadein)
void
setFadeout(double[] fadeout)
void
setGalaxydata(GalaxydataComponent gc)
void
setLabelcolor(double[] labelcolor)
void
setLabelposition(double[] labelposition)
void
setModel(ModelComponent mc)
void
setProvider(java.lang.String provider)
void
setSize(java.lang.Double size)
Sets the absolute size of this entityvoid
setSize(java.lang.Float size)
Sets the size of this entity in kilometresvoid
setTransformName(java.lang.String transformName)
java.lang.String
text()
Returns the textfloat[]
textColour()
Returns an array with the text colour in the fashion [r, g, b, a]void
textDepthBuffer()
Executes the blending for the textvoid
textPosition(ICamera cam, Vector3d out)
Sets the position of this text in the out vectorfloat
textScale()
Returns the text scale for the scale varying in the shaderfloat
textSize()
Returns the text sizevoid
update(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera)
void
update(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera, float opacity)
void
updateLocal(ITimeFrameProvider time, ICamera camera)
Updates the local transform matrix.protected void
updateLocalTransform()
Update the local transform with the transform and the rotations/scales necessary.void
updateLocalValues(ITimeFrameProvider time, ICamera camera)
This function updates all the local values before the localTransform is updated.-
Methods inherited from class gaiasky.scenegraph.AbstractPositionEntity
computeFuturePosition, getAbsoluteOrientation, getAbsolutePosition, 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, setSize
-
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, mustAddToIndex, namesConcat, removeChild, removeFromIndex, removeFromRender, returnToPool, setComputedFlag, setCt, setCt, setId, setName, setNamekey, setNames, setParent, setParentkey, setUp, toString, 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
-
-
-
-
Field Detail
-
starData
public java.util.List<? extends ParticleGroup.ParticleBean> starData
-
bulgeData
public java.util.List<? extends ParticleGroup.ParticleBean> bulgeData
-
dustData
public java.util.List<? extends ParticleGroup.ParticleBean> dustData
-
hiiData
public java.util.List<? extends ParticleGroup.ParticleBean> hiiData
-
gasData
public java.util.List<? extends ParticleGroup.ParticleBean> gasData
-
provider
protected java.lang.String provider
-
gc
public GalaxydataComponent gc
-
status
public LoadStatus status
Status of data in the GPU
-
-
Method Detail
-
initialize
public void initialize()
- Overrides:
initialize
in classSceneGraphNode
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager)
- Overrides:
doneLoading
in classAbstractPositionEntity
-
update
public void update(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera, float opacity)
- Overrides:
update
in classSceneGraphNode
-
update
public void update(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera)
- Overrides:
update
in classSceneGraphNode
-
updateLocal
public void updateLocal(ITimeFrameProvider time, ICamera camera)
Description copied from class:AbstractPositionEntity
Updates the local transform matrix.- Overrides:
updateLocal
in classAbstractPositionEntity
-
addToRenderLists
protected void addToRenderLists(ICamera camera)
Description copied from class:AbstractPositionEntity
Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.- Specified by:
addToRenderLists
in classAbstractPositionEntity
-
updateLocalTransform
protected void updateLocalTransform()
Update the local transform with the transform and the rotations/scales necessary. Override if your model contains more than just the position and size.
-
render
public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)
Label rendering.- Specified by:
render
in interfaceI3DTextRenderable
- Parameters:
batch
- The sprite batchshader
- The shadersys
- The font render systemrc
- The render contextcamera
- The camera
-
setTransformName
public void setTransformName(java.lang.String transformName)
-
renderText
public boolean renderText()
Description copied from interface:I3DTextRenderable
Tells whether the text must be rendered or not for this entity- Specified by:
renderText
in interfaceI3DTextRenderable
- Returns:
- True if text must be rendered
-
setSize
public void setSize(java.lang.Double size)
Sets the absolute size of this entity- Overrides:
setSize
in classAbstractPositionEntity
- Parameters:
size
-
-
setFadein
public void setFadein(double[] fadein)
-
setFadeout
public void setFadeout(double[] fadeout)
-
setLabelposition
public void setLabelposition(double[] labelposition)
-
textColour
public float[] textColour()
Description copied from interface:I3DTextRenderable
Returns an array with the text colour in the fashion [r, g, b, a]- Specified by:
textColour
in interfaceI3DTextRenderable
- Returns:
- Array with the colour
-
textSize
public float textSize()
Description copied from interface:I3DTextRenderable
Returns the text size- Specified by:
textSize
in interfaceI3DTextRenderable
- Returns:
- The text size
-
textScale
public float textScale()
Description copied from interface:I3DTextRenderable
Returns the text scale for the scale varying in the shader- Specified by:
textScale
in interfaceI3DTextRenderable
- Returns:
- The scale
-
textPosition
public void textPosition(ICamera cam, Vector3d out)
Description copied from interface:I3DTextRenderable
Sets the position of this text in the out vector- Specified by:
textPosition
in interfaceI3DTextRenderable
out
- The out parameter with the result
-
text
public java.lang.String text()
Description copied from interface:I3DTextRenderable
Returns the text- Specified by:
text
in interfaceI3DTextRenderable
- Returns:
- The text
-
textDepthBuffer
public void textDepthBuffer()
Description copied from interface:I3DTextRenderable
Executes the blending for the text- Specified by:
textDepthBuffer
in interfaceI3DTextRenderable
-
setLabelcolor
public void setLabelcolor(double[] labelcolor)
- Overrides:
setLabelcolor
in classAbstractPositionEntity
-
isLabel
public boolean isLabel()
Description copied from interface:I3DTextRenderable
Is it a label or another kind of text?- Specified by:
isLabel
in interfaceI3DTextRenderable
- Returns:
- Whether this is a label
-
getProvider
public java.lang.String getProvider()
-
setProvider
public void setProvider(java.lang.String provider)
-
setGalaxydata
public void setGalaxydata(GalaxydataComponent gc)
-
setSize
public void setSize(java.lang.Float size)
Sets the size of this entity in kilometres- Parameters:
size
- The diameter of the entity
-
updateLocalValues
public void updateLocalValues(ITimeFrameProvider time, ICamera camera)
Description copied from class:AbstractPositionEntity
This function updates all the local values before the localTransform is updated. Position, rotations and scale must be updated in here.- Specified by:
updateLocalValues
in classAbstractPositionEntity
-
setModel
public void setModel(ModelComponent mc)
-
getFadeIn
public com.badlogic.gdx.math.Vector2 getFadeIn()
-
getFadeOut
public com.badlogic.gdx.math.Vector2 getFadeOut()
-
getTextOpacity
public float getTextOpacity()
Description copied from interface:I3DTextRenderable
Gets the text opacity- Specified by:
getTextOpacity
in interfaceI3DTextRenderable
- Returns:
- Text opacity
-
-