List of usage examples for com.badlogic.gdx.math.collision BoundingBox getHeight
public float getHeight()
From source file:com.andgate.ikou.render.FloorRender.java
License:Open Source License
private void calculateSize() { size.x = 0;// w w w . j a v a 2 s.c o m 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()); }
From source file:com.quadbits.gdxhelper.actors.ParticleEffectActor.java
License:Apache License
@Override public void drawDebug(ShapeRenderer shapes) { super.drawDebug(shapes); if (!this.getDebug() || effect == null) return;/*www. j ava2s. c om*/ shapes.set(ShapeRenderer.ShapeType.Line); shapes.setColor(getStage().getDebugColor()); BoundingBox boundingBox = effect.getBoundingBox(); float centerX = boundingBox.getCenterX(); float centerY = boundingBox.getCenterY(); float width = boundingBox.getWidth(); float height = boundingBox.getHeight(); shapes.rect(centerX - width / 2, centerY - height / 2, width, height); }