Examples of registerInputProcessor()


Examples of org.mt4j.components.MTComponent.registerInputProcessor()

      mesh.setDrawNormals(false);
    }
   
    //Register arcball gesture manipulation to the whole mesh-group
    meshGroup.setComposite(true); //-> Group gets picked instead of its children
    meshGroup.registerInputProcessor(new ArcballProcessor(mtApplication, biggestMesh));
    meshGroup.addGestureListener(ArcballProcessor.class, new IGestureEventListener(){
      //@Override
      public boolean processGestureEvent(MTGestureEvent ge) {
        ArcBallGestureEvent aEvt =  (ArcBallGestureEvent)ge;
        meshGroup.transform(aEvt.getTransformationMatrix());
View Full Code Here

Examples of org.mt4j.components.MTComponent.registerInputProcessor()

       
        //Put planets in a group that can be manipulated by gestures
        //so the rotation of the planets doesent get changed by the gestures
    MTComponent group = new MTComponent(mtApplication);
    group.setComposite(true); //This makes the group "consume" all picking and gestures of the children
    group.registerInputProcessor(new DragProcessor(mtApplication));
    group.addGestureListener(DragProcessor.class, new DefaultDragAction());
    group.addGestureListener(DragProcessor.class, new InertiaDragAction(80, 0.8f, 10));
    group.registerInputProcessor(new RotateProcessor(mtApplication));
    group.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
    //Scale the earth from the center. Else it might get distorted
View Full Code Here

Examples of org.mt4j.components.MTComponent.registerInputProcessor()

        meshGroup.transform(aEvt.getTransformationMatrix());
        return false;
      }
    });
   
    meshGroup.registerInputProcessor(new ScaleProcessor(mtApplication));
    meshGroup.addGestureListener(ScaleProcessor.class, new IGestureEventListener(){
      //@Override
      public boolean processGestureEvent(MTGestureEvent ge) {
        ScaleEvent se = (ScaleEvent)ge;
        meshGroup.scaleGlobal(se.getScaleFactorX(), se.getScaleFactorY(), se.getScaleFactorX(), biggestMesh.getCenterPointGlobal());
View Full Code Here

Examples of org.mt4j.components.MTComponent.registerInputProcessor()

    MTComponent group = new MTComponent(mtApplication);
    group.setComposite(true); //This makes the group "consume" all picking and gestures of the children
    group.registerInputProcessor(new DragProcessor(mtApplication));
    group.addGestureListener(DragProcessor.class, new DefaultDragAction());
    group.addGestureListener(DragProcessor.class, new InertiaDragAction(80, 0.8f, 10));
    group.registerInputProcessor(new RotateProcessor(mtApplication));
    group.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
    //Scale the earth from the center. Else it might get distorted
    group.registerInputProcessor(new ScaleProcessor(mtApplication));
    group.addGestureListener(ScaleProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
View Full Code Here

Examples of org.mt4j.components.MTComponent.registerInputProcessor()

        meshGroup.scaleGlobal(se.getScaleFactorX(), se.getScaleFactorY(), se.getScaleFactorX(), biggestMesh.getCenterPointGlobal());
        return false;
      }
    });
   
    meshGroup.registerInputProcessor(new RotateProcessor(mtApplication));
    meshGroup.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
  }

 
  public MTTriangleMesh getBiggestMesh(MTTriangleMesh[] meshes){
View Full Code Here

Examples of org.mt4j.components.MTComponent.registerInputProcessor()

    group.addGestureListener(DragProcessor.class, new DefaultDragAction());
    group.addGestureListener(DragProcessor.class, new InertiaDragAction(80, 0.8f, 10));
    group.registerInputProcessor(new RotateProcessor(mtApplication));
    group.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
    //Scale the earth from the center. Else it might get distorted
    group.registerInputProcessor(new ScaleProcessor(mtApplication));
    group.addGestureListener(ScaleProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        ScaleEvent se = (ScaleEvent)ge;
        earth.scaleGlobal(se.getScaleFactorX(), se.getScaleFactorY(), se.getScaleFactorX(), earth.getCenterPointGlobal());
        return false;
View Full Code Here

Examples of org.mt4j.components.MTComponent.registerInputProcessor()

        if (abstractComponentProcessor instanceof DragProcessor) {
          hasDragProcessor = true;
        }
      }
      if (!hasDragProcessor){
        comp.registerInputProcessor(new DragProcessor(comp.getRenderer()));
      }
     
      //For static bodies just alter the transform of the body
      comp.addGestureListener(DragProcessor.class, new IGestureEventListener() {
        //@Override
View Full Code Here

Examples of org.mt4j.components.MTComponent.registerInputProcessor()

        }

        //Make the group pickable and manipulatable
        group.setPickable(true);
       
        group.registerInputProcessor(new DragProcessor(pa));
        group.setGestureAllowance(DragProcessor.class, true);
        group.addGestureListener(DragProcessor.class, (IGestureEventListener)defaultDragAction);
       
        group.registerInputProcessor(new RotateProcessor(pa));
        group.addGestureListener(RotateProcessor.class, defaultRotateAction);
View Full Code Here

Examples of org.mt4j.components.MTComponent.registerInputProcessor()

       
        group.registerInputProcessor(new DragProcessor(pa));
        group.setGestureAllowance(DragProcessor.class, true);
        group.addGestureListener(DragProcessor.class, (IGestureEventListener)defaultDragAction);
       
        group.registerInputProcessor(new RotateProcessor(pa));
        group.addGestureListener(RotateProcessor.class, defaultRotateAction);
       
        group.registerInputProcessor(new ScaleProcessor(pa));
        group.addGestureListener(ScaleProcessor.class,  defaultScaleAction);
       
View Full Code Here

Examples of org.mt4j.components.MTComponent.registerInputProcessor()

        group.addGestureListener(DragProcessor.class, (IGestureEventListener)defaultDragAction);
       
        group.registerInputProcessor(new RotateProcessor(pa));
        group.addGestureListener(RotateProcessor.class, defaultRotateAction);
       
        group.registerInputProcessor(new ScaleProcessor(pa));
        group.addGestureListener(ScaleProcessor.class,  defaultScaleAction);
       
        ArrayList<MTComponent> groupChildren = new ArrayList<MTComponent>();
        //Traverse the children and add them to a new arraylist
        traverseChildren(gElem, groupChildren);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.