Package com.jme3.bullet.control

Examples of com.jme3.bullet.control.RigidBodyControl


    // The PlaneCollisionShape causes collision listeners to ALWAYS fire for some reason. This
    // is a hacky workaround.
    int num = (int)radius * (int)radius;
    float[] height = new float[num];
    shape = new HeightfieldCollisionShape(height);// , new Vector3f(radius, 0, radius));
    physics = new RigidBodyControl(shape, 0);
  }
View Full Code Here


        Spatial underground = assetManager.loadModel("main.scene");
        underground.setLocalScale(2f);
        scene.attachChild(underground);
        CollisionShape sceneShape =
            CollisionShapeFactory.createMeshShape(scene);
        RigidBodyControl landscape;
        landscape = new RigidBodyControl(sceneShape, 0);
        scene.addControl(landscape);
        bulletAppState.getPhysicsSpace().add(scene);
        //Todo
    }
View Full Code Here

      spatial.setShadowMode(ShadowMode.Off);
      physics = new GhostControl(shape);
    }
    else {
      spatial.setShadowMode(ShadowMode.CastAndReceive);
      physics = new RigidBodyControl(shape, mass);
    }
    spatial.addControl(physics);
  }
View Full Code Here

        physicsSpace = bulletAppState.getPhysicsSpace();
        physicsSpace.setGravity(new Vector3f(0f, -12f, 0f));
        physicsSpace.setAccuracy(0.005f);
        //gives the world floor colision with 0 gravity so it doesent fall
       
        root.addControl(new RigidBodyControl(0.0f));
        //attaches the world floor to the bulletAppState
        physicsSpace.add(root);


    }
View Full Code Here

  public void initialize(AppStateManager stateManager, Application app) {
    super.initialize(stateManager, app);
    tuioInput = TuioInput.get();
    tuioInput.addListener(this);
    BitmapFont guiFont = app.getAssetManager().loadFont("Interface/Fonts/Default.fnt");
   
    BitmapText tuioStatsLabel = new BitmapText(guiFont, false);
        tuioStatsLabel.setLocalTranslation(0, tuioStatsLabel.getLineHeight()*3, 0);
        tuioStatsLabel.setText("Tuio Input:");
        tuioStatsNode.attachChild(tuioStatsLabel);
View Full Code Here

    super.initialize(stateManager, app);
    tuioInput = TuioInput.get();
    tuioInput.addListener(this);
    BitmapFont guiFont = app.getAssetManager().loadFont("Interface/Fonts/Default.fnt");
   
    BitmapText tuioStatsLabel = new BitmapText(guiFont, false);
        tuioStatsLabel.setLocalTranslation(0, tuioStatsLabel.getLineHeight()*3, 0);
        tuioStatsLabel.setText("Tuio Input:");
        tuioStatsNode.attachChild(tuioStatsLabel);
   
        tuioStatsText = new BitmapText(guiFont, false);
        tuioStatsText.setLocalTranslation(80, tuioStatsText.getLineHeight()*3, 0);
        tuioStatsText.setText("");
        tuioStatsNode.attachChild(tuioStatsText);
       
        tuioStatsText2 = new BitmapText(guiFont, false);
        tuioStatsText2.setLocalTranslation(80, tuioStatsText2.getLineHeight()*2, 0);
        tuioStatsText2.setText("");
        tuioStatsNode.attachChild(tuioStatsText2);
  }
View Full Code Here

  public void initialize(AppStateManager stateManager, Application app) {
    super.initialize(stateManager, app);
    //cam = app.getCamera();
    assetManager = app.getAssetManager();
        guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
        fpsText = new BitmapText(guiFont, false);
        fpsText.setLocalTranslation(0, fpsText.getLineHeight(), 0);
        fpsText.setText("Frames per second");
        //camText = new BitmapText(guiFont, false);
        //camText.setLocalTranslation(0, camText.getLineHeight()*5, 0);
        //camText.setText("Cam: ");
View Full Code Here

    guiNode.detachChildNamed("Statistics View");

    camNode = new Node("Cam Node");

    flyCam.setEnabled(false);
    ChaseCamera chaseCam = new ChaseCamera(cam, camNode, inputManager);
    chaseCam.setSmoothMotion(true);
    chaseCam.setMaxDistance(100000);
    chaseCam.setMinVerticalRotation(-FastMath.PI / 2);

    rootNode.attachChild(camNode);

  }
View Full Code Here

        super.setSpatial(spatial);

        if (spatial != null) {
            initialRotation = spatial.getLocalRotation().clone();

            inputManager.addMapping(LEFT_CLICK, new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
            inputManager.addListener(actionListener, LEFT_CLICK);

            weaponEntity = ((WeaponEntity) spatial.getUserData("entity"));
        }
    }
View Full Code Here

    private Camera cam = myApp.getCamera();
    private InputManager inputManager = myApp.getInputManager();
    private String LEFT_CLICK = "leftFood";

    public FoodThrowControl() {
        inputManager.addMapping(LEFT_CLICK, new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
        inputManager.addListener(this, LEFT_CLICK);
    }
View Full Code Here

TOP

Related Classes of com.jme3.bullet.control.RigidBodyControl

Copyright © 2018 www.massapicom. 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.