Package toxi.geom

Examples of toxi.geom.PointOctree


        octreeGuides.empty();
        reset();
    }

    protected PointOctree createOctree(Vec3D origin, float size) {
        return new PointOctree(origin, size);
    }
View Full Code Here


import toxi.geom.Vec3D;

public class TreeTest extends TestCase {

    public void testOctree() {
        PointOctree t = new PointOctree(new Vec3D(), 100);
        t.setMinNodeSize(0.5f);
        assertEquals(t.addPoint(new Vec3D(0, 0, 0)), true);
        assertEquals(t.addPoint(new Vec3D(1, 0, 0)), true);
        PointOctree leaf1 = t.getLeafForPoint(new Vec3D(0, 0, 0));
        PointOctree leaf2 = t.getLeafForPoint(new Vec3D(1, 0, 0));
        assertNotSame(leaf1, leaf2);
        assertEquals(t.addPoint(new Vec3D(0, 100, 0)), true);
        assertEquals(t.addPoint(new Vec3D(101, 0, 0)), false);
        List<Vec3D> points = t.getPointsWithinSphere(new Sphere(new Vec3D(50,
                0, 0), 50));
View Full Code Here

TOP

Related Classes of toxi.geom.PointOctree

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.