}
@Override
public void cursorStarted(InputCursor m, MTFingerInputEvt positionEvent) {
IMTComponent3D comp = positionEvent.getTargetComponent();
if (lockedMotions.size() >= 2){ //scale with 2 fingers already in progress
unUsedMotions.add(m);
logger.debug(this.getName() + " has already enough motions for this gesture - adding to unused ID:" + m.getId());
}else{ //no scale in progress yet
if (unUsedMotions.size() == 1){
logger.debug(this.getName() + " has already has 1 unused motion - we can try start gesture! used with ID:" + unUsedMotions.get(0).getId() + " and new motion ID:" + m.getId());
InputCursor otherMotion = unUsedMotions.get(0);
//See if we can obtain a lock on both motions
if (this.canLock(otherMotion, m)){
float newDistance = Vector3D.distance(
new Vector3D(otherMotion.getCurrentEvent().getPosX(), otherMotion.getCurrentEvent().getPosY(),0),
new Vector3D(m.getCurrentEvent().getPosX(), m.getCurrentEvent().getPosY(),0));
if (newDistance < zoomDetectRadius) {
this.oldDistance = newDistance;
this.getLock(otherMotion, m);
lockedMotions.add(otherMotion);
lockedMotions.add(m);
unUsedMotions.remove(otherMotion);
logger.debug(this.getName() + " we could lock both motions! And fingers in zoom distance!");
this.fireGestureEvent(new ZoomEvent(this, MTGestureEvent.GESTURE_DETECTED, comp, m, otherMotion, 0f, comp.getViewingCamera() ));
}else{
logger.debug(this.getName() + " Motions not close enough to start gesture. Distance: " + newDistance);
}
}else{
logger.debug(this.getName() + " we could NOT lock both motions!");