Package com.jogamp.graph.ui
Class AnimGroup.SineLerp
- java.lang.Object
-
- com.jogamp.graph.ui.AnimGroup.SineLerp
-
- All Implemented Interfaces:
AnimGroup.LerpFunc
- Enclosing class:
- AnimGroup
public static class AnimGroup.SineLerp extends Object implements AnimGroup.LerpFunc
Sine targetAnimGroup.LerpFunc
, approachingAnimGroup.ShapeData
's target position utilizing the angular value for sine amplitude towards the given normalized direction vector.The sine amplitude is flattened towards target.
Implementation uses the current shape position and relative time duration since last call to interpolate, hence allows rugged utilization even if shapes are dragged around.
-
-
Constructor Summary
Constructors Constructor Description SineLerp(com.jogamp.math.Vec3f sineDir, float sineScale, float shapeStep)
New sineAnimGroup.LerpFunc
instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
eval(long frame_cnt, AnimGroup.Set as, int idx, AnimGroup.ShapeData sd, float at_s, float dt_s)
Evaluate next LERP step for the givenAnimGroup.ShapeData
within the animationAnimGroup.Set
.
-
-
-
Constructor Detail
-
SineLerp
public SineLerp(com.jogamp.math.Vec3f sineDir, float sineScale, float shapeStep)
New sineAnimGroup.LerpFunc
instance- Parameters:
sineDir
- normalized vector for sine amplitude directionsineScale
- sine scale factor to amplify effectshapeStep
- shape indexidx
factor fordt_s
, amplifying angular distance between each shape. Golden ratio1.618f
reveals dynamic characteristics.
-
-
Method Detail
-
eval
public boolean eval(long frame_cnt, AnimGroup.Set as, int idx, AnimGroup.ShapeData sd, float at_s, float dt_s)
Description copied from interface:AnimGroup.LerpFunc
Evaluate next LERP step for the givenAnimGroup.ShapeData
within the animationAnimGroup.Set
.- Specified by:
eval
in interfaceAnimGroup.LerpFunc
- Parameters:
frame_cnt
- frame count for the givenAnimGroup.ShapeData
as
-AnimGroup.Set
of the animationidx
-AnimGroup.ShapeData
index within theAnimGroup.Set.allShapes
sd
- theAnimGroup.ShapeData
matchingidx
containing theShape
to apply this operationat_s
- time delta to animation start, i.e. animation duration [s]dt_s
- time delta to last call [s]- Returns:
- true if target animation shall continue, false otherwise
-
-