Package com.ardor3d.bounding

Examples of com.ardor3d.bounding.BoundingBox


    @Override
    protected void initExample() {
        _canvas.setTitle("TexCombine Example");

        final Quad quad = new Quad("Box", 4, 4);
        quad.setModelBound(new BoundingBox());
        quad.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        _root.attachChild(quad);

        final Texture ardorLogo = TextureManager.load("images/ardor3d_white_256.jpg",
                Texture.MinificationFilter.Trilinear, true);
View Full Code Here


            final ReadOnlyVector3 center = bounding.getCenter();
            double radius = 0;
            if (bounding instanceof BoundingSphere) {
                radius = ((BoundingSphere) bounding).getRadius();
            } else if (bounding instanceof BoundingBox) {
                final BoundingBox boundingBox = (BoundingBox) bounding;
                radius = Math.max(Math.max(boundingBox.getXExtent(), boundingBox.getYExtent()),
                        boundingBox.getZExtent());
            }

            final Vector3 vec = new Vector3(center);
            // XXX: a bit of a hack
            if (upAxis.equals(Vector3.UNIT_Z)) {
View Full Code Here

            final ReadOnlyVector3 center = bounding.getCenter();
            double radius = 0;
            if (bounding instanceof BoundingSphere) {
                radius = ((BoundingSphere) bounding).getRadius();
            } else if (bounding instanceof BoundingBox) {
                final BoundingBox boundingBox = (BoundingBox) bounding;
                radius = Math.max(Math.max(boundingBox.getXExtent(), boundingBox.getYExtent()),
                        boundingBox.getZExtent());
            }

            final Vector3 vec = new Vector3(center);
            vec.addLocal(radius * 2, radius * 1, radius * 2.5);

 
View Full Code Here

    private Node setupOccluders() {
        final Node occluders = new Node("Occluders");

        final Box box = new Box("Box", new Vector3(), 1, 40, 1);
        box.setModelBound(new BoundingBox());
        box.setRandomColors();

        final Random rand = new Random(1337);
        for (int x = 0; x < 8; x++) {
            for (int y = 0; y < 8; y++) {
View Full Code Here

        for (int i = 0; i < _corners.length; i++) {
            _corners[i].set(center);
        }

        if (sceneBounds instanceof BoundingBox) {
            final BoundingBox bbox = (BoundingBox) sceneBounds;
            bbox.getExtent(_extents);
        } else if (sceneBounds instanceof BoundingSphere) {
            final BoundingSphere bsphere = (BoundingSphere) sceneBounds;
            _extents.set(bsphere.getRadius(), bsphere.getRadius(), bsphere.getRadius());
        }
View Full Code Here

        if (!Vector3.isValid(volume.getCenter())) {
            return false;
        }
        switch (volume.getType()) {
            case AABB: {
                final BoundingBox vBox = (BoundingBox) volume;
                return !(Double.isInfinite(vBox.getXExtent()) || Double.isInfinite(vBox.getYExtent())
                        || Double.isInfinite(vBox.getZExtent()) || Double.isNaN(vBox.getXExtent())
                        || Double.isNaN(vBox.getYExtent()) || Double.isNaN(vBox.getZExtent()));
            }

            case Sphere: {
                final BoundingSphere vSphere = (BoundingSphere) volume;
                return !(Double.isInfinite(vSphere.getRadius()) || Double.isNaN(vSphere.getRadius()));
View Full Code Here

TOP

Related Classes of com.ardor3d.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.