Package com.jme.bounding

Examples of com.jme.bounding.BoundingBox


        subNode[0].setRenderState(Tool.createXRayShader());
        triMesh[0] = new Sphere("sphere", new Vector3f(0, 0, 0), 10, 10, 5);
        triMesh[0].setModelBound(new BoundingSphere());
        subNode[1] = new Node("boxes");
        triMesh[1] = new Box("box", new Vector3f(0, 0, 0), 5, 5, 5);
        triMesh[1].setModelBound(new BoundingBox());
        subNode[2] = new Node("toruses");
        triMesh[2] = new Torus("torus", 10, 10, 2, 3);
        triMesh[2].setModelBound(new BoundingBox());
        subNode[3] = new Node("cylinders");
        triMesh[3] = new Cylinder("cylinder", 10, 10, 2, 3, true);
        triMesh[3].setModelBound(new BoundingBox());
        subNode[4] = new Node("pyramids");
        triMesh[4] = new Pyramid("pyramid", 10, 10);
        triMesh[4].setModelBound(new BoundingBox());

        for (int i = 0; i < subNode.length; i++) {
            node.attachChild(subNode[i]);
           
        }
View Full Code Here


        public BoundingVolume createBounds() {
            switch(boundsType) {
                case SPHERE :
                    return new BoundingSphere(dimension_x, new Vector3f(center_x, center_y, center_z));
                case BOX :
                    return new BoundingBox(new Vector3f(center_x, center_y, center_z), dimension_x, dimension_y, dimension_z);
                default :
                    throw new RuntimeException("Unsupported bounds type "+boundsType);
            }
        }
View Full Code Here

       
        if (type.equals(BoundsType.SPHERE) == true) {
            return new BoundingSphere(x, new Vector3f());
        }
        else if (type.equals(BoundsType.BOX) == true) {
            return new BoundingBox(new Vector3f(), x, (float)setup.getBounds().y, (float)setup.getBounds().z);
        }
       
        /* This should never happen, but in case it does... */
        throw new RuntimeException("Unsupported bounds type " + type);
    }
View Full Code Here

    /** Default constructor, used when cell is created via WFS */
    public ColladaCellMO() {
    }
   
    public ColladaCellMO(Vector3f center, float size, AssetURI modelURI, Vector3f geometryTranslation, Quaternion geometryRotation) {
        super(new BoundingBox(new Vector3f(), size, size, size), new CellTransform(null, center));
        this.modelURI = modelURI;
        this.geometryRotation = geometryRotation;
        this.geometryTranslation = geometryTranslation;
    }
View Full Code Here

    private Space createSpace(int x, int y, int z) {
       
        Vector3f center = new Vector3f(((x) * SPACE_SIZE*2),
                                       ((y) * SPACE_SIZE*2),
                                       ((z) * SPACE_SIZE*2));
        BoundingBox gridBounds = new BoundingBox(center,
                                                 SPACE_SIZE,
                                                 SPACE_SIZE,
                                                 SPACE_SIZE);

        String bindingName = getSpaceBindingName(x, y, z);
View Full Code Here

        return new CellTransform(look, origin);
    }
   
    private boolean isLarge(BoundingVolume bounds) {
        if (bounds instanceof BoundingBox) {
            BoundingBox box = (BoundingBox) bounds;
            return (box.xExtent > 20 || box.zExtent > 20);
        } else if (bounds instanceof BoundingSphere) {
            BoundingSphere sphere = (BoundingSphere) bounds;
            return (sphere.radius > 20);
        } else {
View Full Code Here

        TreeScan.findNode(node, new ProcessNodeInterface() {

            public boolean processNode(Spatial node) {
                if (node instanceof Geometry) {
                    if (node.getWorldBound()==null) {
                        node.setModelBound(new BoundingBox());
                        node.updateModelBound();
                    }
                }
                return true;
            }
View Full Code Here

    protected float scaleBounds(BoundingVolume bounds) {
        float radius = 1f;
       
        if (bounds instanceof BoundingBox) {
            BoundingBox bb = (BoundingBox) bounds;
            radius = Math.max(bb.xExtent, Math.max(bb.yExtent, bb.zExtent));
        } else if (bounds instanceof BoundingSphere) {
            radius = ((BoundingSphere) bounds).getRadius();
        }
       
View Full Code Here

        // Include the frame header and footer
        float height = height3D + Frame2DCell.HEADER_HEIGHT + Frame2DCell.SIDE_THICKNESS;

        // Determine the "first visible bounds" based on the size of the first-visible window
        BoundingBox bbox = new BoundingBox(new Vector3f(), width3D/2.0f, height/2.0f, 1f);
        logger.info("new bbox = " + bbox);
       
        // Calculate the "best" initial cell transform, based on the size of the first
        // window made visible.
        CellTransform ct = CellPlacementUtils.getCellTransform(null, bbox, creatorViewTransform);
View Full Code Here

    public PhoneCellMO() {
    }

    public PhoneCellMO(Vector3f center, float size) {
        super(new BoundingBox(new Vector3f(), size, size, size),
                new CellTransform(null, center));
    }
View Full Code Here

TOP

Related Classes of com.jme.bounding.BoundingBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.