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 interface
AnimGroup.LerpFunc
Linear interpolation (LERP) function to evaluate the next animated frame for eachAnimGroup.ShapeData
of aAnimGroup.Set
.static class
AnimGroup.ScrollLerp
ScrollingAnimGroup.LerpFunc
, approachingAnimGroup.ShapeData
's target position over and over.static class
AnimGroup.Set
Animation-Set covering itsAnimGroup.ShapeData
elements,AnimGroup.LerpFunc
and animation parameter.static class
AnimGroup.ShapeData
static interface
AnimGroup.ShapeSetup
AnimGroup.ShapeData
setup function for animation using its enclosingAnimGroup.Set
and other data pointsstatic class
AnimGroup.SineLerp
Sine targetAnimGroup.LerpFunc
, approachingAnimGroup.ShapeData
's target position utilizing the angular value for sine amplitude towards the given normalized direction vector.static class
AnimGroup.TargetLerp
Default 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 float
POS_EPS
Epsilon of position, 5000 xFloatUtil.EPSILON
static float
ROT_EPS
Epsilon 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.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.Set
with an emptyAnimGroup.ShapeData
container.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.Set
withAnimGroup.ShapeData
for eachGlyphShape
, moving towards its target position using a generic displacement viaAnimGroup.ShapeSetup
to determine eachAnimGroup.ShapeData
's starting position.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.Set
withAnimGroup.ShapeData
for eachGlyphShape
, implementing
horizontal continuous scrolling while repeating the giventext
.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.Set
withAnimGroup.ShapeData
for eachGlyphShape
, moving towards its target position using a fixed displacement function, defining eachAnimGroup.ShapeData
's starting position.void
draw(GL2ES2 gl, RegionRenderer renderer)
Renders the shape.AnimGroup.Set
getAnimSet(int idx)
Return theAnimGroup.Set
at given index ornull
if n/a.boolean
getTickOnDraw()
boolean
getTickPaused()
boolean
isAnimationActive()
void
removeAllAnimSets(GL2ES2 gl, RegionRenderer renderer)
void
removeAnimSet(GL2ES2 gl, RegionRenderer renderer, AnimGroup.Set as)
void
removeAnimSets(GL2ES2 gl, RegionRenderer renderer, List<AnimGroup.Set> asList)
void
resetAnimation()
void
restartAnimation()
void
setTickOnDraw(boolean v)
void
setTickPaused(boolean v)
Sets whethertick()
shall be paused, default isfalse
.void
stopAnimation()
void
tick()
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 animatedShape
s including other staticShape
s 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.Set
at given index ornull
if 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.Set
with an emptyAnimGroup.ShapeData
container.The given
PMVMatrix4f
has to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
for the surrounding scene only, without a shape'sShape.applyMatToMv(PMVMatrix4f)
. SeeScene.PMVMatrixSetup.set(PMVMatrix4f, Recti)
.- Parameters:
pixPerMM
- monitor pixel per millimeter for accurate animationglp
- usedGLProfile
pmv
- 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.LerpFunc
function, seeAnimGroup.TargetLerp
refShape
- referenceShape
giving reference size, see#refShape
op
-AnimGroup.ShapeData
setup function forAnimGroup.ShapeData.startPos
andAnimGroup.ShapeData.targetPos
- Returns:
- a new
AnimGroup.Set
instance
-
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.Set
withAnimGroup.ShapeData
for eachGlyphShape
, moving towards its target position using a generic displacement viaAnimGroup.ShapeSetup
to determine eachAnimGroup.ShapeData
's starting position.The given
PMVMatrix4f
has to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
for the surrounding scene only, without a shape'sShape.applyMatToMv(PMVMatrix4f)
. SeeScene.PMVMatrixSetup.set(PMVMatrix4f, Recti)
.- Parameters:
pixPerMM
- monitor pixel per millimeter for accurate animationglp
- usedGLProfile
pmv
- well formedPMVMatrix4f
, e.g. could have been setup viaScene.PMVMatrixSetup.set(PMVMatrix4f, Recti)
.viewport
- the int[4] viewportrenderModes
- usedregion render-modes
font
-Font
to be used for resultingGlyphShape
srefChar
- reference character to calculate the referenceGlyphShape
text
- the text for resultingGlyphShape
sfontScale
- font scale factor for resultingGlyphShape
saccel
- 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.LerpFunc
function, seeAnimGroup.TargetLerp
op
-AnimGroup.ShapeData
setup function forAnimGroup.ShapeData.startPos
andAnimGroup.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.Set
withAnimGroup.ShapeData
for 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
AABBox
glyphBox.The given
PMVMatrix4f
has to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
for the surrounding scene only, without a shape'sShape.applyMatToMv(PMVMatrix4f)
. SeeScene.PMVMatrixSetup.set(PMVMatrix4f, Recti)
.- Parameters:
pixPerMM
- monitor pixel per millimeter for accurate animationglp
- usedGLProfile
pmv
- well formedPMVMatrix4f
, e.g. could have been setup viaScene.PMVMatrixSetup.set(PMVMatrix4f, Recti)
.viewport
- the int[4] viewportrenderModes
- usedregion render-modes
font
-Font
to be used for resultingGlyphShape
stext
- the text for resultingGlyphShape
sfontScale
- font scale factor for resultingGlyphShape
sfgCol
- foreground color for resultingGlyphShape
saccel
- 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
-AABBox
denoting the maximum extend ofAnimGroup.ShapeData
s start-position, also used for their x-offsetz_only
- Pass true for z-only distancerandom
- the random float generatorlerp
-AnimGroup.LerpFunc
function, 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.Set
withAnimGroup.ShapeData
for eachGlyphShape
, implementing
horizontal continuous scrolling while repeating the giventext
.The given
PMVMatrix4f
has to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
for the surrounding scene only, without a shape'sShape.applyMatToMv(PMVMatrix4f)
. SeeScene.PMVMatrixSetup.set(PMVMatrix4f, Recti)
.- Parameters:
pixPerMM
- monitor pixel per millimeter for accurate animationglp
- usedGLProfile
pmv
- well formedPMVMatrix4f
, e.g. could have been setup viaScene.PMVMatrixSetup.set(PMVMatrix4f, Recti)
.viewport
- the int[4] viewportrenderModes
- usedregion render-modes
font
-Font
to be used for resultingGlyphShape
stext
- the text for resultingGlyphShape
sfontScale
- font scale factor for resultingGlyphShape
sfgCol
- foreground color for resultingGlyphShape
svelocity
- translation velocity in [m]/[s]animBox
-AABBox
denoting the maximum extend ofAnimGroup.ShapeData
s 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:Shape
Renders the shape.Shape.applyMatToMv(PMVMatrix4f)
is expected to be completed beforehand.- Overrides:
draw
in classShape
- Parameters:
gl
- the current GL objectrenderer
-RegionRenderer
which 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)
-
-