Package gaiasky.scenegraph
Class KeyframesPathObject
- java.lang.Object
-
- gaiasky.scenegraph.SceneGraphNode
-
- gaiasky.scenegraph.AbstractPositionEntity
-
- gaiasky.scenegraph.VertsObject
-
- gaiasky.scenegraph.KeyframesPathObject
-
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,I3DTextRenderable,IGPUVertsRenderable,ILineRenderable,IPointRenderable,IRenderable,IStarContainer,IPosition
public class KeyframesPathObject extends VertsObject implements I3DTextRenderable, ILineRenderable, IPointRenderable
-
-
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 KeyframehighlightedHighlighted keyframeVertsObjecthighlightedKnotHighlighted knotcom.badlogic.gdx.utils.Array<Keyframe>keyframesKeyframe objectsVertsObjectknotsThe knots, or keyframe positionsVertsObjectknotsSeamKnots which are also seamscom.badlogic.gdx.utils.Array<VertsObject>orientationsContains pairs of {direction, up} representing the orientation at each knotVertsObjectpathThe actual pathVertsObjectsegmentsThe segments joining the knotsKeyframeselectedSelected keyframeVertsObjectselectedKnotSelected knot-
Fields inherited from class gaiasky.scenegraph.VertsObject
additive, blend, closedLoop, count, depth, glPrimitive, inGpu, offset, pointCloudData, primitiveSize, renderGroup
-
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 KeyframesPathObject()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddKnot(Vector3d knot, Vector3d dir, Vector3d up, boolean seam)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.protected booleancheckClickDistance(int screenX, int screenY, com.badlogic.gdx.math.Vector3 pos, NaturalCamera camera, com.badlogic.gdx.graphics.PerspectiveCamera pcamera, double pixelSize)voidclear()Clears the data from this object, both in RAM and VRAMvoidclearOrientations()intgetGlPrimitive()floatgetLineWidth()java.lang.StringgetText(Keyframe kf)floatgetTextOpacity()Gets the text opacityvoidgetTextPosition(ICamera cam, Vector3d out, Keyframe kf)voidhighlight(Keyframe kf)voidinitialize()booleanisEmpty()booleanisLabel()Is it a label or another kind of text?booleanisSelected()booleanmoveSelection(int screenX, int screenY, NaturalCamera camera)voidrefreshData()Refreshes the positions and orientations from the keyframesvoidrefreshOrientations()Refreshes the orientations from the keyframesvoidrefreshSingleVector(VertsObject vo, Vector3d pos, Vector3d vec)voidrender(LineRenderSystem renderer, ICamera camera, float alpha)voidrender(PointRenderSystem renderer, ICamera camera, float alpha)voidrender(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)Label renderbooleanrenderText()Tells whether the text must be rendered or not for this entityvoidresamplePath()booleanrotateAroundCrs(double dx, double dy, NaturalCamera camera)booleanrotateAroundDir(double dx, double dy, NaturalCamera camera)booleanrotateAroundUp(double dx, double dy, NaturalCamera camera)IFocusselect(int screenX, int screenY, int minPixDist, NaturalCamera camera)voidselect(Keyframe kf)voidsetKeyframes(com.badlogic.gdx.utils.Array<Keyframe> keyframes)voidsetPathKnots(double[] kts, double[] dirs, double[] ups, boolean[] seams)java.lang.Stringtext()Returns the textfloat[]textColour()Returns an array with the text colour in the fashion [r, g, b, a]float[]textColour(Keyframe kf)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 sizevoidunhighlight()voidunhighlight(Keyframe kf)voidunselect()voidupdate(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera, float opacity)-
Methods inherited from class gaiasky.scenegraph.VertsObject
addPoint, addPoints, blend, depth, getAlpha, getColor, getCount, getLocalTransform, getOffset, getParent, getPointCloud, getPrimitiveSize, inGpu, isClosedLoop, isLine, isPoint, markForUpdate, setAdditive, setBlend, setClosedLoop, setCount, setDepth, setGlPrimitive, setInGpu, setOffset, setPointCloudData, setPoints, setPrimitiveLineLoop, setPrimitiveLines, setPrimitiveLineStip, setPrimitivePoints, setPrimitiveSize, updateLocalValues
-
Methods inherited from class gaiasky.scenegraph.AbstractPositionEntity
computeFuturePosition, doneLoading, getAbsoluteOrientation, getAbsolutePosition, getAbsolutePosition, 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, setSize, setSize, updateLocal
-
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, 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.render.IPointRenderable
blend, depth
-
Methods inherited from interface gaiasky.render.IRenderable
getComponentType, getDistToCamera, getOpacity
-
-
-
-
Field Detail
-
keyframes
public com.badlogic.gdx.utils.Array<Keyframe> keyframes
Keyframe objects
-
selected
public Keyframe selected
Selected keyframe
-
highlighted
public Keyframe highlighted
Highlighted keyframe
-
path
public VertsObject path
The actual path
-
segments
public VertsObject segments
The segments joining the knots
-
knots
public VertsObject knots
The knots, or keyframe positions
-
knotsSeam
public VertsObject knotsSeam
Knots which are also seams
-
selectedKnot
public VertsObject selectedKnot
Selected knot
-
highlightedKnot
public VertsObject highlightedKnot
Highlighted knot
-
orientations
public com.badlogic.gdx.utils.Array<VertsObject> orientations
Contains pairs of {direction, up} representing the orientation at each knot
-
-
Method Detail
-
initialize
public void initialize()
- Overrides:
initializein classSceneGraphNode
-
setKeyframes
public void setKeyframes(com.badlogic.gdx.utils.Array<Keyframe> keyframes)
-
refreshData
public void refreshData()
Refreshes the positions and orientations from the keyframes
-
refreshOrientations
public void refreshOrientations()
Refreshes the orientations from the keyframes
-
refreshSingleVector
public void refreshSingleVector(VertsObject vo, Vector3d pos, Vector3d vec)
-
resamplePath
public void resamplePath()
-
setPathKnots
public void setPathKnots(double[] kts, double[] dirs, double[] ups, boolean[] seams)
-
update
public void update(ITimeFrameProvider time, Vector3d parentTransform, ICamera camera, float opacity)
- Overrides:
updatein classSceneGraphNode
-
select
public IFocus select(int screenX, int screenY, int minPixDist, NaturalCamera camera)
-
checkClickDistance
protected boolean checkClickDistance(int screenX, int screenY, com.badlogic.gdx.math.Vector3 pos, NaturalCamera camera, com.badlogic.gdx.graphics.PerspectiveCamera pcamera, double pixelSize)
-
highlight
public void highlight(Keyframe kf)
-
unhighlight
public void unhighlight(Keyframe kf)
-
unhighlight
public void unhighlight()
-
select
public void select(Keyframe kf)
-
unselect
public void unselect()
-
isSelected
public boolean isSelected()
-
moveSelection
public boolean moveSelection(int screenX, int screenY, NaturalCamera camera)
-
rotateAroundDir
public boolean rotateAroundDir(double dx, double dy, NaturalCamera camera)
-
rotateAroundUp
public boolean rotateAroundUp(double dx, double dy, NaturalCamera camera)
-
rotateAroundCrs
public boolean rotateAroundCrs(double dx, double dy, NaturalCamera camera)
-
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.- Overrides:
addToRenderListsin classVertsObject
-
clear
public void clear()
Description copied from class:VertsObjectClears the data from this object, both in RAM and VRAM- Overrides:
clearin classVertsObject
-
isEmpty
public boolean isEmpty()
- Overrides:
isEmptyin classVertsObject
-
clearOrientations
public void clearOrientations()
-
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 render- 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
-
textColour
public float[] textColour(Keyframe kf)
-
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
-
getText
public java.lang.String getText(Keyframe kf)
-
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
-
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(PointRenderSystem renderer, ICamera camera, float alpha)
- Specified by:
renderin interfaceIPointRenderable
-
getGlPrimitive
public int getGlPrimitive()
- Specified by:
getGlPrimitivein interfaceIGPUVertsRenderable- Specified by:
getGlPrimitivein interfaceILineRenderable- Overrides:
getGlPrimitivein classVertsObject
-
-