@xort/cga 0.0.86 → 0.0.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cga.d.ts +2032 -0
- package/dist/IKanimation/CCDSolver.js +2 -2
- package/dist/IKanimation/constaint/hinge.js +3 -1
- package/dist/IKanimation/constaint/slider.js +3 -1
- package/dist/alg/common.js +2 -2
- package/dist/alg/delaunay.js +1 -1
- package/dist/alg/extrude.js +52 -50
- package/dist/alg/pointset.js +5 -5
- package/dist/alg/trianglution.js +12 -10
- package/dist/alg/voronoi.js +1 -1
- package/dist/app.js +14 -10
- package/dist/diamondMaterialShader.js +6 -2
- package/dist/effect/breath-light.js +3 -1
- package/dist/extends/geometryaid.js +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -2
- package/dist/math/Color.d.ts +4 -0
- package/dist/math/Color.js +30 -6
- package/dist/math/Euler.js +9 -9
- package/dist/math/Mat3.js +1 -1
- package/dist/math/Mat4.js +6 -6
- package/dist/math/Quat.js +1 -1
- package/dist/math/Vec3.js +4 -4
- package/dist/math/vecs.js +9 -7
- package/dist/render/bufferAttribute.js +12 -28
- package/dist/render/geometry.js +2 -2
- package/dist/render/mesh.js +11 -9
- package/dist/render/types.d.ts +2 -2
- package/dist/render/types.js +2 -1
- package/dist/struct/3d/Box.js +3 -3
- package/dist/struct/3d/Capsule.js +3 -1
- package/dist/struct/3d/Circle.js +2 -2
- package/dist/struct/3d/Disk.js +1 -1
- package/dist/struct/3d/Line.js +4 -4
- package/dist/struct/3d/Path.js +13 -11
- package/dist/struct/3d/Plane.d.ts +3 -3
- package/dist/struct/3d/Plane.js +23 -18
- package/dist/struct/3d/Point.js +3 -1
- package/dist/struct/3d/Polygon.js +3 -1
- package/dist/struct/3d/Polyline.d.ts +9 -0
- package/dist/struct/3d/Polyline.js +25 -2
- package/dist/struct/3d/Rectangle.js +3 -1
- package/dist/struct/3d/Segment.js +9 -7
- package/dist/struct/3d/Shape.js +3 -1
- package/dist/struct/3d/Sphere.js +1 -1
- package/dist/struct/3d/Triangle.js +3 -1
- package/dist/struct/bsp.d.ts +0 -0
- package/dist/struct/bsp.js +1 -0
- package/dist/struct/btree.d.ts +0 -0
- package/dist/struct/btree.js +1 -0
- package/dist/struct/data/ArrayList.js +11 -9
- package/dist/struct/data/ArrayObject.js +3 -1
- package/dist/struct/kdtree.d.ts +0 -0
- package/dist/struct/kdtree.js +1 -0
- package/dist/struct/polyTree.d.ts +4 -0
- package/dist/struct/polyTree.js +27 -0
- package/dist/struct/quatTree.d.ts +0 -0
- package/dist/struct/quatTree.js +1 -0
- package/dist/struct/tree.d.ts +11 -0
- package/dist/struct/tree.js +26 -0
- package/dist/utils/types.d.ts +2 -2
- package/package.json +4 -3
- package/rollup.config.js +22 -14
- package/src/index.ts +1 -0
- package/src/math/Color.ts +6 -0
- package/src/struct/3d/Plane.ts +15 -11
- package/src/struct/3d/PolyLine.ts +18 -1
- package/src/struct/3d/Polygon.ts +2 -0
- package/src/struct/bsp.ts +0 -0
- package/src/struct/btree.ts +0 -0
- package/src/struct/kdtree.ts +0 -0
- package/src/struct/polyTree.ts +8 -0
- package/src/struct/quatTree.ts +0 -0
- package/src/struct/tree.ts +30 -0
- package/tsconfig.json +2 -0
- package/dist/shape/arc.d.ts +0 -2
- package/dist/shape/arc.js +0 -14
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export class Tree {
|
|
2
|
+
N: number = 2;//数量决定是N叉树;
|
|
3
|
+
children!: this[];
|
|
4
|
+
findFn!: Function;
|
|
5
|
+
objects: any[] = [];
|
|
6
|
+
|
|
7
|
+
constructor(N: number = -1) {
|
|
8
|
+
this.N = N;
|
|
9
|
+
if (N !== -1)
|
|
10
|
+
this.children = new Array(N)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
setObject(obj: any, generateFn: Function, findFn: Function) {
|
|
14
|
+
generateFn(this, obj);
|
|
15
|
+
this.findFn = findFn;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
add(obj: any) {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
remove(obj: any) {
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
find(condition: any) {
|
|
27
|
+
|
|
28
|
+
this.findFn(this, condition);
|
|
29
|
+
}
|
|
30
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
// "checkJs": true, /* Report errors in .js files. */
|
|
16
16
|
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
|
17
17
|
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
18
|
+
// "declarationDir": "dist/types",
|
|
19
|
+
// "emitDeclarationOnly": true,
|
|
18
20
|
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
19
21
|
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
|
20
22
|
// "outFile": "./", /* Concatenate and emit output to single file. */
|
package/dist/shape/arc.d.ts
DELETED
package/dist/shape/arc.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* @Description :
|
|
4
|
-
* @Author : 赵耀圣
|
|
5
|
-
* @QQ : 549184003
|
|
6
|
-
* @Date : 2021-03-15 09:40:01
|
|
7
|
-
* @LastEditTime : 2021-03-15 09:42:14
|
|
8
|
-
* @FilePath : \cga.js\src\shape\arc.ts
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.Circle = void 0;
|
|
12
|
-
function Circle(center, radius, segment, startAngle, lenAngle) {
|
|
13
|
-
}
|
|
14
|
-
exports.Circle = Circle;
|