Package pro.streem.ar.sceneform.ux
Class ScaleController
- java.lang.Object
-
- pro.streem.ar.sceneform.ux.BaseTransformationController<PinchGesture>
-
- pro.streem.ar.sceneform.ux.ScaleController
-
- All Implemented Interfaces:
pro.streem.ar.sceneform.Node.LifecycleListener,BaseGesture.OnGestureEventListener<PinchGesture>,BaseGestureRecognizer.OnGestureStartedListener<PinchGesture>
public class ScaleController extends BaseTransformationController<PinchGesture>
Manipulates the Scale of aBaseTransformableNodeusing a PinchPinchGestureRecognizer. Applies a tunable elastic bounce-back when scaling theBaseTransformableNodebeyond the min/max scale.
-
-
Field Summary
Fields Modifier and Type Field Description static floatDEFAULT_ELASTICITYstatic floatDEFAULT_MAX_SCALEstatic floatDEFAULT_MIN_SCALEstatic floatDEFAULT_SENSITIVITY
-
Constructor Summary
Constructors Constructor Description ScaleController(BaseTransformableNode transformableNode, PinchGestureRecognizer gestureRecognizer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanStartTransformation(PinchGesture gesture)floatgetElasticity()floatgetMaxScale()floatgetMinScale()floatgetSensitivity()voidonActivated(pro.streem.ar.sceneform.Node node)voidonContinueTransformation(PinchGesture gesture)voidonEndTransformation(PinchGesture gesture)voidonUpdated(pro.streem.ar.sceneform.Node node, pro.streem.ar.sceneform.FrameTime frameTime)voidsetElasticity(float elasticity)voidsetMaxScale(float maxScale)voidsetMinScale(float minScale)voidsetSensitivity(float sensitivity)-
Methods inherited from class pro.streem.ar.sceneform.ux.BaseTransformationController
getActiveGesture, getTransformableNode, isEnabled, isTransforming, onDeactivated, onFinished, onGestureStarted, onUpdated, setEnabled
-
-
-
-
Field Detail
-
DEFAULT_MIN_SCALE
public static final float DEFAULT_MIN_SCALE
- See Also:
- Constant Field Values
-
DEFAULT_MAX_SCALE
public static final float DEFAULT_MAX_SCALE
- See Also:
- Constant Field Values
-
DEFAULT_SENSITIVITY
public static final float DEFAULT_SENSITIVITY
- See Also:
- Constant Field Values
-
DEFAULT_ELASTICITY
public static final float DEFAULT_ELASTICITY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ScaleController
public ScaleController(BaseTransformableNode transformableNode, PinchGestureRecognizer gestureRecognizer)
-
-
Method Detail
-
setMinScale
public void setMinScale(float minScale)
-
getMinScale
public float getMinScale()
-
setMaxScale
public void setMaxScale(float maxScale)
-
getMaxScale
public float getMaxScale()
-
setSensitivity
public void setSensitivity(float sensitivity)
-
getSensitivity
public float getSensitivity()
-
setElasticity
public void setElasticity(float elasticity)
-
getElasticity
public float getElasticity()
-
onActivated
public void onActivated(pro.streem.ar.sceneform.Node node)
- Specified by:
onActivatedin interfacepro.streem.ar.sceneform.Node.LifecycleListener- Overrides:
onActivatedin classBaseTransformationController<PinchGesture>
-
onUpdated
public void onUpdated(pro.streem.ar.sceneform.Node node, pro.streem.ar.sceneform.FrameTime frameTime)- Specified by:
onUpdatedin interfacepro.streem.ar.sceneform.Node.LifecycleListener- Overrides:
onUpdatedin classBaseTransformationController<PinchGesture>
-
canStartTransformation
public boolean canStartTransformation(PinchGesture gesture)
- Specified by:
canStartTransformationin classBaseTransformationController<PinchGesture>
-
onContinueTransformation
public void onContinueTransformation(PinchGesture gesture)
- Specified by:
onContinueTransformationin classBaseTransformationController<PinchGesture>
-
onEndTransformation
public void onEndTransformation(PinchGesture gesture)
- Specified by:
onEndTransformationin classBaseTransformationController<PinchGesture>
-
-