@xort/cga 0.0.75 → 0.0.78
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/dist/IKanimation/Bone.js +3 -1
- 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/extrude.js +56 -54
- package/dist/alg/pointset.js +5 -5
- package/dist/alg/trianglution.js +12 -10
- package/dist/app.js +18 -11
- package/dist/diamondMaterialShader.js +6 -2
- package/dist/effect/breath-light.js +3 -1
- package/dist/extends/geometryaid.js +7 -7
- package/dist/index.js +6 -2
- package/dist/math/Color.d.ts +6 -9
- package/dist/math/Color.js +18 -55
- package/dist/math/Euler.js +12 -10
- package/dist/math/HVec3.js +3 -1
- package/dist/math/Mat3.js +1 -1
- package/dist/math/Mat4.js +6 -6
- package/dist/math/Quat.js +4 -2
- package/dist/math/Vec.js +3 -1
- package/dist/math/Vec2.js +3 -1
- package/dist/math/Vec3.js +7 -5
- package/dist/math/Vec4.js +3 -1
- package/dist/math/vector.js +9 -7
- package/dist/render/buffer-attribute.js +12 -28
- package/dist/render/eventhandler.d.ts +1 -1
- package/dist/render/eventhandler.js +9 -7
- package/dist/render/geometry.js +2 -2
- package/dist/render/mesh.js +11 -9
- package/dist/render/thing.js +10 -8
- 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.js +12 -10
- package/dist/struct/3d/Point.js +3 -1
- package/dist/struct/3d/Polygon.js +3 -1
- package/dist/struct/3d/Polyline.js +3 -1
- 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/data/ArrayList.js +11 -9
- package/dist/struct/data/ArrayObject.js +3 -1
- package/package.json +4 -3
- package/src/app.ts +4 -1
- package/src/index.ts +1 -0
- package/src/math/Color.ts +14 -32
- package/dist/src/IKanimation/Bone.d.ts +0 -9
- package/dist/src/IKanimation/Bone.js +0 -40
- package/dist/src/IKanimation/CCDSolver.d.ts +0 -37
- package/dist/src/IKanimation/CCDSolver.js +0 -93
- package/dist/src/IKanimation/Joint.d.ts +0 -3
- package/dist/src/IKanimation/Joint.js +0 -17
- package/dist/src/IKanimation/constaint/constraint.d.ts +0 -10
- package/dist/src/IKanimation/constaint/constraint.js +0 -25
- package/dist/src/IKanimation/constaint/hinge.d.ts +0 -12
- package/dist/src/IKanimation/constaint/hinge.js +0 -46
- package/dist/src/IKanimation/constaint/slider.d.ts +0 -12
- package/dist/src/IKanimation/constaint/slider.js +0 -44
- package/dist/src/IKanimation/index.d.ts +0 -0
- package/dist/src/IKanimation/index.js +0 -9
- package/dist/src/IKanimation/isolver.d.ts +0 -4
- package/dist/src/IKanimation/isolver.js +0 -10
- package/dist/src/IKanimation/skeleton.d.ts +0 -13
- package/dist/src/IKanimation/skeleton.js +0 -31
- package/dist/src/alg/common.d.ts +0 -114
- package/dist/src/alg/common.js +0 -302
- package/dist/src/alg/curve.d.ts +0 -4
- package/dist/src/alg/curve.js +0 -11
- package/dist/src/alg/delaunator.d.ts +0 -29
- package/dist/src/alg/delaunator.js +0 -442
- package/dist/src/alg/delaunay.d.ts +0 -20
- package/dist/src/alg/delaunay.js +0 -199
- package/dist/src/alg/delaunayslow.d.ts +0 -18
- package/dist/src/alg/delaunayslow.js +0 -140
- package/dist/src/alg/extrude/extrude.d.ts +0 -3
- package/dist/src/alg/extrude/extrude.js +0 -17
- package/dist/src/alg/extrude.d.ts +0 -199
- package/dist/src/alg/extrude.js +0 -731
- package/dist/src/alg/offset/index.d.ts +0 -0
- package/dist/src/alg/offset/index.js +0 -9
- package/dist/src/alg/offset.d.ts +0 -0
- package/dist/src/alg/offset.js +0 -472
- package/dist/src/alg/pointset.d.ts +0 -94
- package/dist/src/alg/pointset.js +0 -223
- package/dist/src/alg/recognition.d.ts +0 -14
- package/dist/src/alg/recognition.js +0 -37
- package/dist/src/alg/result.d.ts +0 -22
- package/dist/src/alg/result.js +0 -2
- package/dist/src/alg/segmentset.d.ts +0 -11
- package/dist/src/alg/segmentset.js +0 -45
- package/dist/src/alg/sort.d.ts +0 -2
- package/dist/src/alg/sort.js +0 -14
- package/dist/src/alg/split.d.ts +0 -8
- package/dist/src/alg/split.js +0 -10
- package/dist/src/alg/trianglution.d.ts +0 -20
- package/dist/src/alg/trianglution.js +0 -77
- package/dist/src/alg/vol.d.ts +0 -6
- package/dist/src/alg/vol.js +0 -18
- package/dist/src/alg/voronoi.d.ts +0 -31
- package/dist/src/alg/voronoi.js +0 -418
- package/dist/src/app.d.ts +0 -1
- package/dist/src/app.js +0 -245
- package/dist/src/basic/distance.d.ts +0 -12
- package/dist/src/basic/distance.js +0 -42
- package/dist/src/csg/bsp.d.ts +0 -9
- package/dist/src/csg/bsp.js +0 -22
- package/dist/src/csg/node.d.ts +0 -12
- package/dist/src/csg/node.js +0 -75
- package/dist/src/csg/polygon.d.ts +0 -43
- package/dist/src/csg/polygon.js +0 -161
- package/dist/src/diamondMaterialShader.d.ts +0 -92
- package/dist/src/diamondMaterialShader.js +0 -118
- package/dist/src/effect/breath-light.d.ts +0 -4
- package/dist/src/effect/breath-light.js +0 -39
- package/dist/src/extends/geometryaid.d.ts +0 -28
- package/dist/src/extends/geometryaid.js +0 -80
- package/dist/src/extends/split.d.ts +0 -3
- package/dist/src/extends/split.js +0 -13
- package/dist/src/glview.d.ts +0 -112
- package/dist/src/glview.js +0 -564
- package/dist/src/index.d.ts +0 -36
- package/dist/src/index.js +0 -54
- package/dist/src/math/Euler.d.ts +0 -47
- package/dist/src/math/Euler.js +0 -245
- package/dist/src/math/HVec3.d.ts +0 -44
- package/dist/src/math/HVec3.js +0 -195
- package/dist/src/math/Mat3.d.ts +0 -29
- package/dist/src/math/Mat3.js +0 -244
- package/dist/src/math/Mat4.d.ts +0 -85
- package/dist/src/math/Mat4.js +0 -791
- package/dist/src/math/Math.d.ts +0 -130
- package/dist/src/math/Math.js +0 -198
- package/dist/src/math/Quat.d.ts +0 -83
- package/dist/src/math/Quat.js +0 -440
- package/dist/src/math/Vec.d.ts +0 -7
- package/dist/src/math/Vec.js +0 -43
- package/dist/src/math/Vec2.d.ts +0 -68
- package/dist/src/math/Vec2.js +0 -347
- package/dist/src/math/Vec3.d.ts +0 -232
- package/dist/src/math/Vec3.js +0 -1089
- package/dist/src/math/Vec4.d.ts +0 -81
- package/dist/src/math/Vec4.js +0 -494
- package/dist/src/math/vector.d.ts +0 -114
- package/dist/src/math/vector.js +0 -373
- package/dist/src/render/buffer-attribute.d.ts +0 -100
- package/dist/src/render/buffer-attribute.js +0 -340
- package/dist/src/render/eventhandler.d.ts +0 -78
- package/dist/src/render/eventhandler.js +0 -189
- package/dist/src/render/geometry.d.ts +0 -89
- package/dist/src/render/geometry.js +0 -775
- package/dist/src/render/mesh.d.ts +0 -25
- package/dist/src/render/mesh.js +0 -82
- package/dist/src/render/thing.d.ts +0 -34
- package/dist/src/render/thing.js +0 -196
- package/dist/src/render/types.d.ts +0 -2
- package/dist/src/render/types.js +0 -8
- package/dist/src/robust/plane.d.ts +0 -7
- package/dist/src/robust/plane.js +0 -17
- package/dist/src/robust/vec.d.ts +0 -15
- package/dist/src/robust/vec.js +0 -71
- package/dist/src/shape/arc.d.ts +0 -2
- package/dist/src/shape/arc.js +0 -14
- package/dist/src/struct/3d/Box.d.ts +0 -23
- package/dist/src/struct/3d/Box.js +0 -109
- package/dist/src/struct/3d/Capsule.d.ts +0 -12
- package/dist/src/struct/3d/Capsule.js +0 -36
- package/dist/src/struct/3d/Circle.d.ts +0 -34
- package/dist/src/struct/3d/Circle.js +0 -80
- package/dist/src/struct/3d/Disk.d.ts +0 -10
- package/dist/src/struct/3d/Disk.js +0 -22
- package/dist/src/struct/3d/Frustum.d.ts +0 -35
- package/dist/src/struct/3d/Frustum.js +0 -159
- package/dist/src/struct/3d/Line.d.ts +0 -40
- package/dist/src/struct/3d/Line.js +0 -339
- package/dist/src/struct/3d/Path.d.ts +0 -75
- package/dist/src/struct/3d/Path.js +0 -308
- package/dist/src/struct/3d/Plane.d.ts +0 -74
- package/dist/src/struct/3d/Plane.js +0 -295
- package/dist/src/struct/3d/Point.d.ts +0 -4
- package/dist/src/struct/3d/Point.js +0 -30
- package/dist/src/struct/3d/Polygon.d.ts +0 -8
- package/dist/src/struct/3d/Polygon.js +0 -55
- package/dist/src/struct/3d/Polyline.d.ts +0 -25
- package/dist/src/struct/3d/Polyline.js +0 -109
- package/dist/src/struct/3d/Ray.d.ts +0 -21
- package/dist/src/struct/3d/Ray.js +0 -262
- package/dist/src/struct/3d/Rectangle.d.ts +0 -7
- package/dist/src/struct/3d/Rectangle.js +0 -35
- package/dist/src/struct/3d/Segment.d.ts +0 -32
- package/dist/src/struct/3d/Segment.js +0 -334
- package/dist/src/struct/3d/Shape.d.ts +0 -4
- package/dist/src/struct/3d/Shape.js +0 -27
- package/dist/src/struct/3d/Sphere.d.ts +0 -11
- package/dist/src/struct/3d/Sphere.js +0 -30
- package/dist/src/struct/3d/Triangle.d.ts +0 -8
- package/dist/src/struct/3d/Triangle.js +0 -53
- package/dist/src/struct/data/ArrayList.d.ts +0 -42
- package/dist/src/struct/data/ArrayList.js +0 -172
- package/dist/src/struct/data/ArrayObject.d.ts +0 -30
- package/dist/src/struct/data/ArrayObject.js +0 -131
- package/dist/src/struct/data/type.d.ts +0 -13
- package/dist/src/struct/data/type.js +0 -18
- package/dist/src/utils/array.d.ts +0 -24
- package/dist/src/utils/array.js +0 -89
- package/dist/src/utils/types.d.ts +0 -24
- package/dist/src/utils/types.js +0 -20
- package/dist/src-gis/app.d.ts +0 -1
- package/dist/src-gis/app.js +0 -4
- package/dist/src-gis/core/Cartographic.d.ts +0 -20
- package/dist/src-gis/core/Cartographic.js +0 -52
- package/dist/src-gis/core/EllipsoidGeodesic.d.ts +0 -14
- package/dist/src-gis/core/EllipsoidGeodesic.js +0 -51
- package/dist/src-gis/core/EllipsoidTerrainProvider.d.ts +0 -10
- package/dist/src-gis/core/EllipsoidTerrainProvider.js +0 -29
- package/dist/src-gis/core/HeightmapTerrainData.d.ts +0 -3
- package/dist/src-gis/core/HeightmapTerrainData.js +0 -9
- package/dist/src-gis/core/Rectangle.d.ts +0 -45
- package/dist/src-gis/core/Rectangle.js +0 -127
- package/dist/src-gis/core/TaskProcessor.d.ts +0 -35
- package/dist/src-gis/core/TaskProcessor.js +0 -183
- package/dist/src-gis/gis.d.ts +0 -5
- package/dist/src-gis/gis.js +0 -12
- package/dist/src-gis/globe.d.ts +0 -12
- package/dist/src-gis/globe.js +0 -61
- package/dist/src-gis/math/Cartographic.d.ts +0 -8
- package/dist/src-gis/math/Cartographic.js +0 -26
- package/dist/src-gis/math/GVec3.d.ts +0 -12
- package/dist/src-gis/math/GVec3.js +0 -69
- package/dist/src-gis/math/ellipsoid.d.ts +0 -8
- package/dist/src-gis/math/ellipsoid.js +0 -14
- package/dist/src-gis/provider/DcTerrainProvider.d.ts +0 -15
- package/dist/src-gis/provider/DcTerrainProvider.js +0 -19
- package/dist/src-gis/provider/TerrainProvider.d.ts +0 -3
- package/dist/src-gis/provider/TerrainProvider.js +0 -17
- package/dist/src-gis/scene/DcImageryProvider.d.ts +0 -6
- package/dist/src-gis/scene/DcImageryProvider.js +0 -35
- package/dist/src-gis/scene/GeographicTilingScheme.d.ts +0 -21
- package/dist/src-gis/scene/GeographicTilingScheme.js +0 -46
- package/dist/src-gis/scene/Globe.d.ts +0 -34
- package/dist/src-gis/scene/Globe.js +0 -62
- package/dist/src-gis/scene/GlobeSurfaceShaderSet.d.ts +0 -6
- package/dist/src-gis/scene/GlobeSurfaceShaderSet.js +0 -11
- package/dist/src-gis/scene/GlobeSurfaceTileProvider.d.ts +0 -21
- package/dist/src-gis/scene/GlobeSurfaceTileProvider.js +0 -15
- package/dist/src-gis/scene/ImageryLayerCollection.d.ts +0 -21
- package/dist/src-gis/scene/ImageryLayerCollection.js +0 -87
- package/dist/src-gis/scene/ImageryProvider.d.ts +0 -4
- package/dist/src-gis/scene/ImageryProvider.js +0 -28
- package/dist/src-gis/scene/QuadtreeTile.d.ts +0 -48
- package/dist/src-gis/scene/QuadtreeTile.js +0 -137
- package/dist/src-gis/scene/UrlTemplateImageryProvider.d.ts +0 -9
- package/dist/src-gis/scene/UrlTemplateImageryProvider.js +0 -29
- package/dist/src-gis/scene/quadtree_primitive.d.ts +0 -14
- package/dist/src-gis/scene/quadtree_primitive.js +0 -50
package/dist/render/types.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isBufferArray = void 0;
|
|
4
|
-
|
|
4
|
+
var isBufferArray = function (obj) {
|
|
5
5
|
var types = ['Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array'];
|
|
6
6
|
return types.indexOf(obj.constructor.name) > -1;
|
|
7
7
|
};
|
|
8
|
+
exports.isBufferArray = isBufferArray;
|
package/dist/struct/3d/Box.js
CHANGED
|
@@ -5,9 +5,9 @@ var Vec3_1 = require("../../math/Vec3");
|
|
|
5
5
|
var _vector = new Vec3_1.Vec3();
|
|
6
6
|
var Box = /** @class */ (function () {
|
|
7
7
|
function Box(min, max) {
|
|
8
|
-
if (min === void 0) { min = Vec3_1.v3(Infinity, Infinity, Infinity); }
|
|
9
|
-
if (max === void 0) { max = Vec3_1.v3(-Infinity, -Infinity, -Infinity); }
|
|
10
|
-
this._center = Vec3_1.v3();
|
|
8
|
+
if (min === void 0) { min = (0, Vec3_1.v3)(Infinity, Infinity, Infinity); }
|
|
9
|
+
if (max === void 0) { max = (0, Vec3_1.v3)(-Infinity, -Infinity, -Infinity); }
|
|
10
|
+
this._center = (0, Vec3_1.v3)();
|
|
11
11
|
this.min = min;
|
|
12
12
|
this.max = max;
|
|
13
13
|
// if (points) {
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
package/dist/struct/3d/Circle.js
CHANGED
|
@@ -35,7 +35,7 @@ var Circle = /** @class */ (function () {
|
|
|
35
35
|
Circle.prototype.arc1 = function (fixp0, fixp1, movep, normal) {
|
|
36
36
|
this.setFrom3Points(fixp0, fixp1, movep);
|
|
37
37
|
this.startAngle = 0;
|
|
38
|
-
this.endAngle = common_1.angle(fixp0.clone().sub(this.center).normalize(), fixp1.clone().sub(this.center).normalize(), this.normal || normal);
|
|
38
|
+
this.endAngle = (0, common_1.angle)(fixp0.clone().sub(this.center).normalize(), fixp1.clone().sub(this.center).normalize(), this.normal || normal);
|
|
39
39
|
};
|
|
40
40
|
/**
|
|
41
41
|
* 全两个点确定半径,后面点确定 弧度 ,只需要检测鼠标移动时鼠标是否跨过第一条半径即可确定顺逆时针
|
|
@@ -49,7 +49,7 @@ var Circle = /** @class */ (function () {
|
|
|
49
49
|
this.center.copy(center);
|
|
50
50
|
var v2 = movep.clone().sub(center);
|
|
51
51
|
var v1 = fixp1.clone().sub(center);
|
|
52
|
-
var jd = common_1.angle(v1, v2);
|
|
52
|
+
var jd = (0, common_1.angle)(v1, v2);
|
|
53
53
|
};
|
|
54
54
|
Circle.prototype.setFrom3Points = function (p0, p1, p2, normal) {
|
|
55
55
|
// if (pointsCollinear(p0, p1, p2))
|
package/dist/struct/3d/Disk.js
CHANGED
|
@@ -5,7 +5,7 @@ var Vec3_1 = require("../../math/Vec3");
|
|
|
5
5
|
var Disk = /** @class */ (function () {
|
|
6
6
|
function Disk(center, radius, normal) {
|
|
7
7
|
if (normal === void 0) { normal = Vec3_1.Vec3.UnitY; }
|
|
8
|
-
this.center = center || Vec3_1.v3();
|
|
8
|
+
this.center = center || (0, Vec3_1.v3)();
|
|
9
9
|
this.normal = normal;
|
|
10
10
|
this.radius = radius || 0;
|
|
11
11
|
this.w = this.normal.dot(center);
|
package/dist/struct/3d/Line.js
CHANGED
|
@@ -8,8 +8,8 @@ var _v1 = new Vec3_1.Vec3;
|
|
|
8
8
|
;
|
|
9
9
|
var Line = /** @class */ (function () {
|
|
10
10
|
function Line(origin, end) {
|
|
11
|
-
if (origin === void 0) { origin = Vec3_1.v3(); }
|
|
12
|
-
if (end === void 0) { end = Vec3_1.v3(); }
|
|
11
|
+
if (origin === void 0) { origin = (0, Vec3_1.v3)(); }
|
|
12
|
+
if (end === void 0) { end = (0, Vec3_1.v3)(); }
|
|
13
13
|
this.origin = origin;
|
|
14
14
|
this.end = end;
|
|
15
15
|
this.direction = this.end
|
|
@@ -192,10 +192,10 @@ var Line = /** @class */ (function () {
|
|
|
192
192
|
if (robust === void 0) { robust = false; }
|
|
193
193
|
if (numInputs === 1) {
|
|
194
194
|
if (Math.abs(v[0][0]) > Math.abs(v[0][1])) {
|
|
195
|
-
v[1] = Vec3_1.v3(-v[0].z, 0, +v[0].x);
|
|
195
|
+
v[1] = (0, Vec3_1.v3)(-v[0].z, 0, +v[0].x);
|
|
196
196
|
}
|
|
197
197
|
else {
|
|
198
|
-
v[1] = Vec3_1.v3(0, +v[0].z, -v[0].y);
|
|
198
|
+
v[1] = (0, Vec3_1.v3)(0, +v[0].z, -v[0].y);
|
|
199
199
|
}
|
|
200
200
|
;
|
|
201
201
|
numInputs = 2;
|
package/dist/struct/3d/Path.js
CHANGED
|
@@ -10,10 +10,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
10
10
|
var extendStatics = function (d, b) {
|
|
11
11
|
extendStatics = Object.setPrototypeOf ||
|
|
12
12
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
13
|
-
function (d, b) { for (var p in b) if (
|
|
13
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
14
14
|
return extendStatics(d, b);
|
|
15
15
|
};
|
|
16
16
|
return function (d, b) {
|
|
17
|
+
if (typeof b !== "function" && b !== null)
|
|
18
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
17
19
|
extendStatics(d, b);
|
|
18
20
|
function __() { this.constructor = d; }
|
|
19
21
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -73,15 +75,15 @@ var Path = /** @class */ (function (_super) {
|
|
|
73
75
|
var normal = new Vec3_1.Vec3();
|
|
74
76
|
normal.crossVecs(d1, d2).normalize();
|
|
75
77
|
this.get(i).normal = normal;
|
|
76
|
-
var bdir = Vec3_1.v3().addVecs(d1, d2).normalize();
|
|
78
|
+
var bdir = (0, Vec3_1.v3)().addVecs(d1, d2).normalize();
|
|
77
79
|
this.get(i).bdirection = bdir;
|
|
78
|
-
this.get(i).bnormal = Vec3_1.v3().crossVecs(bdir, normal).normalize();
|
|
80
|
+
this.get(i).bnormal = (0, Vec3_1.v3)().crossVecs(bdir, normal).normalize();
|
|
79
81
|
// }
|
|
80
82
|
}
|
|
81
83
|
if (!this._closed) { //不闭合路径 最后一个点没有
|
|
82
|
-
this.get(-1).bdirection = Vec3_1.v3();
|
|
83
|
-
this.get(-1).normal = Vec3_1.v3();
|
|
84
|
-
this.get(-1).bnormal = Vec3_1.v3();
|
|
84
|
+
this.get(-1).bdirection = (0, Vec3_1.v3)();
|
|
85
|
+
this.get(-1).normal = (0, Vec3_1.v3)();
|
|
86
|
+
this.get(-1).bnormal = (0, Vec3_1.v3)();
|
|
85
87
|
}
|
|
86
88
|
if (!this._closed) {
|
|
87
89
|
// 不闭合的情况下怎么样去计算端点的up和normal
|
|
@@ -116,10 +118,10 @@ var Path = /** @class */ (function (_super) {
|
|
|
116
118
|
configurable: true
|
|
117
119
|
});
|
|
118
120
|
Path.prototype.applyMat4 = function (mat4) {
|
|
119
|
-
pointset_1.applyMat4(this._array, mat4);
|
|
121
|
+
(0, pointset_1.applyMat4)(this._array, mat4);
|
|
120
122
|
};
|
|
121
123
|
Path.prototype.scale = function (x, y, z) {
|
|
122
|
-
common_1.scale(this._array, Vec3_1.v3(x, y, z), true);
|
|
124
|
+
(0, common_1.scale)(this._array, (0, Vec3_1.v3)(x, y, z), true);
|
|
123
125
|
};
|
|
124
126
|
/**
|
|
125
127
|
* 截取一段从from到to的path
|
|
@@ -157,7 +159,7 @@ var Path = /** @class */ (function (_super) {
|
|
|
157
159
|
Path.prototype.getPointByDistance = function (arg_distance, left, right) {
|
|
158
160
|
if (left === void 0) { left = 0; }
|
|
159
161
|
if (right === void 0) { right = this.length - 1; }
|
|
160
|
-
var distance = Math_1.clamp(arg_distance, 0, this.get(-1).tlen);
|
|
162
|
+
var distance = (0, Math_1.clamp)(arg_distance, 0, this.get(-1).tlen);
|
|
161
163
|
if (distance !== arg_distance)
|
|
162
164
|
return null;
|
|
163
165
|
if (right - left === 1) {
|
|
@@ -186,7 +188,7 @@ var Path = /** @class */ (function (_super) {
|
|
|
186
188
|
Path.prototype.getPointByDistancePure = function (arg_distance, left, right) {
|
|
187
189
|
if (left === void 0) { left = 0; }
|
|
188
190
|
if (right === void 0) { right = this.length - 1; }
|
|
189
|
-
var distance = Math_1.clamp(arg_distance, 0, this.get(-1).tlen);
|
|
191
|
+
var distance = (0, Math_1.clamp)(arg_distance, 0, this.get(-1).tlen);
|
|
190
192
|
if (distance !== arg_distance)
|
|
191
193
|
return null;
|
|
192
194
|
if (right - left === 1) {
|
|
@@ -294,7 +296,7 @@ var Path = /** @class */ (function (_super) {
|
|
|
294
296
|
res.push(mileages);
|
|
295
297
|
}
|
|
296
298
|
if (normalize) {
|
|
297
|
-
var tl = types_1.isDefined(totalMileage) ? totalMileage : this.totalMileages(ps);
|
|
299
|
+
var tl = (0, types_1.isDefined)(totalMileage) ? totalMileage : this.totalMileages(ps);
|
|
298
300
|
for (var i = 0, len = ps.length; i < len; i++) {
|
|
299
301
|
res[i] /= tl;
|
|
300
302
|
}
|
package/dist/struct/3d/Plane.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
8
10
|
};
|
|
9
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
12
|
exports.Plane = void 0;
|
|
@@ -68,9 +70,9 @@ var Plane = /** @class */ (function () {
|
|
|
68
70
|
*/
|
|
69
71
|
Plane.prototype.frontback = function (point) {
|
|
70
72
|
var value = this.normal.dot(point);
|
|
71
|
-
if (Math_1.approximateEqual(value, 0))
|
|
73
|
+
if ((0, Math_1.approximateEqual)(value, 0))
|
|
72
74
|
return 0;
|
|
73
|
-
return Math_1.sign(this.normal.dot(point));
|
|
75
|
+
return (0, Math_1.sign)(this.normal.dot(point));
|
|
74
76
|
};
|
|
75
77
|
//---Distance-------------------------------------------------------------------------------
|
|
76
78
|
Plane.prototype.distancePoint = function (point) {
|
|
@@ -223,8 +225,8 @@ var Plane = /** @class */ (function () {
|
|
|
223
225
|
* @param polyVS
|
|
224
226
|
*/
|
|
225
227
|
Plane.prototype.splitPolyVS = function (polyVS) {
|
|
226
|
-
polyVS =
|
|
227
|
-
mesh_1.indexable(polyVS);
|
|
228
|
+
polyVS = __spreadArray([], polyVS, true);
|
|
229
|
+
(0, mesh_1.indexable)(polyVS);
|
|
228
230
|
var jd0 = -1; //找出第一个交点
|
|
229
231
|
var jdp0; //找出第一个交点
|
|
230
232
|
var lastOriention = this.orientationPoint(polyVS[0]);
|
package/dist/struct/3d/Point.js
CHANGED
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -23,16 +25,16 @@ var Segment = /** @class */ (function (_super) {
|
|
|
23
25
|
* @param {Point|Vec3} p1
|
|
24
26
|
*/
|
|
25
27
|
function Segment(_p0, _p1) {
|
|
26
|
-
if (_p0 === void 0) { _p0 = Vec3_1.v3(); }
|
|
27
|
-
if (_p1 === void 0) { _p1 = Vec3_1.v3(); }
|
|
28
|
+
if (_p0 === void 0) { _p0 = (0, Vec3_1.v3)(); }
|
|
29
|
+
if (_p1 === void 0) { _p1 = (0, Vec3_1.v3)(); }
|
|
28
30
|
var _this = _super.call(this) || this;
|
|
29
31
|
Object.setPrototypeOf(_this, Segment.prototype);
|
|
30
|
-
_this.push(Vec3_1.v3().copy(_p0), Vec3_1.v3().copy(_p1));
|
|
31
|
-
_this.center = Vec3_1.v3().addVecs(_p0, _p1).multiplyScalar(0.5);
|
|
32
|
-
_this.extentDirection = Vec3_1.v3().subVecs(_p1, _p0);
|
|
32
|
+
_this.push((0, Vec3_1.v3)().copy(_p0), (0, Vec3_1.v3)().copy(_p1));
|
|
33
|
+
_this.center = (0, Vec3_1.v3)().addVecs(_p0, _p1).multiplyScalar(0.5);
|
|
34
|
+
_this.extentDirection = (0, Vec3_1.v3)().subVecs(_p1, _p0);
|
|
33
35
|
_this.extentSqr = _this.extentDirection.lengthSq();
|
|
34
36
|
_this.extent = Math.sqrt(_this.extentSqr);
|
|
35
|
-
_this.direction = Vec3_1.v3().copy(_this.extentDirection).normalize();
|
|
37
|
+
_this.direction = (0, Vec3_1.v3)().copy(_this.extentDirection).normalize();
|
|
36
38
|
return _this;
|
|
37
39
|
}
|
|
38
40
|
Segment.prototype.set = function (p0, p1) {
|
package/dist/struct/3d/Shape.js
CHANGED
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
package/dist/struct/3d/Sphere.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.Sphere = void 0;
|
|
|
4
4
|
var Vec3_1 = require("../../math/Vec3");
|
|
5
5
|
var Sphere = /** @class */ (function () {
|
|
6
6
|
function Sphere(center, radius) {
|
|
7
|
-
if (center === void 0) { center = Vec3_1.v3(); }
|
|
7
|
+
if (center === void 0) { center = (0, Vec3_1.v3)(); }
|
|
8
8
|
if (radius === void 0) { radius = 0; }
|
|
9
9
|
this.center = center;
|
|
10
10
|
this.radius = radius;
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
8
10
|
};
|
|
9
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
12
|
exports.ArrayList = void 0;
|
|
@@ -83,7 +85,7 @@ var ArrayList = /** @class */ (function () {
|
|
|
83
85
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
84
86
|
value[_i - 1] = arguments[_i];
|
|
85
87
|
}
|
|
86
|
-
(_a = this._array).splice.apply(_a,
|
|
88
|
+
(_a = this._array).splice.apply(_a, __spreadArray([i, 0], value, false));
|
|
87
89
|
};
|
|
88
90
|
ArrayList.prototype.splice = function (start, deleteCount) {
|
|
89
91
|
var _a;
|
|
@@ -91,7 +93,7 @@ var ArrayList = /** @class */ (function () {
|
|
|
91
93
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
92
94
|
items[_i - 2] = arguments[_i];
|
|
93
95
|
}
|
|
94
|
-
(_a = this._array).splice.apply(_a,
|
|
96
|
+
(_a = this._array).splice.apply(_a, __spreadArray([start, deleteCount], items, false));
|
|
95
97
|
};
|
|
96
98
|
ArrayList.prototype.get = function (index) {
|
|
97
99
|
if (index < 0)
|
|
@@ -111,7 +113,7 @@ var ArrayList = /** @class */ (function () {
|
|
|
111
113
|
* 克隆
|
|
112
114
|
*/
|
|
113
115
|
ArrayList.prototype.clone = function () {
|
|
114
|
-
return new this.constructor(common_1.clone(this._array));
|
|
116
|
+
return new this.constructor((0, common_1.clone)(this._array));
|
|
115
117
|
};
|
|
116
118
|
/**
|
|
117
119
|
* 分类
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xort/cga",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.78",
|
|
4
4
|
"description": "Xtor Compute Geometry Algorithm Libary 计算几何算法库",
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"types": "dist/
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
+
"pxy":"hpts -s 127.0.0.1:5006 -p 8002",
|
|
8
9
|
"release": "tsc && npm publish && git.sh",
|
|
9
10
|
"dev": "webpack-dev-server",
|
|
10
11
|
"build:dev": "webpack --mode development",
|
package/src/app.ts
CHANGED
|
@@ -214,6 +214,7 @@ import * as THREE from "three"
|
|
|
214
214
|
import { diamondMaterial } from "./diamondMaterialShader";
|
|
215
215
|
import { BreathLight } from "./effect/breath-light";
|
|
216
216
|
import { Mat4 } from "./math/Mat4";
|
|
217
|
+
import { Color } from "./index";
|
|
217
218
|
var tgeo = new THREE.BufferGeometry();
|
|
218
219
|
tgeo.setAttribute('position', new THREE.Float32BufferAttribute(geometry.getAttribute('position').array, 3));
|
|
219
220
|
tgeo.setAttribute('normal', new THREE.Float32BufferAttribute(geometry.getAttribute('normal').array, 3));
|
|
@@ -233,9 +234,11 @@ glv.add(mesh);
|
|
|
233
234
|
// glv.renderer.setRenderTarget(renderTarget);
|
|
234
235
|
// glv.render();
|
|
235
236
|
// glv.renderer.setRenderTarget(null);
|
|
236
|
-
// })
|
|
237
|
+
// })
|
|
237
238
|
|
|
238
239
|
|
|
240
|
+
const color = new Color()
|
|
241
|
+
debugger
|
|
239
242
|
|
|
240
243
|
class LabelTexture {
|
|
241
244
|
width: number;
|
package/src/index.ts
CHANGED
package/src/math/Color.ts
CHANGED
|
@@ -1,37 +1,20 @@
|
|
|
1
|
-
import { EventHandler } from "
|
|
2
|
-
import * as THREE from "three"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export function hue2rgb(p: number, q: number, t: number) {
|
|
6
|
-
|
|
7
|
-
if (t < 0) t += 1;
|
|
8
|
-
if (t > 1) t -= 1;
|
|
9
|
-
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
10
|
-
if (t < 1 / 2) return q;
|
|
11
|
-
if (t < 2 / 3) return p + (q - p) * 6 * (2 / 3 - t);
|
|
12
|
-
return p;
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function SRGBToLinear(c: number) {
|
|
17
|
-
|
|
18
|
-
return (c < 0.04045) ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function LinearToSRGB(c: number) {
|
|
23
|
-
|
|
24
|
-
return (c < 0.0031308) ? c * 12.92 : 1.055 * (Math.pow(c, 0.41666)) - 0.055;
|
|
25
|
-
|
|
26
|
-
}
|
|
1
|
+
import { EventHandler } from "../render/eventhandler";
|
|
27
2
|
|
|
28
3
|
export class Color extends EventHandler {
|
|
29
|
-
|
|
30
|
-
|
|
4
|
+
_r: number =0.0;
|
|
5
|
+
_g: number =0.0;
|
|
6
|
+
_b: number =0.0;
|
|
7
|
+
_a: number =1.0;
|
|
8
|
+
constructor(r: number = 0, g: number = 0, b: number = 0, a: number = 1) {
|
|
9
|
+
super();
|
|
10
|
+
this._r = r;
|
|
11
|
+
this._g = g;
|
|
12
|
+
this._b = b;
|
|
13
|
+
this._a = a;
|
|
31
14
|
}
|
|
32
15
|
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
get isColor() {
|
|
17
|
+
return true;
|
|
35
18
|
}
|
|
36
19
|
|
|
37
20
|
get r() {
|
|
@@ -65,7 +48,6 @@ export class Color extends EventHandler {
|
|
|
65
48
|
this._b = value;
|
|
66
49
|
this.fire('change', 'b', this._b, value)
|
|
67
50
|
}
|
|
68
|
-
THREE.Color
|
|
69
51
|
}
|
|
70
52
|
|
|
71
53
|
get a() {
|
|
@@ -153,5 +135,5 @@ export class Color extends EventHandler {
|
|
|
153
135
|
toJSON() {
|
|
154
136
|
return this.getHex();
|
|
155
137
|
}
|
|
156
|
-
|
|
138
|
+
|
|
157
139
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Mat4 } from "src/math/Mat4";
|
|
2
|
-
import { Thing } from "src/render/thing";
|
|
3
|
-
import { TypedConstraint } from "./constaint/constraint";
|
|
4
|
-
export declare class Bone extends Thing {
|
|
5
|
-
children: Bone[];
|
|
6
|
-
contraints: TypedConstraint[];
|
|
7
|
-
matrix: Mat4;
|
|
8
|
-
constructor();
|
|
9
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.Bone = void 0;
|
|
19
|
-
var Mat4_1 = require("src/math/Mat4");
|
|
20
|
-
var thing_1 = require("src/render/thing");
|
|
21
|
-
/*
|
|
22
|
-
* @Description :
|
|
23
|
-
* @Author : 赵耀圣
|
|
24
|
-
* @QQ : 549184003
|
|
25
|
-
* @Date : 2021-03-22 17:41:30
|
|
26
|
-
* @LastEditTime : 2021-03-23 16:19:09
|
|
27
|
-
* @FilePath : \cga.js\src\IKanimation\Bone.ts
|
|
28
|
-
*/
|
|
29
|
-
var Bone = /** @class */ (function (_super) {
|
|
30
|
-
__extends(Bone, _super);
|
|
31
|
-
function Bone() {
|
|
32
|
-
var _this = _super.call(this) || this;
|
|
33
|
-
_this.children = [];
|
|
34
|
-
_this.contraints = [];
|
|
35
|
-
_this.matrix = Mat4_1.Mat4.Identity;
|
|
36
|
-
return _this;
|
|
37
|
-
}
|
|
38
|
-
return Bone;
|
|
39
|
-
}(thing_1.Thing));
|
|
40
|
-
exports.Bone = Bone;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Quat } from "../math/Quat";
|
|
2
|
-
import { Vec3 } from "../math/Vec3";
|
|
3
|
-
import { TypedConstraint } from "./constaint/constraint";
|
|
4
|
-
import { ISolver } from "./isolver";
|
|
5
|
-
import { Skeleton } from "./skeleton";
|
|
6
|
-
/**
|
|
7
|
-
* @description :
|
|
8
|
-
* @param {*}
|
|
9
|
-
* @return {*}
|
|
10
|
-
* @example :
|
|
11
|
-
*/
|
|
12
|
-
export declare class CCDSolver implements ISolver {
|
|
13
|
-
constructor();
|
|
14
|
-
updateTarget(): void;
|
|
15
|
-
projectPlane(v: Vec3, normal: Vec3): Vec3;
|
|
16
|
-
calcAngle(v1: Vec3, v2: Vec3, dir: Vec3): number;
|
|
17
|
-
/**
|
|
18
|
-
* @description :
|
|
19
|
-
* @param {Vec3} target 目标点
|
|
20
|
-
* @param {Vec3} zeroPos 关节原点
|
|
21
|
-
* @param {Vec3} effector 末端效应点
|
|
22
|
-
* @return {*}
|
|
23
|
-
* @example :
|
|
24
|
-
*/
|
|
25
|
-
solveTranslate(target: Vec3, zeroPos: Vec3, effector: Vec3): void;
|
|
26
|
-
/**
|
|
27
|
-
* @description :
|
|
28
|
-
* @param {Vec3} target 目标点
|
|
29
|
-
* @param {Vec3} zeroPos 关节原点
|
|
30
|
-
* @param {Vec3} effector 末端效应点
|
|
31
|
-
* @return {*}
|
|
32
|
-
* @example :
|
|
33
|
-
*/
|
|
34
|
-
solveRotation(target: Vec3, zeroPos: Vec3, effector: Vec3, contraints?: TypedConstraint[]): Quat;
|
|
35
|
-
solveIK(skeleton: Skeleton, target: Vec3): void;
|
|
36
|
-
solve(bones: any): void;
|
|
37
|
-
}
|