Examples of IObjectController


Examples of net.cis.client.game.common.ctrl.IObjectController

  @Override
  public void onAction(String name, boolean isPressed, float tpf) {
    if (isPressed)
      return;

    IObjectController objectController = GlobalObjectStore.<IObjectController>getObject(IObjectController.class);
   
    if (name.equals(InputStrings.CAMERA_1ST)) {
      if (currentCamera.cameraType.equals(CameraType.FirstPerson))
        return;

      objectController.removeControlledObjectFromScene(currentCamera);
      cameraFactory.setCreatedCamera(CameraType.FirstPerson);
      currentCamera = cameraFactory.createControlledObject(cameraDef, true);
      objectController.addCamera(currentCamera, true);

    } else if (name.equals(InputStrings.CAMERA_3RD)) {
      if (currentCamera.cameraType.equals(CameraType.ThirdPerson))
        return;

      objectController.removeControlledObjectFromScene(currentCamera);
      cameraFactory.setCreatedCamera(CameraType.ThirdPerson);
      currentCamera = cameraFactory.createControlledObject(cameraDef, true);
      objectController.addCamera(currentCamera, true);
    }
  }
View Full Code Here

Examples of net.cis.client.game.common.ctrl.IObjectController

          createDebugFighter("Foe " + i,foeMat, foeMat2, new Vector3f((float)Math.random()*-10, (float)Math.random()*-10, (float)Math.random() * 10 + 15));
    }
 
  protected void createDebugFighter(final String name, final Material main, final Material scnd, final Vector3f pos)
    {
    final IObjectController objCtrl = GlobalObjectStore.getObject(IObjectController.class);

    tcc.AddTimedCallback(new ICallback()
      {
      @Override
      public void execute()
        {
        SpaceObject so = SpaceobjectFactory.eINSTANCE.createAsteroid();
       
        so.setId(nextID++);
        so.setLocation(pos);
        so.setName(name);
        so.setRotation(new Quaternion());
        so.setLinearVelocity(new Vector3f());
        so.setAngularVelocity(new Quaternion());

        Node fighter = new Node(name);
        ControlledSpaceObject cso = new ControlledSpaceObject(so, fighter);
        cso.setDebugDisplay(name);
        cso.setGameThreadCallback(new SpatialUpdater(cso));

        Geometry gSphere = new Geometry("Sphere", new Sphere(10,10,0.25f));
        Geometry gDirection =  new Geometry("Direction-Line", new Line(new Vector3f(0,0,0), new Vector3f(0,0,2)));
       
        gSphere.setMaterial(main);
        gDirection.setMaterial(scnd);

        fighter.attachChild(gSphere);
        fighter.attachChild(gDirection);
       
       
        SimpleBoundingVolumeFactory.createBestBoundingVolume(fighter);
        fighter.setLocalTranslation(pos);
       
        objCtrl.addSpaceObject(cso, true);
        }
      }, (float) (Math.random() * 5));
    }
 
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.