MinieExamples/src/main/java/jme3utilities/minie/test/TargetDemo.java
/**
     * Apply an upward impulse to the selected rigid body.
     */
Apply an upward impulse to the selected rigid body.
Apply an upward impulse to the selected rigid body .
private void popSelected() {
        if (selectedBody instanceof PhysicsRigidBody) {
            float gravity = status.gravity();
            float deltaV = FastMath.sqrt(30f * gravity);
            float impulse = selectedBody.getMass() * deltaV;
            Vector3f impulseVector = new Vector3f(0f, impulse, 0f);
            ShapeGenerator random = getGenerator();
            Vector3f offset = random.nextVector3f().multLocal(0.2f);
            PhysicsRigidBody rigidBody = selectedBody;
            rigidBody.applyImpulse(impulseVector, offset);
        }
    }
private void popSelected ( ) { if ( selectedBody instanceof PhysicsRigidBody ) { float gravity = status . gravity ( ) ; float deltaV = FastMath . sqrt ( 30f * gravity ) ; float impulse = selectedBody . getMass ( ) * deltaV ; Vector3f impulseVector = new Vector3f ( 0f , impulse , 0f ) ; ShapeGenerator random = getGenerator ( ) ; Vector3f offset = random . nextVector3f ( ) . multLocal ( 0.2f ) ; PhysicsRigidBody rigidBody = selectedBody ; rigidBody . applyImpulse ( impulseVector , offset ) ; } }
Apply an upward impulse to the selected rigid body.
Apply an upward impulse to the selected rigid body .