Example usage for com.badlogic.gdx.math.collision BoundingBox getDepth

List of usage examples for com.badlogic.gdx.math.collision BoundingBox getDepth

Introduction

In this page you can find the example usage for com.badlogic.gdx.math.collision BoundingBox getDepth.

Prototype

public float getDepth() 

Source Link

Usage

From source file:com.andgate.ikou.render.FloorRender.java

License:Open Source License

private void calculateSize() {
    size.x = 0;/*from   w w  w  .  j a v a2 s  .  com*/
    size.y = 0;
    size.z = 0;

    for (SectorMesh[] sectorMeshRow : sectorMeshes) {
        for (SectorMesh sectorMesh : sectorMeshRow) {
            Mesh mesh = sectorMesh.getMesh();

            if (mesh != null) {
                BoundingBox bbox = mesh.calculateBoundingBox();

                size.x += bbox.getWidth();
                size.y = Math.max(size.y, bbox.getHeight());
                size.z += bbox.getDepth();
            }
        }
    }
}

From source file:com.badlogic.gdx.tests.dragome.examples.bullet.BulletConstructor.java

License:Apache License

/** Creates a btBoxShape with the same dimensions as the shape. */
public BulletConstructor(final Model model, final float mass) {
    final BoundingBox boundingBox = new BoundingBox();
    model.calculateBoundingBox(boundingBox);
    create(model, mass, boundingBox.getWidth(), boundingBox.getHeight(), boundingBox.getDepth());
}