Package gaiasky.scenegraph
Class KeyframesPathObject
java.lang.Object
gaiasky.scenegraph.SceneGraphNode
gaiasky.scenegraph.VertsObject
gaiasky.scenegraph.KeyframesPathObject
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,I3DTextRenderable
,IGPUVertsRenderable
,ILineRenderable
,IPointRenderable
,IRenderable
,IStarContainer
,IVisibilitySwitch
,IPosition
public class KeyframesPathObject extends VertsObject implements I3DTextRenderable, ILineRenderable, IPointRenderable
-
Field Summary
Fields Modifier and Type Field Description Keyframe
highlighted
Highlighted keyframeVertsObject
highlightedKnot
Highlighted knotcom.badlogic.gdx.utils.Array<Keyframe>
keyframes
Keyframe objectsVertsObject
knots
The knots, or keyframe positionsVertsObject
knotsSeam
Knots which are also seamscom.badlogic.gdx.utils.Array<VertsObject>
orientations
Contains pairs of {direction, up} representing the orientation at each knotVertsObject
path
The actual pathVertsObject
segments
The segments joining the knotsKeyframe
selected
Selected keyframeVertsObject
selectedKnot
Selected knotFields inherited from class gaiasky.scenegraph.VertsObject
additive, blend, closedLoop, count, depth, glPrimitive, inGpu, offset, pointCloudData, primitiveSize, renderGroup
Fields 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 KeyframesPathObject()
-
Method Summary
Modifier and Type Method Description void
addKnot(Vector3d knot, Vector3d dir, Vector3d up, boolean seam)
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.protected boolean
checkClickDistance(int screenX, int screenY, com.badlogic.gdx.math.Vector3 pos, NaturalCamera camera, com.badlogic.gdx.graphics.PerspectiveCamera pcamera, double pixelSize)
void
clear()
Clears the data from this object, both in RAM and VRAMvoid
clearOrientations()
int
getGlPrimitive()
float
getLineWidth()
java.lang.String
getText(Keyframe kf)
float
getTextOpacity()
Gets the text opacityvoid
getTextPosition(ICamera cam, Vector3d out, Keyframe kf)
void
highlight(Keyframe kf)
void
initialize()
boolean
isEmpty()
boolean
isLabel()
Is it a label or another kind of text?boolean
isSelected()
boolean
moveSelection(int screenX, int screenY, NaturalCamera camera)
void
refreshData()
Refreshes the positions and orientations from the keyframesvoid
refreshOrientations()
Refreshes the orientations from the keyframesvoid
refreshSingleVector(VertsObject vo, Vector3d pos, Vector3d vec)
void
render(LineRenderSystem renderer, ICamera camera, float alpha)
void
render(PointRenderSystem renderer, ICamera camera, float alpha)
void
render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)
Label renderboolean
renderText()
Tells whether the text must be rendered or not for this entityvoid
resamplePath()
boolean
rotateAroundCrs(double dx, double dy, NaturalCamera camera)
boolean
rotateAroundDir(double dx, double dy, NaturalCamera camera)
boolean
rotateAroundUp(double dx, double dy, NaturalCamera camera)
IFocus
select(int screenX, int screenY, int minPixDist, NaturalCamera camera)
void
select(Keyframe kf)
void
setKeyframes(com.badlogic.gdx.utils.Array<Keyframe> keyframes)
void
setPathKnots(double[] kts, double[] dirs, double[] ups, boolean[] seams)
java.lang.String
text()
Returns the textfloat[]
textColour()
Returns an array with the text colour in the fashion [r, g, b, a]float[]
textColour(Keyframe kf)
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
unhighlight()
void
unhighlight(Keyframe kf)
void
unselect()
void
update(ITimeFrameProvider time, Vector3b 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.SceneGraphNode
add, add, addChild, addChild, addFocusableObjects, addName, addNodes, addToIndex, addToRender, computeFuturePosition, dispose, doneLoading, getAbsoluteOrientation, getAbsolutePosition, getAbsolutePosition, getAggregatedChildren, getChildByName, getChildByNameAndType, getChildrenByComponentType, getChildrenByType, getComponentType, getCt, getDelta, getDescription, 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, msSinceStateChange, mustAddToIndex, mustUpdatePosition, namesConcat, removeChild, removeFromIndex, removeFromRender, render2DLabel, render2DLabel, render2DLabel, render2DLabel, render3DLabel, render3DLabel, returnToPool, setColor, setColor, setComputedFlag, setCoordinates, setCt, setCt, setDescription, setId, setLabelcolor, setLabelcolor, setName, setNamekey, setNames, setParent, setParentkey, setSize, setSize, setUp, setVisible, shouldRender, toString, 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.IPointRenderable
blend, depth
Methods inherited from interface gaiasky.render.IRenderable
getComponentType, getDistToCamera, getOpacity
-
Field Details
-
keyframes
Keyframe objects -
selected
Selected keyframe -
highlighted
Highlighted keyframe -
path
The actual path -
segments
The segments joining the knots -
knots
The knots, or keyframe positions -
knotsSeam
Knots which are also seams -
selectedKnot
Selected knot -
highlightedKnot
Highlighted knot -
orientations
Contains pairs of {direction, up} representing the orientation at each knot
-
-
Constructor Details
-
KeyframesPathObject
public KeyframesPathObject()
-
-
Method Details
-
initialize
public void initialize()- Overrides:
initialize
in classSceneGraphNode
-
setKeyframes
-
refreshData
public void refreshData()Refreshes the positions and orientations from the keyframes -
refreshOrientations
public void refreshOrientations()Refreshes the orientations from the keyframes -
refreshSingleVector
-
resamplePath
public void resamplePath() -
setPathKnots
public void setPathKnots(double[] kts, double[] dirs, double[] ups, boolean[] seams) -
addKnot
-
update
public void update(ITimeFrameProvider time, Vector3b parentTransform, ICamera camera, float opacity)- Overrides:
update
in classSceneGraphNode
-
select
-
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
-
unhighlight
-
unhighlight
public void unhighlight() -
select
-
unselect
public void unselect() -
isSelected
public boolean isSelected() -
moveSelection
-
rotateAroundDir
-
rotateAroundUp
-
rotateAroundCrs
-
addToRenderLists
Description copied from class:SceneGraphNode
Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.- Overrides:
addToRenderLists
in classVertsObject
-
clear
public void clear()Description copied from class:VertsObject
Clears the data from this object, both in RAM and VRAM- Overrides:
clear
in classVertsObject
-
isEmpty
public boolean isEmpty()- Overrides:
isEmpty
in classVertsObject
-
clearOrientations
public void clearOrientations() -
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
-
render
public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)Label render- Specified by:
render
in 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: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
-
textColour
-
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
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
-
getTextPosition
-
text
public java.lang.String text()Description copied from interface:I3DTextRenderable
Returns the text- Specified by:
text
in interfaceI3DTextRenderable
- Returns:
- The text
-
getText
-
textDepthBuffer
public void textDepthBuffer()Description copied from interface:I3DTextRenderable
Executes the blending for the text- Specified by:
textDepthBuffer
in interfaceI3DTextRenderable
-
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
-
getTextOpacity
public float getTextOpacity()Description copied from interface:I3DTextRenderable
Gets the text opacity- Specified by:
getTextOpacity
in interfaceI3DTextRenderable
- Returns:
- Text opacity
-
getLineWidth
public float getLineWidth()- Specified by:
getLineWidth
in interfaceILineRenderable
-
render
- Specified by:
render
in interfaceILineRenderable
-
render
- Specified by:
render
in interfaceIPointRenderable
-
getGlPrimitive
public int getGlPrimitive()- Specified by:
getGlPrimitive
in interfaceIGPUVertsRenderable
- Specified by:
getGlPrimitive
in interfaceILineRenderable
- Overrides:
getGlPrimitive
in classVertsObject
-