Package com.ardor3d.bounding

Examples of com.ardor3d.bounding.BoundingSphere


        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());
        }

        _corners[0].addLocal(_extents.getX(), _extents.getY(), _extents.getZ());
        _corners[1].addLocal(_extents.getX(), -_extents.getY(), _extents.getZ());
        _corners[2].addLocal(_extents.getX(), _extents.getY(), -_extents.getZ());
View Full Code Here


        if (worldBound instanceof BoundingBox) {
            final BoundingBox bbox = (BoundingBox) worldBound;
            bbox.getExtent(_extents);
        } else if (worldBound instanceof BoundingSphere) {
            final BoundingSphere bsphere = (BoundingSphere) worldBound;
            _extents.set(bsphere.getRadius(), bsphere.getRadius(), bsphere.getRadius());
        }

        _corners[0].addLocal(_extents.getX(), _extents.getY(), -_extents.getZ());
        _corners[1].addLocal(-_extents.getX(), _extents.getY(), -_extents.getZ());
        _corners[2].addLocal(_extents.getX(), -_extents.getY(), -_extents.getZ());
View Full Code Here

        // Chose the color for the lights.
        final ColorRGBA lightColor = ColorRGBA.randomColor(new ColorRGBA());

        // Create a sphere to show where the light is in the demo.
        final Sphere lightSphere = new Sphere("lightSphere" + i, 9, 9, .1f);
        lightSphere.setModelBound(new BoundingSphere());
        lightSphere.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        lightSphere.setDefaultColor(lightColor);

        // Create a new point light and fill out the properties
        final PointLight pointLight = new PointLight();
View Full Code Here

                sphere = (Sphere) sphereroot.makeInstanced();
            } else {
                sphere = (Sphere) sphereroot.makeCopy(true);
            }
            sphere.setRandomColors();
            sphere.setModelBound(new BoundingSphere());
            sphere.setTranslation(new Vector3(rand.nextDouble() * 100.0 - 50.0, rand.nextDouble() * 100.0 - 50.0, rand
                    .nextDouble() * 100.0 - 250.0));
            sphere.getSceneHints().setCullHint(CullHint.Dynamic);
            modelBase.attachChild(sphere);
        }
View Full Code Here

        final Sphere sphere = new Sphere("sphere", Vector3.ZERO, 16, 16, 8);
        ts = new TextureState();
        ts.setTexture(TextureManager.load("images/water/dudvmap.png", Texture.MinificationFilter.Trilinear, true));
        sphere.setRenderState(ts);
        sphere.getSceneHints().setPickingHint(PickingHint.Pickable, true);
        sphere.setModelBound(new BoundingSphere());

        final Node joint = new Node();
        joint.setTranslation(0, sphere.getRadius() + 2 * box1.getYExtent(), 0);
        joint.attachChild(sphere);
        base.attachChild(joint);
View Full Code Here

        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());
        }

        _corners[0].addLocal(_extents.getX(), _extents.getY(), _extents.getZ());
        _corners[1].addLocal(_extents.getX(), -_extents.getY(), _extents.getZ());
        _corners[2].addLocal(_extents.getX(), _extents.getY(), -_extents.getZ());
View Full Code Here

                        || 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()));
            }

            case OBB: {
                final OrientedBoundingBox obb = (OrientedBoundingBox) volume;
                return Vector3.isValid(obb.getExtent());
View Full Code Here

TOP

Related Classes of com.ardor3d.bounding.BoundingSphere

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.