JSPM

  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q34257F
  • License Zlib

An octree visualisation tool for three.js.

Package Exports

  • octree-helper

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (octree-helper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Octree Helper

Build status npm version Peer dependencies

An octree visualisation tool for three.js.

Installation

npm install octree-helper

Requirements

This helper can visualise any octree that conforms to the following protocols:

interface Octree {

    getDepth(): Number;
    findOctantsByLevel(level: Number): Iterable;

}
interface Octant {

    min: { x: Number, y: Number, z: Number };
    max: { x: Number, y: Number, z: Number };

}

Usage

The following example uses the sparse-octree module.

import { Scene } from "three";
import { Octree } from "sparse-octree";
import OctreeHelper from "octree-helper";

const scene = new Scene();
const octree = new Octree();
const octreeHelper = new OctreeHelper(octree);

// Render the helper.
scene.add(octreeHelper);

// Set a different octree.
octreeHelper.octree = otherOctree;

// Destroy the helper geometry and rebuild.
octreeHelper.update();

// Destroy the helper geometry.
octreeHelper.dispose();

A full example can be found here.

Contributing

Maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.