Skip to content

Commit e215849

Browse files
committed
Version 5.0.2.
1 parent 90c23c4 commit e215849

File tree

7 files changed

+58
-8
lines changed

7 files changed

+58
-8
lines changed

build/sparse-octree.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* sparse-octree v5.0.1 build Mon Jul 02 2018
2+
* sparse-octree v5.0.2 build Thu Aug 02 2018
33
* https://github.com/vanruesc/sparse-octree
44
* Copyright 2018 Raoul van Rüschen, Zlib
55
*/
@@ -1231,6 +1231,12 @@
12311231

12321232
return this.x * v.x + this.y * v.y;
12331233
}
1234+
}, {
1235+
key: "cross",
1236+
value: function cross(v) {
1237+
1238+
return this.x * v.y - this.y * v.x;
1239+
}
12341240
}, {
12351241
key: "manhattanLength",
12361242
value: function manhattanLength() {
@@ -2251,6 +2257,25 @@
22512257

22522258
return this.normalize();
22532259
}
2260+
}, {
2261+
key: "angleTo",
2262+
value: function angleTo(q) {
2263+
2264+
return 2.0 * Math.acos(Math.abs(Math.min(Math.max(this.dot(q), -1.0), 1.0)));
2265+
}
2266+
}, {
2267+
key: "rotateTowards",
2268+
value: function rotateTowards(q, step) {
2269+
2270+
var angle = this.angleTo(q);
2271+
2272+
if (angle !== 0.0) {
2273+
2274+
this.slerp(q, Math.min(1.0, step / angle));
2275+
}
2276+
2277+
return this;
2278+
}
22542279
}, {
22552280
key: "invert",
22562281
value: function invert() {

build/sparse-octree.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sparse-octree",
3-
"version": "5.0.1",
3+
"version": "5.0.2",
44
"description": "A sparse octree data structure.",
55
"homepage": "https://github.com/vanruesc/sparse-octree",
66
"main": "build/sparse-octree.js",

public/demo/index.js

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/demo/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
<div class="content" data-ice="content"><div data-ice="index" class="github-markdown"><h1 id="sparse-octree">Sparse Octree</h1><p><a href="https://travis-ci.org/vanruesc/sparse-octree"><img src="https://travis-ci.org/vanruesc/sparse-octree.svg?branch=master" alt="Build status"></a>
4848
<a href="http://badge.fury.io/js/sparse-octree"><img src="https://badge.fury.io/js/sparse-octree.svg" alt="npm version"></a>
49-
<a href="https://david-dm.org/vanruesc/sparse-octree"><img src="https://david-dm.org/vanruesc/sparse-octree.svg?branch=master" alt="Dependencies"></a></p>
49+
<a href="https://david-dm.org/vanruesc/sparse-octree?type=peer"><img src="https://david-dm.org/vanruesc/sparse-octree/peer-status.svg" alt="Peer dependencies"></a></p>
5050
<p>A sparse octree data structure.</p>
5151
<p><em><a href="https://vanruesc.github.io/sparse-octree/public/demo">Extensive Demo</a> &#x2234;
5252
<a href="https://vanruesc.github.io/sparse-octree/public/docs">API Reference</a></em></p>

public/docs/index.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4184,15 +4184,15 @@
41844184
},
41854185
{
41864186
"kind": "index",
4187-
"content": "# Sparse Octree\r\n\r\n[![Build status](https://travis-ci.org/vanruesc/sparse-octree.svg?branch=master)](https://travis-ci.org/vanruesc/sparse-octree) \r\n[![npm version](https://badge.fury.io/js/sparse-octree.svg)](http://badge.fury.io/js/sparse-octree) \r\n[![Dependencies](https://david-dm.org/vanruesc/sparse-octree.svg?branch=master)](https://david-dm.org/vanruesc/sparse-octree)\r\n\r\nA sparse octree data structure.\r\n\r\n*[Extensive Demo](https://vanruesc.github.io/sparse-octree/public/demo) &there4;\r\n[API Reference](https://vanruesc.github.io/sparse-octree/public/docs)*\r\n\r\n\r\n## Installation\r\n\r\nThis library requires the peer dependencies [iterator-result](https://github.com/vanruesc/iterator-result) and [math-ds](https://github.com/vanruesc/math-ds).\r\n\r\n```sh\r\nnpm install iterator-result math-ds sparse-octree\r\n``` \r\n\r\n\r\n## Usage\r\n\r\n##### Custom Octrees\r\n\r\n```javascript\r\nimport { Octree, CubicOctant } from \"sparse-octree\";\r\n\r\nexport class CubicOctree extends Octree {\r\n\r\n\tconstructor(min, size) {\r\n\r\n\t\tthis.root = new CubicOctant(min, size);\r\n\r\n\t}\r\n\r\n}\r\n```\r\n\r\n##### Points\r\n\r\n```javascript\r\nimport { Vector3 } from \"math-ds\";\r\nimport { PointOctree } from \"sparse-octree\";\r\n\r\nconst min = new Vector3(-1, -1, -1);\r\nconst max = new Vector3(1, 1, 1);\r\n\r\nconst octree = new PointOctree(min, max);\r\nconst myData = {};\r\n\r\noctree.put(new Vector3(0, 0, 0), myData);\r\noctree.fetch(new Vector3(0, 0, 0)); // => myData\r\n```\r\n\r\nA full point octree example can be found [here](https://jsfiddle.net/6gt9fjmq/10/).\r\n\r\n\r\n## Features\r\n\r\n- Base Functionality\r\n\t- Pointer-based structure\r\n - Handles octant splitting\r\n - Adheres to a [common octant layout](http://vanruesc.github.io/sparse-octree/public/docs/variable/index.html#static-variable-pattern)\r\n - Supports raycasting\r\n - Supports culling\r\n - Supports cubic octrees\r\n - Can be extended to manage any data\r\n- Provides a point management implementation\r\n\r\n\r\n## Octree Helper\r\n\r\nThe [octree-helper](https://github.com/vanruesc/octree-helper) module provides\r\nan octree visualisation tool for [three.js](https://threejs.org/).\r\n\r\n\r\n## Contributing\r\n\r\nMaintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.\r\n",
4187+
"content": "# Sparse Octree\r\n\r\n[![Build status](https://travis-ci.org/vanruesc/sparse-octree.svg?branch=master)](https://travis-ci.org/vanruesc/sparse-octree) \r\n[![npm version](https://badge.fury.io/js/sparse-octree.svg)](http://badge.fury.io/js/sparse-octree) \r\n[![Peer dependencies](https://david-dm.org/vanruesc/sparse-octree/peer-status.svg)](https://david-dm.org/vanruesc/sparse-octree?type=peer)\r\n\r\nA sparse octree data structure.\r\n\r\n*[Extensive Demo](https://vanruesc.github.io/sparse-octree/public/demo) &there4;\r\n[API Reference](https://vanruesc.github.io/sparse-octree/public/docs)*\r\n\r\n\r\n## Installation\r\n\r\nThis library requires the peer dependencies [iterator-result](https://github.com/vanruesc/iterator-result) and [math-ds](https://github.com/vanruesc/math-ds).\r\n\r\n```sh\r\nnpm install iterator-result math-ds sparse-octree\r\n``` \r\n\r\n\r\n## Usage\r\n\r\n##### Custom Octrees\r\n\r\n```javascript\r\nimport { Octree, CubicOctant } from \"sparse-octree\";\r\n\r\nexport class CubicOctree extends Octree {\r\n\r\n\tconstructor(min, size) {\r\n\r\n\t\tthis.root = new CubicOctant(min, size);\r\n\r\n\t}\r\n\r\n}\r\n```\r\n\r\n##### Points\r\n\r\n```javascript\r\nimport { Vector3 } from \"math-ds\";\r\nimport { PointOctree } from \"sparse-octree\";\r\n\r\nconst min = new Vector3(-1, -1, -1);\r\nconst max = new Vector3(1, 1, 1);\r\n\r\nconst octree = new PointOctree(min, max);\r\nconst myData = {};\r\n\r\noctree.put(new Vector3(0, 0, 0), myData);\r\noctree.fetch(new Vector3(0, 0, 0)); // => myData\r\n```\r\n\r\nA full point octree example can be found [here](https://jsfiddle.net/6gt9fjmq/10/).\r\n\r\n\r\n## Features\r\n\r\n- Base Functionality\r\n\t- Pointer-based structure\r\n - Handles octant splitting\r\n - Adheres to a [common octant layout](http://vanruesc.github.io/sparse-octree/public/docs/variable/index.html#static-variable-pattern)\r\n - Supports raycasting\r\n - Supports culling\r\n - Supports cubic octrees\r\n - Can be extended to manage any data\r\n- Provides a point management implementation\r\n\r\n\r\n## Octree Helper\r\n\r\nThe [octree-helper](https://github.com/vanruesc/octree-helper) module provides\r\nan octree visualisation tool for [three.js](https://threejs.org/).\r\n\r\n\r\n## Contributing\r\n\r\nMaintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.\r\n",
41884188
"longname": "D:\\Sourcecode\\JavaScript\\sparse-octree\\README.md",
41894189
"name": "./README.md",
41904190
"static": true,
41914191
"access": "public"
41924192
},
41934193
{
41944194
"kind": "packageJSON",
4195-
"content": "{\r\n\t\"name\": \"sparse-octree\",\r\n\t\"version\": \"5.0.1\",\r\n\t\"description\": \"A sparse octree data structure.\",\r\n\t\"homepage\": \"https://github.com/vanruesc/sparse-octree\",\r\n\t\"main\": \"build/sparse-octree.js\",\r\n\t\"module\": \"src/index.js\",\r\n\t\"sideEffects\": false,\r\n\t\"license\": \"Zlib\",\r\n\r\n\t\"keywords\": [\r\n\t\t\"partition\",\r\n\t\t\"hierarchy\",\r\n\t\t\"subdivision\",\r\n\t\t\"raycasting\",\r\n\t\t\"3d\",\r\n\t\t\"spatial\",\r\n\t\t\"voxel\",\r\n\t\t\"points\",\r\n\t\t\"frustum\",\r\n\t\t\"culling\"\r\n\t],\r\n\r\n\t\"author\": {\r\n\t\t\"name\": \"Raoul van Rüschen\",\r\n\t\t\"email\": \"vanruesc@outlook.de\"\r\n\t},\r\n\r\n\t\"repository\": {\r\n\t\t\"type\": \"git\",\r\n\t\t\"url\": \"https://github.com/vanruesc/sparse-octree.git\"\r\n\t},\r\n\r\n\t\"bugs\": {\r\n\t\t\"url\": \"https://github.com/vanruesc/sparse-octree/issues\"\r\n\t},\r\n\r\n\t\"files\": [\r\n\t\t\"src\",\r\n\t\t\"build\"\r\n\t],\r\n\r\n\t\"scripts\": {\r\n\t\t\"lint\": \"npm run lint:lib && npm run lint:demo && npm run lint:test\",\r\n\t\t\"lint:config\": \"eslint *.js\",\r\n\t\t\"lint:lib\": \"eslint src\",\r\n\t\t\"lint:demo\": \"eslint demo/src\",\r\n\t\t\"lint:test\": \"eslint test\",\r\n\t\t\"build\": \"rollup -c\",\r\n\t\t\"build:production\": \"cross-env NODE_ENV=production rollup -c\",\r\n\t\t\"doc\": \"esdoc\",\r\n\t\t\"deploy\": \"cpx demo/assets/** public/demo\",\r\n\t\t\"test\": \"ava\",\r\n\t\t\"prepack\": \"npm run lint && npm run build:production\"\r\n\t},\r\n\r\n\t\"engines\": {\r\n\t\t\"node\": \">=4.0.0\",\r\n\t\t\"npm\": \">=4.0.0\"\r\n\t},\r\n\r\n\t\"eslintConfig\": {\r\n\t\t\"extends\": \"delta\"\r\n\t},\r\n\r\n\t\"peerDependencies\": {\r\n\t\t\"iterator-result\": \"0.x.x\",\r\n\t\t\"math-ds\": \"1.x.x\"\r\n\t},\r\n\r\n\t\"devDependencies\": {\r\n\t\t\"ava\": \"0.x.x\",\r\n\t\t\"babel-core\": \"6.x.x\",\r\n\t\t\"babel-plugin-external-helpers\": \"6.x.x\",\r\n\t\t\"babel-preset-env\": \"1.x.x\",\r\n\t\t\"cpx\": \"1.x.x\",\r\n\t\t\"cross-env\": \"5.x.x\",\r\n\t\t\"delta-controls\": \"2.x.x\",\r\n\t\t\"esdoc\": \"1.x.x\",\r\n\t\t\"esdoc-standard-plugin\": \"1.x.x\",\r\n\t\t\"eslint\": \"5.x.x\",\r\n\t\t\"eslint-config-delta\": \"0.x.x\",\r\n\t\t\"iterator-result\": \"0.x.x\",\r\n\t\t\"math-ds\": \"1.x.x\",\r\n\t\t\"octree-helper\": \"0.x.x\",\r\n\t\t\"rollup\": \"0.x.x\",\r\n\t\t\"rollup-plugin-babel\": \"3.x.x\",\r\n\t\t\"rollup-plugin-babel-minify\": \"5.x.x\",\r\n\t\t\"rollup-plugin-node-resolve\": \"3.x.x\",\r\n\t\t\"rollup-plugin-string\": \"2.x.x\",\r\n\t\t\"synthetic-event\": \"0.x.x\",\r\n\t\t\"three\": \"0.94.x\",\r\n\t\t\"three-demo\": \"2.x.x\"\r\n\t}\r\n}\r\n",
4195+
"content": "{\r\n\t\"name\": \"sparse-octree\",\r\n\t\"version\": \"5.0.2\",\r\n\t\"description\": \"A sparse octree data structure.\",\r\n\t\"homepage\": \"https://github.com/vanruesc/sparse-octree\",\r\n\t\"main\": \"build/sparse-octree.js\",\r\n\t\"module\": \"src/index.js\",\r\n\t\"sideEffects\": false,\r\n\t\"license\": \"Zlib\",\r\n\r\n\t\"keywords\": [\r\n\t\t\"partition\",\r\n\t\t\"hierarchy\",\r\n\t\t\"subdivision\",\r\n\t\t\"raycasting\",\r\n\t\t\"3d\",\r\n\t\t\"spatial\",\r\n\t\t\"voxel\",\r\n\t\t\"points\",\r\n\t\t\"frustum\",\r\n\t\t\"culling\"\r\n\t],\r\n\r\n\t\"author\": {\r\n\t\t\"name\": \"Raoul van Rüschen\",\r\n\t\t\"email\": \"vanruesc@outlook.de\"\r\n\t},\r\n\r\n\t\"repository\": {\r\n\t\t\"type\": \"git\",\r\n\t\t\"url\": \"https://github.com/vanruesc/sparse-octree.git\"\r\n\t},\r\n\r\n\t\"bugs\": {\r\n\t\t\"url\": \"https://github.com/vanruesc/sparse-octree/issues\"\r\n\t},\r\n\r\n\t\"files\": [\r\n\t\t\"src\",\r\n\t\t\"build\"\r\n\t],\r\n\r\n\t\"scripts\": {\r\n\t\t\"ava\": \"ava\",\r\n\t\t\"lint\": \"npm run lint:lib && npm run lint:demo && npm run lint:test\",\r\n\t\t\"lint:config\": \"eslint *.js\",\r\n\t\t\"lint:lib\": \"eslint src\",\r\n\t\t\"lint:demo\": \"eslint demo/src\",\r\n\t\t\"lint:test\": \"eslint test\",\r\n\t\t\"build\": \"rollup -c\",\r\n\t\t\"build:production\": \"cross-env NODE_ENV=production rollup -c\",\r\n\t\t\"doc\": \"esdoc\",\r\n\t\t\"deploy\": \"cpx demo/assets/** public/demo\",\r\n\t\t\"pretest\": \"npm run lint && npm run build:production\",\r\n\t\t\"test\": \"npm run ava\",\r\n\t\t\"prepack\": \"npm test\"\r\n\t},\r\n\r\n\t\"ava\": {\r\n\t\t\"failFast\": true,\r\n\t\t\"files\": [\"test/**/*.js\"]\r\n\t},\r\n\r\n\t\"eslintConfig\": {\r\n\t\t\"extends\": \"delta\"\r\n\t},\r\n\r\n\t\"peerDependencies\": {\r\n\t\t\"iterator-result\": \"0.x.x\",\r\n\t\t\"math-ds\": \"1.x.x\"\r\n\t},\r\n\r\n\t\"devDependencies\": {\r\n\t\t\"ava\": \"0.x.x\",\r\n\t\t\"babel-core\": \"6.x.x\",\r\n\t\t\"babel-plugin-external-helpers\": \"6.x.x\",\r\n\t\t\"babel-preset-env\": \"1.x.x\",\r\n\t\t\"cpx\": \"1.x.x\",\r\n\t\t\"cross-env\": \"5.x.x\",\r\n\t\t\"dat.gui\": \"0.x.x\",\r\n\t\t\"delta-controls\": \"2.x.x\",\r\n\t\t\"esdoc\": \"1.x.x\",\r\n\t\t\"esdoc-standard-plugin\": \"1.x.x\",\r\n\t\t\"eslint\": \"5.x.x\",\r\n\t\t\"eslint-config-delta\": \"0.x.x\",\r\n\t\t\"iterator-result\": \"0.x.x\",\r\n\t\t\"math-ds\": \"1.x.x\",\r\n\t\t\"octree-helper\": \"0.x.x\",\r\n\t\t\"rollup\": \"0.x.x\",\r\n\t\t\"rollup-plugin-babel\": \"3.x.x\",\r\n\t\t\"rollup-plugin-babel-minify\": \"5.x.x\",\r\n\t\t\"rollup-plugin-node-resolve\": \"3.x.x\",\r\n\t\t\"rollup-plugin-string\": \"2.x.x\",\r\n\t\t\"synthetic-event\": \"0.x.x\",\r\n\t\t\"three\": \"0.95.x\",\r\n\t\t\"three-demo\": \"3.x.x\"\r\n\t}\r\n}\r\n",
41964196
"longname": "D:\\Sourcecode\\JavaScript\\sparse-octree\\package.json",
41974197
"name": "package.json",
41984198
"static": true,

0 commit comments

Comments
 (0)