Search in sources :

Example 1 with WireBox

use of com.jme3.scene.debug.WireBox in project jmonkeyengine by jMonkeyEngine.

the class WireBox method makeGeometry.

/**
     * Create a geometry suitable for visualizing the specified bounding box.
     *
     * @param bbox the bounding box (not null)
     * @return a new Geometry instance in world space
     */
public static Geometry makeGeometry(BoundingBox bbox) {
    float xExtent = bbox.getXExtent();
    float yExtent = bbox.getYExtent();
    float zExtent = bbox.getZExtent();
    WireBox mesh = new WireBox(xExtent, yExtent, zExtent);
    Geometry result = new Geometry("bounding box", mesh);
    Vector3f center = bbox.getCenter();
    result.setLocalTranslation(center);
    return result;
}
Also used : Geometry(com.jme3.scene.Geometry) Vector3f(com.jme3.math.Vector3f)

Example 2 with WireBox

use of com.jme3.scene.debug.WireBox in project jmonkeyengine by jMonkeyEngine.

the class TerrainQuad method attachBoundingBox.

/**
     * used by attachBoundChildren()
     */
private void attachBoundingBox(BoundingBox bb, Node parent) {
    WireBox wb = new WireBox(bb.getXExtent(), bb.getYExtent(), bb.getZExtent());
    Geometry g = new Geometry();
    g.setMesh(wb);
    g.setLocalTranslation(bb.getCenter());
    parent.attachChild(g);
}
Also used : Geometry(com.jme3.scene.Geometry) WireBox(com.jme3.scene.debug.WireBox)

Aggregations

Geometry (com.jme3.scene.Geometry)2 Vector3f (com.jme3.math.Vector3f)1 WireBox (com.jme3.scene.debug.WireBox)1