Exemplo n.º 1
0
 private void sitDown(final String placeToSit) {
   /*GoCloseToObjectCommand gtc = new GoCloseToObjectCommand("Patient", placeToSit, new PHATCommandListener() {
       @Override
       public void commandStateChanged(PHATCommand command) {
           if (command.getState() == PHATCommand.State.Success) {
               bodiesAppState.runCommand(new SitDownCommand("Patient", placeToSit));
           }
       }
   });
   gtc.setMinDistance(0.1f);
   bodiesAppState.runCommand(gtc);*/
   bodiesAppState.runCommand(new SitDownCommand("Patient", placeToSit));
 }
Exemplo n.º 2
0
 private void goToUse(final String obj) {
   GoCloseToObjectCommand gtc =
       new GoCloseToObjectCommand(
           "Patient",
           obj,
           new PHATCommandListener() {
             @Override
             public void commandStateChanged(PHATCommand command) {
               if (command.getState() == PHATCommand.State.Success) {
                 bodiesAppState.runCommand(new AlignWithCommand("Patient", obj));
                 bodiesAppState.runCommand(new OpenObjectCommand("Patient", obj));
               }
             }
           });
   gtc.setMinDistance(0.1f);
   bodiesAppState.runCommand(gtc);
 }
Exemplo n.º 3
0
  @Override
  public void init(SimpleApplication app) {
    AppStateManager stateManager = app.getStateManager();

    app.getFlyByCamera().setMoveSpeed(10f);

    app.getCamera().setLocation(new Vector3f(4.497525f, 6.3693237f, 4.173162f));
    app.getCamera().setRotation(new Quaternion(0.5199084f, 0.42191547f, -0.32954147f, 0.6656463f));
    app.getFlyByCamera().setDragToRotate(true);

    BulletAppState bulletAppState = new BulletAppState();
    stateManager.attach(bulletAppState);
    // bulletAppState.setDebugEnabled(true);

    seAPI = SpatialEnvironmentAPI.createSpatialEnvironmentAPI(app);

    seAPI.getWorldAppState().setCalendar(2013, 1, 1, 12, 0, 0);
    seAPI.getWorldAppState().setLandType(WorldAppState.LandType.Basic);
    seAPI
        .getHouseAppState()
        .runCommand(new CreateHouseCommand("House1", HouseFactory.HouseType.BrickHouse60m));

    bodiesAppState = new BodiesAppState();
    stateManager.attach(bodiesAppState);

    bodiesAppState.createBody(BodiesAppState.BodyType.Elder, "Patient");
    bodiesAppState.setInSpace("Patient", "House1", "Kitchen");
    // haveAShower();
    // sitDown("WC1");
    goToUse("WC1");
    // bodiesAppState.runCommand(new GoToSpaceCommand("Patient", "Kitchen"));
    // sitDown("Sofa3Seats");
    bodiesAppState.runCommand(new TremblingHeadCommand("Patient", true));
    bodiesAppState.runCommand(new TremblingHandCommand("Patient", true, true));
    bodiesAppState.runCommand(new TremblingHandCommand("Patient", true, false));
    // bodiesAppState.runCommand(new SetCameraToBodyCommand("Patient"));
    bodiesAppState.runCommand(new SetPCListenerToBodyCommand("Patient"));
    // bodiesAppState.runCommand(new BodyLabelCommand("Patient", true));
  }
Exemplo n.º 4
0
 private void finishUseWC() {
   bodiesAppState.runCommand(new StandUpCommand("Patient"));
   bodiesAppState.runCommand(new OpenObjectCommand("Patient", "WC1"));
 }