Example usage for com.badlogic.gdx.math Matrix4 scl

List of usage examples for com.badlogic.gdx.math Matrix4 scl

Introduction

In this page you can find the example usage for com.badlogic.gdx.math Matrix4 scl.

Prototype

public Matrix4 scl(float scale) 

Source Link

Usage

From source file:org.catrobat.catroid.physics.PhysicsWorld.java

License:Open Source License

public void render(Matrix4 perspectiveMatrix) {
    if (renderer == null) {
        renderer = new Box2DDebugRenderer(PhysicsDebugSettings.Render.RENDER_BODIES,
                PhysicsDebugSettings.Render.RENDER_JOINTS, PhysicsDebugSettings.Render.RENDER_AABB,
                PhysicsDebugSettings.Render.RENDER_INACTIVE_BODIES,
                PhysicsDebugSettings.Render.RENDER_VELOCITIES, PhysicsDebugSettings.Render.RENDER_CONTACTS);
    }/*from  www. ja va2 s.c  om*/
    renderer.render(world, perspectiveMatrix.scl(PhysicsWorld.RATIO));
}

From source file:vault.clockwork.system.Physics.java

License:Open Source License

/**
 * Perform debug information render if enabled.
 *///from   w  w w  . ja va  2s  . c  om
@Override
public void postPerform() {
    if (Game.DEBUG_INFO) {
        // scale `world to screen`
        Matrix4 projMatrix;
        if (Game.mainCamera != null) {
            projMatrix = Game.mainCamera.combined.cpy();
        } else {
            projMatrix = new Matrix4().setToOrtho2D(0.f, 0.f, Gdx.graphics.getWidth(),
                    Gdx.graphics.getHeight());
        }
        projMatrix.scl(SCALE_INV);

        // perform debug rendering
        this.debugRenderer.render(this.world, projMatrix);
    }
}