Example usage for com.badlogic.gdx.physics.box2d WorldManifold getNormal

List of usage examples for com.badlogic.gdx.physics.box2d WorldManifold getNormal

Introduction

In this page you can find the example usage for com.badlogic.gdx.physics.box2d WorldManifold getNormal.

Prototype

public Vector2 getNormal() 

Source Link

Document

Returns the normal of this manifold

Usage

From source file:com.arkanoid.game.model.GameField.java

License:Apache License

public void processBallAndVausContact(Contact contact) {
    WorldManifold wm = contact.getWorldManifold();
    Vector2 normal = wm.getNormal();
    normal.x = normal.x * 1000000;/*from  w  w w.j  ava 2s  .c  om*/
    normal.y = normal.y * 1000000;
    for (int i = 0; i < 10; i++) {
        world.step(1 / 60f, 10, 10);
        ball.getBody().applyLinearImpulse(normal, ball.getBody().getPosition(), true);
    }
    getWorldListener().processBallAndVausContact();
}