Package com.ardor3d.bounding

Examples of com.ardor3d.bounding.BoundingBox


    /**
     * Setup terrain.
     */
    private void setupTerrain() {
        final Box box = new Box("box", new Vector3(), 10000, 10, 10000);
        box.setModelBound(new BoundingBox());

        box.addController(new SpatialController<Box>() {
            double timer = 0;

            public void update(final double time, final Box caller) {
View Full Code Here


        _root.attachChild(occluders);
        for (int i = 0; i < 30; i++) {
            final double w = Math.random() * 40 + 10;
            final double y = Math.random() * 20 + 10;
            final Box b = new Box("box", new Vector3(), w, y, w);
            b.setModelBound(new BoundingBox());
            final double x = Math.random() * 1000 - 500;
            final double z = Math.random() * 1000 - 500;
            b.setTranslation(new Vector3(x, y, z));

            occluders.attachChild(b);
        }

        final Torus torusWithoutShadows = new Torus("torus", 32, 10, 15.0f, 20.0f);
        torusWithoutShadows.setModelBound(new BoundingBox());
        torusWithoutShadows.getSceneHints().setCastsShadows(false);
        torusWithoutShadows.setTranslation(0, 50, -100);
        occluders.attachChild(torusWithoutShadows);

        final Torus torus = new Torus("torus", 64, 12, 10.0f, 15.0f);
        torus.setModelBound(new BoundingBox());
        occluders.attachChild(torus);
        torus.addController(new SpatialController<Torus>() {
            double timer = 0;
            Matrix3 rotation = new Matrix3();

View Full Code Here

        final Node billboard = new Node("bb");
        billboard.getSceneHints().setRenderBucketType(RenderBucketType.Transparent);

        final Quad q1 = new Quad("font block", 150, 200);
        q1.setTranslation(0, 80, 0);
        q1.setModelBound(new BoundingBox());
        final CullState cs = new CullState();
        cs.setCullFace(CullState.Face.None);
        q1.setRenderState(cs);
        billboard.attachChild(q1);
View Full Code Here

        final Random rand = new Random(1337);
        for (int i = 0; i < 100; i++) {
            final Sphere sphere = new Sphere("Sphere", 32, 32, 2);
            sphere.setRandomColors();
            sphere.setModelBound(new BoundingBox());
            sphere.setRenderState(ts);
            sphere.setTranslation(new Vector3(rand.nextDouble() * 100.0 - 50.0, rand.nextDouble() * 100.0 - 50.0, rand
                    .nextDouble() * 100.0 - 250.0));

            sphereBase.attachChild(sphere);
View Full Code Here

        final ZBufferState zstate = new ZBufferState();
        zstate.setWritable(false);
        particles.setRenderState(zstate);

        particles.getParticleGeometry().setModelBound(new BoundingBox());

        _root.attachChild(particles);
        // kick things off by setting our start and end
        newPos.setX(MathUtils.nextRandomDouble() * 50 - 25);
        newPos.setY(MathUtils.nextRandomDouble() * 50 - 25);
View Full Code Here

        trailMesh.setRenderState(cs);

        _root.attachChild(trailMesh);

        final Box box = new Box("Box", new Vector3(0, 0, 0), 1000, 1, 1000);
        box.setModelBound(new BoundingBox());
        box.setTranslation(new Vector3(0, -50, 0));
        box.setRandomColors();
        _root.attachChild(box);
        ts = new TextureState();
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear, true));
View Full Code Here

        pp.setConstant(.1f);
        pp.setLinear(0.0000008f);
        pp.setQuadratic(0.0000008f);

        final Box sb = new Box("SkyBox", Vector3.ZERO, 50, 50, 50);
        sb.setModelBound(new BoundingBox());
        _root.attachChild(sb);

        final BasicText t1 = BasicText.createDefaultTextLabel("Text1", "[K] Show Skeleton.");
        t1.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
        t1.getSceneHints().setLightCombineMode(LightCombineMode.Off);
View Full Code Here

        _camera.setAperture(45.0 * MathUtils.DEG_TO_RAD);
        _camera.setSideBySideMode(_sideBySide);
        _camera.setupLeftRightCameras();

        final Mesh tp = new Teapot("Teapot");
        tp.setModelBound(new BoundingBox());
        tp.setTranslation(new Vector3(0, 0, -50));
        tp.setScale(2);
        _root.attachChild(tp);

        final Mesh torus = new Torus("Torus", 16, 16, 1, 4);
        torus.setModelBound(new BoundingBox());
        torus.setTranslation(new Vector3(4, 0, -10));
        _root.attachChild(torus);

        final Mesh sphere = new Sphere("Sphere", 16, 16, 5);
        sphere.setModelBound(new BoundingBox());
        sphere.setTranslation(new Vector3(-8, 0, -30));
        _root.attachChild(sphere);

        final Box box = new Box("Box", new Vector3(), 50, 1, 50);
        box.setModelBound(new BoundingBox());
        box.setTranslation(new Vector3(0, -1, -25));
        _root.attachChild(box);

        final TextureState ts = new TextureState();
        ts.setEnabled(true);
View Full Code Here

    private Mesh createSphere(final Node parentNode, final String textureName1, final String textureName2,
            final WrapMode mode) {
        // Create sphere
        final Sphere sphere = new Sphere("Sphere", 10, 10, 1);
        sphere.setModelBound(new BoundingBox());
        sphere.setTranslation(new Vector3(MathUtils.rand.nextInt(40) - 20, MathUtils.rand.nextInt(40) - 20,
                MathUtils.rand.nextInt(40) - 100));
        parentNode.attachChild(sphere);

        setupStates(sphere, textureName1, textureName2, mode);
View Full Code Here

    private Mesh createBox(final Node parentNode, final String textureName1, final String textureName2,
            final WrapMode mode) {
        // Create box
        final Box box = new Box("Box", new Vector3(0, 0, 0), 1, 1, 1);
        box.setModelBound(new BoundingBox());
        box.setTranslation(new Vector3(MathUtils.rand.nextInt(40) - 20, MathUtils.rand.nextInt(40) - 20, MathUtils.rand
                .nextInt(40) - 100));
        parentNode.attachChild(box);

        setupStates(box, textureName1, textureName2, mode);
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.