Class AnimGroup
- java.lang.Object
-
- com.jogamp.graph.ui.Shape
-
- com.jogamp.graph.ui.Group
-
- com.jogamp.graph.ui.AnimGroup
-
- All Implemented Interfaces:
Container
public class AnimGroup extends Group
- See Also:
Scene,Shape,Group.Layout
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAnimGroup.LerpFuncLinear interpolation (LERP) function to evaluate the next animated frame for eachAnimGroup.ShapeDataof aAnimGroup.Set.static classAnimGroup.ScrollLerpScrollingAnimGroup.LerpFunc, approachingAnimGroup.ShapeData's target position over and over.static classAnimGroup.SetAnimation-Set covering itsAnimGroup.ShapeDataelements,AnimGroup.LerpFuncand animation parameter.static classAnimGroup.ShapeDatastatic interfaceAnimGroup.ShapeSetupAnimGroup.ShapeDatasetup function for animation using its enclosingAnimGroup.Setand other data pointsstatic classAnimGroup.SineLerpSine targetAnimGroup.LerpFunc, approachingAnimGroup.ShapeData's target position utilizing the angular value for sine amplitude towards the given normalized direction vector.static classAnimGroup.TargetLerpDefault targetAnimGroup.LerpFunc, approachingAnimGroup.ShapeData's target position inclusive angular rotation around given normalized axis.-
Nested classes/interfaces inherited from class com.jogamp.graph.ui.Group
Group.Layout
-
Nested classes/interfaces inherited from class com.jogamp.graph.ui.Shape
Shape.DrawListener, Shape.EventInfo, Shape.ForwardKeyListener, Shape.ForwardMouseListener, Shape.Listener, Shape.MouseGestureAdapter, Shape.MouseGestureListener, Shape.MoveListener, Shape.PointerListener, Shape.Visitor1, Shape.Visitor2
-
-
Field Summary
Fields Modifier and Type Field Description static floatPOS_EPSEpsilon of position, 5000 xFloatUtil.EPSILONstatic floatROT_EPSEpsilon of rotation [radian], 0.5 degrees or 0.008726646 radians-
Fields inherited from class com.jogamp.graph.ui.Shape
ZAscendingComparator, ZDescendingComparator
-
-
Constructor Summary
Constructors Constructor Description AnimGroup(Group.Layout l)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnimGroup.SetaddAnimSet(float pixPerMM, GLProfile glp, com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, float accel, float velocity, float ang_accel, float ang_velo, AnimGroup.LerpFunc lerp, Shape refShape)Add a newAnimGroup.Setwith an emptyAnimGroup.ShapeDatacontainer.AnimGroup.SetaddGlyphSet(float pixPerMM, GLProfile glp, com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, int renderModes, Font font, char refChar, CharSequence text, float fontScale, float accel, float velocity, float ang_accel, float ang_velo, AnimGroup.LerpFunc lerp, AnimGroup.ShapeSetup op)Add a newAnimGroup.SetwithAnimGroup.ShapeDatafor eachGlyphShape, moving towards its target position using a generic displacement viaAnimGroup.ShapeSetupto determine eachAnimGroup.ShapeData's starting position.AnimGroup.SetaddGlyphSetHorizScroll01(float pixPerMM, GLProfile glp, com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, int renderModes, Font font, CharSequence text, float fontScale, com.jogamp.math.Vec4f fgCol, float velocity, com.jogamp.math.geom.AABBox animBox, float y_offset)Add a newAnimGroup.SetwithAnimGroup.ShapeDatafor eachGlyphShape, implementing
horizontal continuous scrolling while repeating the giventext.AnimGroup.SetaddGlyphSetRandom01(float pixPerMM, GLProfile glp, com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, int renderModes, Font font, CharSequence text, float fontScale, com.jogamp.math.Vec4f fgCol, float accel, float velocity, float ang_accel, float ang_velo, com.jogamp.math.geom.AABBox animBox, boolean z_only, Random random, AnimGroup.LerpFunc lerp)Add a newAnimGroup.SetwithAnimGroup.ShapeDatafor eachGlyphShape, moving towards its target position using a fixed displacement function, defining eachAnimGroup.ShapeData's starting position.voiddraw(GL2ES2 gl, RegionRenderer renderer)Renders the shape.AnimGroup.SetgetAnimSet(int idx)Return theAnimGroup.Setat given index ornullif n/a.booleangetTickOnDraw()booleangetTickPaused()booleanisAnimationActive()voidremoveAllAnimSets(GL2ES2 gl, RegionRenderer renderer)voidremoveAnimSet(GL2ES2 gl, RegionRenderer renderer, AnimGroup.Set as)voidremoveAnimSets(GL2ES2 gl, RegionRenderer renderer, List<AnimGroup.Set> asList)voidresetAnimation()voidrestartAnimation()voidsetTickOnDraw(boolean v)voidsetTickPaused(boolean v)Sets whethertick()shall be paused, default isfalse.voidstopAnimation()voidtick()Issues an animation tick, usually done atdraw(GL2ES2, RegionRenderer).-
Methods inherited from class com.jogamp.graph.ui.Group
addShape, addShapes, contains, disableTopLevelWidget, enableTopLevelWidget, getBounds, getClipMvFrustum, getClipOnBounds, getFixedSize, getFixedSize, getLayout, getRelayoutOnDirtyShapes, getRenderedShapes, getShapeByID, getShapeByIdx, getShapeByName, getShapeCount, getShapes, getSubString, hasColorChannel, isCullingEnabled, isGroup, isOutside, isOutside2, isPMvCullingEnabled, isTopLevelWidget, removeAllShapes, removeShape, removeShape, removeShapes, removeShapes, replaceShape, setClipMvFrustum, setClipOnBounds, setFixedSize, setFixedSize, setLayout, setPMvCullingEnabled, setRelayoutOnDirtyShapes
-
Methods inherited from class com.jogamp.graph.ui.Shape
addActivationListener, addKeyListener, addMouseListener, applyMatToMv, clear, destroy, drawToSelect, getActiveColorMod, getAdjustedZ, getBorderColor, getBorderThickness, getBounds, getBounds, getColor, getID, getMat, getMat, getName, getPadding, getParent, getPixelPerShapeUnit, getPixelPerShapeUnit, getPixelPerShapeUnit, getPosition, getPressedColorMod, getRotation, getRotationPivot, getScale, getScaledDepth, getScaledHeight, getScaledWidth, getSurfacePort, getSurfaceSize, getSurfaceSize, getSurfaceSize, getToggleOffColorMod, getToggleOnColorMod, getTooltip, hasBorder, hasPadding, isActivable, isActive, isDiscarded, isDraggable, isFixedARatioResize, isInteractive, isMatIdentity, isPressed, isResizable, isToggleable, isToggleOn, isVisible, markShapeDirty, markStateDirty, move, move, moveTo, moveTo, onClicked, onDraw, onHover, onMove, onToggle, receiveKeyEvents, receiveMouseEvents, removeActivationListener, removeKeyListener, removeMouseListener, removeToolTip, runSynced, scale, scale, setActivable, setActiveColorMod, setBorder, setBorderColor, setBorderColor, setColor, setColor, setDiscarded, setDragAndResizable, setDraggable, setFixedARatioResize, setID, setInteractive, setName, setPaddding, setPMVMatrix, setPMVMatrix, setPressed, setPressedColorMod, setResizable, setRotation, setRotationPivot, setRotationPivot, setScale, setScale, setToggle, setToggleable, setToggleOffColorMod, setToggleOnColorMod, setToolTip, setVisible, shapeToWinCoord, shapeToWinCoord, shapeToWinCoord, toggle, toString, updateMat, validate, validate, validate, winToShapeCoord, winToShapeCoord, winToShapeCoord
-
-
-
-
Field Detail
-
POS_EPS
public static final float POS_EPS
Epsilon of position, 5000 xFloatUtil.EPSILON- See Also:
- Constant Field Values
-
ROT_EPS
public static final float ROT_EPS
Epsilon of rotation [radian], 0.5 degrees or 0.008726646 radians
-
-
Constructor Detail
-
AnimGroup
public AnimGroup(Group.Layout l)
Create a group of animatedShapes including other staticShapes w/ givenGroup.Layout.Default is non-interactive, see
Shape.setInteractive(boolean).- Parameters:
l- optionalGroup.Layout, maybenull
-
-
Method Detail
-
getAnimSet
public AnimGroup.Set getAnimSet(int idx)
Return theAnimGroup.Setat given index ornullif n/a.
-
removeAllAnimSets
public final void removeAllAnimSets(GL2ES2 gl, RegionRenderer renderer)
-
removeAnimSet
public final void removeAnimSet(GL2ES2 gl, RegionRenderer renderer, AnimGroup.Set as)
-
removeAnimSets
public final void removeAnimSets(GL2ES2 gl, RegionRenderer renderer, List<AnimGroup.Set> asList)
-
addAnimSet
public AnimGroup.Set addAnimSet(float pixPerMM, GLProfile glp, com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, float accel, float velocity, float ang_accel, float ang_velo, AnimGroup.LerpFunc lerp, Shape refShape)
Add a newAnimGroup.Setwith an emptyAnimGroup.ShapeDatacontainer.The given
PMVMatrix4fhas to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTIONandGLMatrixFunc.GL_MODELVIEWfor the surrounding scene only, without a shape'sShape.applyMatToMv(PMVMatrix4f). SeeScene.PMVMatrixSetup.set(PMVMatrix4f, Recti).- Parameters:
pixPerMM- monitor pixel per millimeter for accurate animationglp- usedGLProfilepmv- well formedPMVMatrix4f, e.g. could have been setup viaScene.PMVMatrixSetup.set(PMVMatrix4f, Recti).viewport- the int[4] viewportaccel- translation acceleration in [m]/[s*s]velocity- translation velocity in [m]/[s]ang_accel- angular acceleration in [radians]/[s*s], usable for rotation etcang_velo- angular velocity in [radians]/[s], usable for rotation etclerp-AnimGroup.LerpFuncfunction, seeAnimGroup.TargetLerprefShape- referenceShapegiving reference size, see#refShapeop-AnimGroup.ShapeDatasetup function forAnimGroup.ShapeData.startPosandAnimGroup.ShapeData.targetPos- Returns:
- a new
AnimGroup.Setinstance
-
addGlyphSet
public final AnimGroup.Set addGlyphSet(float pixPerMM, GLProfile glp, com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, int renderModes, Font font, char refChar, CharSequence text, float fontScale, float accel, float velocity, float ang_accel, float ang_velo, AnimGroup.LerpFunc lerp, AnimGroup.ShapeSetup op)
Add a newAnimGroup.SetwithAnimGroup.ShapeDatafor eachGlyphShape, moving towards its target position using a generic displacement viaAnimGroup.ShapeSetupto determine eachAnimGroup.ShapeData's starting position.The given
PMVMatrix4fhas to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTIONandGLMatrixFunc.GL_MODELVIEWfor the surrounding scene only, without a shape'sShape.applyMatToMv(PMVMatrix4f). SeeScene.PMVMatrixSetup.set(PMVMatrix4f, Recti).- Parameters:
pixPerMM- monitor pixel per millimeter for accurate animationglp- usedGLProfilepmv- well formedPMVMatrix4f, e.g. could have been setup viaScene.PMVMatrixSetup.set(PMVMatrix4f, Recti).viewport- the int[4] viewportrenderModes- usedregion render-modesfont-Fontto be used for resultingGlyphShapesrefChar- reference character to calculate the referenceGlyphShapetext- the text for resultingGlyphShapesfontScale- font scale factor for resultingGlyphShapesaccel- translation acceleration in [m]/[s*s]velocity- translation velocity in [m]/[s]ang_accel- angular acceleration in [radians]/[s*s], usable for rotation etcang_velo- angular velocity in [radians]/[s], usable for rotation etclerp-AnimGroup.LerpFuncfunction, seeAnimGroup.TargetLerpop-AnimGroup.ShapeDatasetup function forAnimGroup.ShapeData.startPosandAnimGroup.ShapeData.targetPos- Returns:
- newly created and added
AnimGroup.Set
-
addGlyphSetRandom01
public final AnimGroup.Set addGlyphSetRandom01(float pixPerMM, GLProfile glp, com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, int renderModes, Font font, CharSequence text, float fontScale, com.jogamp.math.Vec4f fgCol, float accel, float velocity, float ang_accel, float ang_velo, com.jogamp.math.geom.AABBox animBox, boolean z_only, Random random, AnimGroup.LerpFunc lerp)
Add a newAnimGroup.SetwithAnimGroup.ShapeDatafor eachGlyphShape, moving towards its target position using a fixed displacement function, defining eachAnimGroup.ShapeData's starting position.The start-position is randomly chosen within given
AABBoxglyphBox.The given
PMVMatrix4fhas to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTIONandGLMatrixFunc.GL_MODELVIEWfor the surrounding scene only, without a shape'sShape.applyMatToMv(PMVMatrix4f). SeeScene.PMVMatrixSetup.set(PMVMatrix4f, Recti).- Parameters:
pixPerMM- monitor pixel per millimeter for accurate animationglp- usedGLProfilepmv- well formedPMVMatrix4f, e.g. could have been setup viaScene.PMVMatrixSetup.set(PMVMatrix4f, Recti).viewport- the int[4] viewportrenderModes- usedregion render-modesfont-Fontto be used for resultingGlyphShapestext- the text for resultingGlyphShapesfontScale- font scale factor for resultingGlyphShapesfgCol- foreground color for resultingGlyphShapesaccel- translation acceleration in [m]/[s*s]velocity- translation velocity in [m]/[s]ang_accel- angular acceleration in [radians]/[s*s], usable for rotation etcang_velo- angular velocity in [radians]/[s], usable for rotation etcanimBox-AABBoxdenoting the maximum extend ofAnimGroup.ShapeDatas start-position, also used for their x-offsetz_only- Pass true for z-only distancerandom- the random float generatorlerp-AnimGroup.LerpFuncfunction, seeAnimGroup.TargetLerp- Returns:
- newly created and added
AnimGroup.Set
-
addGlyphSetHorizScroll01
public final AnimGroup.Set addGlyphSetHorizScroll01(float pixPerMM, GLProfile glp, com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, int renderModes, Font font, CharSequence text, float fontScale, com.jogamp.math.Vec4f fgCol, float velocity, com.jogamp.math.geom.AABBox animBox, float y_offset)
Add a newAnimGroup.SetwithAnimGroup.ShapeDatafor eachGlyphShape, implementing
horizontal continuous scrolling while repeating the giventext.The given
PMVMatrix4fhas to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTIONandGLMatrixFunc.GL_MODELVIEWfor the surrounding scene only, without a shape'sShape.applyMatToMv(PMVMatrix4f). SeeScene.PMVMatrixSetup.set(PMVMatrix4f, Recti).- Parameters:
pixPerMM- monitor pixel per millimeter for accurate animationglp- usedGLProfilepmv- well formedPMVMatrix4f, e.g. could have been setup viaScene.PMVMatrixSetup.set(PMVMatrix4f, Recti).viewport- the int[4] viewportrenderModes- usedregion render-modesfont-Fontto be used for resultingGlyphShapestext- the text for resultingGlyphShapesfontScale- font scale factor for resultingGlyphShapesfgCol- foreground color for resultingGlyphShapesvelocity- translation velocity in [m]/[s]animBox-AABBoxdenoting the maximum extend ofAnimGroup.ShapeDatas start-position, also used for their x-offset- Returns:
- newly created and added
AnimGroup.Set
-
setTickOnDraw
public final void setTickOnDraw(boolean v)
-
getTickOnDraw
public final boolean getTickOnDraw()
-
setTickPaused
public final void setTickPaused(boolean v)
-
getTickPaused
public final boolean getTickPaused()
-
draw
public void draw(GL2ES2 gl, RegionRenderer renderer)
Description copied from class:ShapeRenders the shape.Shape.applyMatToMv(PMVMatrix4f)is expected to be completed beforehand.- Overrides:
drawin classShape- Parameters:
gl- the current GL objectrenderer-RegionRendererwhich might be used for Graph Curve Rendering, also source ofRegionRenderer.getMatrix()andRegionRenderer.getViewport().
-
resetAnimation
public final void resetAnimation()
-
restartAnimation
public final void restartAnimation()
-
stopAnimation
public void stopAnimation()
-
isAnimationActive
public final boolean isAnimationActive()
-
tick
public final void tick()
Issues an animation tick, usually done atdraw(GL2ES2, RegionRenderer).- See Also:
setTickOnDraw(boolean),setTickPaused(boolean)
-
-