Package gaiasky.scenegraph
Class MeshObject
java.lang.Object
gaiasky.scenegraph.SceneGraphNode
gaiasky.scenegraph.FadeNode
gaiasky.scenegraph.MeshObject
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,I3DTextRenderable,IModelRenderable,IRenderable,IStarContainer,IVisibilitySwitch,IPosition
public class MeshObject extends FadeNode implements IModelRenderable, I3DTextRenderable
-
Field Summary
Fields Modifier and Type Field Description ModelComponentmcMODELITransform[]transformationsTRANSFORMATIONS - are applied each cycleFields inherited from class gaiasky.scenegraph.FadeNode
catalogInfo, currentDistance, highlighted, hlallvisible, hlc, hlcma, hlcmi, hlcmmax, hlcmmin, hlplain, inSceneGraph, labelcolor, labelPositionFields inherited from class gaiasky.scenegraph.SceneGraphNode
aux3b1, aux3b2, aux3b3, aux3b4, aux3d1, aux3d2, aux3d3, aux3d4, aux3f1, aux3f2, aux3f3, aux3f4, cc, children, computed, coordinates, copy, ct, distToCamera, id, lastStateChangeTimeMs, localTransform, namekey, names, numChildren, octant, octantId, opacity, orientation, parent, parentkey, parentName, pos, posSph, ROOT_NAME, sg, size, translation, viewAngle, viewAngleApparent, visible -
Constructor Summary
Constructors Constructor Description MeshObject() -
Method Summary
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.voiddoneLoading(com.badlogic.gdx.assets.AssetManager manager)java.lang.StringgetDescription()floatgetTextOpacity()Gets the text opacitybooleanhasAtmosphere()voidinitialize()booleanisLabel()Is it a label or another kind of text?voidrender(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)Label renderingvoidrender(IntModelBatch modelBatch, float alpha, double t, RenderingContext rc)Model renderingbooleanrenderText()Tells whether the text must be rendered or not for this entityvoidsetAdditiveblending(java.lang.Boolean additive)voidsetDescription(java.lang.String description)voidsetModel(ModelComponent mc)voidsetRotate(double[] rt)voidsetScale(double[] sc)voidsetSize(java.lang.Double size)Sets the absolute size (diameter) of this entityvoidsetSize(java.lang.Long size)Sets the absolute size (diameter) of this entityvoidsetToLocalTransform(com.badlogic.gdx.math.Matrix4 localTransform, boolean forceUpdate)voidsetTransformName(java.lang.String transformName)voidsetTranslate(double[] tr)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 sizevoidupdateLocal(ITimeFrameProvider time, ICamera camera)Updates the transform matrix with the transformations that will apply to the children and the local transform matrix with the transformations that will apply only to this object.protected voidupdateLocalTransform()Update the local transform with the transform and the rotations/scales necessary.Methods inherited from class gaiasky.scenegraph.FadeNode
getBaseOpacity, getCatalogInfo, getFadeIn, getFadeOut, getHlcma, getHlcmi, getHlcmmax, getHlcmmin, highlight, highlight, isHighlighted, isHlAllVisible, isHlplain, setCataloginfo, setCatalogInfo, setCatalogInfoBare, setFadein, setFadeout, setLabelcolor, setLabelcolor, setLabelposition, setPosition, setPositionobjectname, setUp, update, updateLocalValues, updateOpacityMethods inherited from class gaiasky.scenegraph.SceneGraphNode
add, add, addChild, addChild, addFocusableObjects, addName, addNodes, addToIndex, addToRender, computeFuturePosition, dispose, getAbsoluteOrientation, getAbsolutePosition, getAbsolutePosition, getAggregatedChildren, getAlpha, getChildByName, getChildByNameAndType, getChildrenByComponentType, getChildrenByType, getColor, 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, getVisibilityOpacityFactor, hasCt, hasName, hasName, insert, insert, isCopy, isInRender, isInRender, isValidPosition, isVisibilityOn, isVisible, isVisible, isVisibleGroup, msSinceStateChange, mustAddToIndex, mustUpdatePosition, namesConcat, removeChild, removeFromIndex, removeFromRender, render2DLabel, render2DLabel, render2DLabel, render2DLabel, render3DLabel, render3DLabel, returnToPool, setColor, setColor, setComputedFlag, setCoordinates, setCt, setCt, setId, setName, setNamekey, setNames, setParent, setParentkey, setVisible, setVisibleGroup, shouldRender, toString, update, updateNames, updateNamesRecMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gaiasky.render.IRenderable
getComponentType, getDistToCamera, getOpacity
-
Field Details
-
mc
MODEL -
transformations
TRANSFORMATIONS - are applied each cycle
-
-
Constructor Details
-
MeshObject
public MeshObject()
-
-
Method Details
-
initialize
public void initialize()- Overrides:
initializein classSceneGraphNode
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager)- Overrides:
doneLoadingin classFadeNode
-
updateLocal
Description copied from class:SceneGraphNodeUpdates the transform matrix with the transformations that will apply to the children and the local transform matrix with the transformations that will apply only to this object.- Overrides:
updateLocalin classFadeNode
-
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. -
setToLocalTransform
public void setToLocalTransform(com.badlogic.gdx.math.Matrix4 localTransform, boolean forceUpdate) -
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 classFadeNode
-
render
Model rendering- Specified by:
renderin interfaceIModelRenderable
-
setDescription
public void setDescription(java.lang.String description)- Specified by:
setDescriptionin interfaceIVisibilitySwitch- Overrides:
setDescriptionin classSceneGraphNode
-
getDescription
public java.lang.String getDescription()- Specified by:
getDescriptionin interfaceIVisibilitySwitch- Overrides:
getDescriptionin classSceneGraphNode
-
setModel
-
setTransformName
public void setTransformName(java.lang.String transformName) -
setTranslate
public void setTranslate(double[] tr) -
setRotate
public void setRotate(double[] rt) -
setScale
public void setScale(double[] sc) -
setAdditiveblending
public void setAdditiveblending(java.lang.Boolean additive) -
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
-
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
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)Description copied from class:SceneGraphNodeSets the absolute size (diameter) of this entity -
setSize
public void setSize(java.lang.Long size)Description copied from class:SceneGraphNodeSets the absolute size (diameter) of this entity -
getTextOpacity
public float getTextOpacity()Description copied from interface:I3DTextRenderableGets the text opacity- Specified by:
getTextOpacityin interfaceI3DTextRenderable- Returns:
- Text opacity
-