@xort/cga 0.0.83 → 0.0.84
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/@xort_cga.js +639 -314
- package/deploy.sh +13 -1
- package/dist/IKanimation/Bone.d.ts +1 -3
- package/dist/IKanimation/Bone.js +4 -22
- package/dist/alg/extrude.js +4 -4
- package/dist/extends/geometryaid.js +7 -15
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/math/Color.d.ts +1 -2
- package/dist/math/Color.js +14 -31
- package/dist/math/Euler.d.ts +4 -5
- package/dist/math/Euler.js +16 -34
- package/dist/math/HVec3.d.ts +1 -2
- package/dist/math/HVec3.js +13 -30
- package/dist/math/Quat.d.ts +1 -2
- package/dist/math/Quat.js +23 -43
- package/dist/math/Vec2.d.ts +4 -4
- package/dist/math/Vec2.js +7 -24
- package/dist/math/Vec3.d.ts +5 -9
- package/dist/math/Vec3.js +35 -52
- package/dist/math/Vec4.d.ts +4 -4
- package/dist/math/Vec4.js +11 -28
- package/dist/math/vecs.d.ts +19 -6
- package/dist/math/vecs.js +31 -1
- package/dist/render/{buffer-attribute.d.ts → bufferAttribute.d.ts} +8 -4
- package/dist/render/{buffer-attribute.js → bufferAttribute.js} +4 -0
- package/dist/render/geometry.d.ts +7 -9
- package/dist/render/geometry.js +22 -25
- package/dist/render/mesh.d.ts +23 -18
- package/dist/render/mesh.js +62 -57
- package/dist/render/types.d.ts +1 -0
- package/dist/struct/3d/Box.d.ts +1 -1
- package/dist/struct/3d/Plane.js +1 -1
- package/package.json +73 -73
- package/rollup.config.js +1 -1
- package/src/IKanimation/Bone.ts +1 -5
- package/src/alg/extrude.ts +6 -6
- package/src/app.ts +2 -10
- package/src/extends/geometryaid.ts +10 -13
- package/src/index.ts +2 -4
- package/src/math/Color.ts +6 -8
- package/src/math/Euler.ts +11 -12
- package/src/math/HVec3.ts +3 -5
- package/src/math/Quat.ts +18 -23
- package/src/math/Vec2.ts +7 -7
- package/src/math/Vec3.ts +37 -36
- package/src/math/Vec4.ts +9 -9
- package/src/math/vecs.ts +50 -8
- package/src/render/{buffer-attribute.ts → bufferAttribute.ts} +11 -4
- package/src/render/geometry.ts +18 -15
- package/src/render/mesh.ts +56 -54
- package/src/render/types.ts +2 -0
- package/src/struct/3d/Box.ts +1 -1
- package/src/struct/3d/Plane.ts +2 -4
- package/dist/math/Vec.d.ts +0 -7
- package/dist/math/Vec.js +0 -41
- package/dist/math/vector.d.ts +0 -114
- package/dist/math/vector.js +0 -371
- package/dist/render/eventhandler.d.ts +0 -78
- package/dist/render/eventhandler.js +0 -191
- package/dist/render/thing.d.ts +0 -34
- package/dist/render/thing.js +0 -194
- package/src/math/Vec.ts +0 -26
- package/src/render/eventhandler.ts +0 -196
- package/src/render/thing.ts +0 -204
package/deploy.sh
CHANGED
|
@@ -24,4 +24,16 @@ git push -f git@github.com:yszhao91/cga.js.git master:gh-pages
|
|
|
24
24
|
|
|
25
25
|
rm -rf *
|
|
26
26
|
cd -
|
|
27
|
-
git checkout master
|
|
27
|
+
git checkout master
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# git config --global http.proxy socks5://127.0.0.1:5006
|
|
31
|
+
# git config --global https.proxy socks5://127.0.0.1:5006
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# git config --global https.proxy http://127.0.0.1:5006
|
|
35
|
+
# git config --global https.proxy https://127.0.0.1:5006
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# git config --global --unset http.proxy
|
|
39
|
+
# git config --global --unset https.proxy
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Mat4 } from "src/math/Mat4";
|
|
2
|
-
import { Thing } from "src/render/thing";
|
|
3
2
|
import { TypedConstraint } from "./constaint/constraint";
|
|
4
|
-
export declare class Bone
|
|
5
|
-
children: Bone[];
|
|
3
|
+
export declare class Bone {
|
|
6
4
|
contraints: TypedConstraint[];
|
|
7
5
|
matrix: Mat4;
|
|
8
6
|
constructor();
|
package/dist/IKanimation/Bone.js
CHANGED
|
@@ -1,21 +1,7 @@
|
|
|
1
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 (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
3
|
exports.Bone = void 0;
|
|
17
4
|
var Mat4_1 = require("src/math/Mat4");
|
|
18
|
-
var thing_1 = require("src/render/thing");
|
|
19
5
|
/*
|
|
20
6
|
* @Description :
|
|
21
7
|
* @Author : 赵耀圣
|
|
@@ -24,15 +10,11 @@ var thing_1 = require("src/render/thing");
|
|
|
24
10
|
* @LastEditTime : 2021-03-23 16:19:09
|
|
25
11
|
* @FilePath : \cga.js\src\IKanimation\Bone.ts
|
|
26
12
|
*/
|
|
27
|
-
var Bone = /** @class */ (function (
|
|
28
|
-
__extends(Bone, _super);
|
|
13
|
+
var Bone = /** @class */ (function () {
|
|
29
14
|
function Bone() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
_this.contraints = [];
|
|
33
|
-
_this.matrix = Mat4_1.Mat4.Identity;
|
|
34
|
-
return _this;
|
|
15
|
+
this.contraints = [];
|
|
16
|
+
this.matrix = Mat4_1.Mat4.Identity;
|
|
35
17
|
}
|
|
36
18
|
return Bone;
|
|
37
|
-
}(
|
|
19
|
+
}());
|
|
38
20
|
exports.Bone = Bone;
|
package/dist/alg/extrude.js
CHANGED
|
@@ -153,7 +153,7 @@ function linkSides(options) {
|
|
|
153
153
|
var orgShape = options.orgShape || shapes[0];
|
|
154
154
|
var orgHoles = options.orgHoles || (holess && holess[0]);
|
|
155
155
|
if (index)
|
|
156
|
-
mesh_1.indexable(allVertics, index);
|
|
156
|
+
mesh_1.MeshTool.indexable(allVertics, index);
|
|
157
157
|
for (var i = 0; i < length; i++) {
|
|
158
158
|
if (holess)
|
|
159
159
|
triangles.push.apply(triangles, linkSide({ side0: shapes[i], side1: shapes[(i + 1) % shapes.length], holes0: holess[i], holes1: holess[(i + 1) % shapes.length], shapeClosed: options.shapeClosed }));
|
|
@@ -466,7 +466,7 @@ function extrude_obsolete(shape, arg_path, options) {
|
|
|
466
466
|
}
|
|
467
467
|
var gindex = { index: 0 };
|
|
468
468
|
var vertices = array_1.flat(shapeArray);
|
|
469
|
-
mesh_1.indexable(vertices, gindex);
|
|
469
|
+
mesh_1.MeshTool.indexable(vertices, gindex);
|
|
470
470
|
var index = linkSides({ shapes: shapeArray, shapeClosed: options.shapeClosed, pathClosed: options.isClosed2, orgShape: shape }).index;
|
|
471
471
|
shapepath = new Path_1.Path(shape);
|
|
472
472
|
var uvs = [];
|
|
@@ -500,9 +500,9 @@ function extrude_obsolete(shape, arg_path, options) {
|
|
|
500
500
|
var sealStartTris = trianglution_1.triangulation(sealUv, [], { normal: normal });
|
|
501
501
|
sealStartTris.reverse();
|
|
502
502
|
if (options.sealStart)
|
|
503
|
-
mesh_1.indexable(startSeal, gindex);
|
|
503
|
+
mesh_1.MeshTool.indexable(startSeal, gindex);
|
|
504
504
|
if (options.sealEnd)
|
|
505
|
-
mesh_1.indexable(endSeal, gindex);
|
|
505
|
+
mesh_1.MeshTool.indexable(endSeal, gindex);
|
|
506
506
|
var sealEndTris = [];
|
|
507
507
|
var hasVLen = vertices.length;
|
|
508
508
|
if (options.sealStart)
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.linksToGeometry = exports.linkToGeometry = exports.extrudeToGeometryBuffer = exports.toGeometryBuffer = void 0;
|
|
4
|
-
/*
|
|
5
|
-
* @Description :
|
|
6
|
-
* @Author : 赵耀圣
|
|
7
|
-
* @Q群 : 632839661
|
|
8
|
-
* @Date : 2020-12-10 15:01:42
|
|
9
|
-
* @LastEditTime : 2021-03-11 10:54:11
|
|
10
|
-
* @FilePath : \cga.js\src\extends\geometryaid.ts
|
|
11
|
-
*/
|
|
12
|
-
var mesh_1 = require("../render/mesh");
|
|
13
4
|
var extrude_1 = require("../alg/extrude");
|
|
14
5
|
var trianglution_1 = require("../alg/trianglution");
|
|
15
6
|
var array_1 = require("../utils/array");
|
|
7
|
+
var mesh_1 = require("../render/mesh");
|
|
16
8
|
function toGeometryBuffer(geo) {
|
|
17
|
-
var buffer = mesh_1.toGeoBuffer(geo.position, geo.index, geo.uv);
|
|
9
|
+
var buffer = mesh_1.MeshTool.toGeoBuffer(geo.position, geo.index, geo.uv);
|
|
18
10
|
return buffer;
|
|
19
11
|
}
|
|
20
12
|
exports.toGeometryBuffer = toGeometryBuffer;
|
|
@@ -26,7 +18,7 @@ exports.toGeometryBuffer = toGeometryBuffer;
|
|
|
26
18
|
*/
|
|
27
19
|
function extrudeToGeometryBuffer(shape, arg_path, options) {
|
|
28
20
|
var extrudeRes = extrude_1.extrude_obsolete(shape, arg_path, options);
|
|
29
|
-
return mesh_1.toGeoBuffer(extrudeRes.vertices, extrudeRes.index, extrudeRes.uvs);
|
|
21
|
+
return mesh_1.MeshTool.toGeoBuffer(extrudeRes.vertices, extrudeRes.index, extrudeRes.uvs);
|
|
30
22
|
}
|
|
31
23
|
exports.extrudeToGeometryBuffer = extrudeToGeometryBuffer;
|
|
32
24
|
/**
|
|
@@ -54,7 +46,7 @@ function linksToGeometry(shapes, pathClosed, shapeClosed) {
|
|
|
54
46
|
if (pathClosed === void 0) { pathClosed = true; }
|
|
55
47
|
if (shapeClosed === void 0) { shapeClosed = true; }
|
|
56
48
|
var vertices = array_1.flat(shapes);
|
|
57
|
-
mesh_1.indexable(vertices);
|
|
49
|
+
mesh_1.MeshTool.indexable(vertices);
|
|
58
50
|
var geo = extrude_1.linkSides({ shapes: shapes, shapeClosed: pathClosed, orgShape: shapes[0] });
|
|
59
51
|
var geometry = toGeometryBuffer(geo);
|
|
60
52
|
return geometry;
|
|
@@ -63,9 +55,9 @@ exports.linksToGeometry = linksToGeometry;
|
|
|
63
55
|
// /**
|
|
64
56
|
// * 三角剖分后转成几何体
|
|
65
57
|
// * 只考虑XY平面
|
|
66
|
-
// * @param {*} boundary
|
|
67
|
-
// * @param {*} hole
|
|
68
|
-
// * @param {*} options
|
|
58
|
+
// * @param {*} boundary
|
|
59
|
+
// * @param {*} hole
|
|
60
|
+
// * @param {*} options
|
|
69
61
|
// */
|
|
70
62
|
// export function trianglutionToGeometryBuffer(boundary: any, holes: any[] = [], options: any = { normal: Vec3.UnitZ }) {
|
|
71
63
|
// var triangles = triangulation(boundary, holes, options)
|
package/dist/index.d.ts
CHANGED
|
@@ -31,8 +31,7 @@ export * from "./struct/3d/Frustum";
|
|
|
31
31
|
export * from "./struct/3d/Sphere";
|
|
32
32
|
export * from "./alg/delaunator";
|
|
33
33
|
export * from "./alg/voronoi";
|
|
34
|
-
export * from "./render/eventhandler";
|
|
35
34
|
export * from "./extends/geometryaid";
|
|
36
|
-
export * from "./render/
|
|
35
|
+
export * from "./render/bufferAttribute";
|
|
37
36
|
export * from "./render/geometry";
|
|
38
37
|
export * from "./render/mesh";
|
package/dist/index.js
CHANGED
|
@@ -44,9 +44,8 @@ __exportStar(require("./struct/3d/Frustum"), exports);
|
|
|
44
44
|
__exportStar(require("./struct/3d/Sphere"), exports);
|
|
45
45
|
__exportStar(require("./alg/delaunator"), exports);
|
|
46
46
|
__exportStar(require("./alg/voronoi"), exports);
|
|
47
|
-
__exportStar(require("./render/eventhandler"), exports);
|
|
48
47
|
__exportStar(require("./extends/geometryaid"), exports);
|
|
49
48
|
//Geometry
|
|
50
|
-
__exportStar(require("./render/
|
|
49
|
+
__exportStar(require("./render/bufferAttribute"), exports);
|
|
51
50
|
__exportStar(require("./render/geometry"), exports);
|
|
52
51
|
__exportStar(require("./render/mesh"), exports);
|
package/dist/math/Color.d.ts
CHANGED
package/dist/math/Color.js
CHANGED
|
@@ -1,37 +1,20 @@
|
|
|
1
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 (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
3
|
exports.Color = void 0;
|
|
17
|
-
var
|
|
18
|
-
var Color = /** @class */ (function (_super) {
|
|
19
|
-
__extends(Color, _super);
|
|
4
|
+
var Color = /** @class */ (function () {
|
|
20
5
|
function Color(r, g, b, a) {
|
|
21
6
|
if (r === void 0) { r = 0; }
|
|
22
7
|
if (g === void 0) { g = 0; }
|
|
23
8
|
if (b === void 0) { b = 0; }
|
|
24
9
|
if (a === void 0) { a = 1; }
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
_this._a = a;
|
|
34
|
-
return _this;
|
|
10
|
+
this._r = 0.0;
|
|
11
|
+
this._g = 0.0;
|
|
12
|
+
this._b = 0.0;
|
|
13
|
+
this._a = 1.0;
|
|
14
|
+
this._r = r;
|
|
15
|
+
this._g = g;
|
|
16
|
+
this._b = b;
|
|
17
|
+
this._a = a;
|
|
35
18
|
}
|
|
36
19
|
Object.defineProperty(Color.prototype, "isColor", {
|
|
37
20
|
get: function () {
|
|
@@ -47,7 +30,7 @@ var Color = /** @class */ (function (_super) {
|
|
|
47
30
|
set: function (value) {
|
|
48
31
|
if (this._r !== value) {
|
|
49
32
|
this._r = value;
|
|
50
|
-
this.fire('change', 'r', this._r, value)
|
|
33
|
+
// this.fire('change', 'r', this._r, value)
|
|
51
34
|
}
|
|
52
35
|
},
|
|
53
36
|
enumerable: false,
|
|
@@ -60,7 +43,7 @@ var Color = /** @class */ (function (_super) {
|
|
|
60
43
|
set: function (value) {
|
|
61
44
|
if (this._g !== value) {
|
|
62
45
|
this._g = value;
|
|
63
|
-
this.fire('change', 'g', this._g, value)
|
|
46
|
+
// this.fire('change', 'g', this._g, value)
|
|
64
47
|
}
|
|
65
48
|
},
|
|
66
49
|
enumerable: false,
|
|
@@ -73,7 +56,7 @@ var Color = /** @class */ (function (_super) {
|
|
|
73
56
|
set: function (value) {
|
|
74
57
|
if (this._b !== value) {
|
|
75
58
|
this._b = value;
|
|
76
|
-
this.fire('change', 'b', this._b, value)
|
|
59
|
+
// this.fire('change', 'b', this._b, value)
|
|
77
60
|
}
|
|
78
61
|
},
|
|
79
62
|
enumerable: false,
|
|
@@ -86,7 +69,7 @@ var Color = /** @class */ (function (_super) {
|
|
|
86
69
|
set: function (value) {
|
|
87
70
|
if (this._a !== value) {
|
|
88
71
|
this._a = value;
|
|
89
|
-
this.fire('change', 'a', this._a, value)
|
|
72
|
+
// this.fire('change', 'a', this._a, value)
|
|
90
73
|
}
|
|
91
74
|
},
|
|
92
75
|
enumerable: false,
|
|
@@ -214,5 +197,5 @@ var Color = /** @class */ (function (_super) {
|
|
|
214
197
|
return this.getHexCssString();
|
|
215
198
|
};
|
|
216
199
|
return Color;
|
|
217
|
-
}(
|
|
200
|
+
}());
|
|
218
201
|
exports.Color = Color;
|
package/dist/math/Euler.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Mat4 } from "./Mat4";
|
|
2
2
|
import { Quat } from './Quat';
|
|
3
|
-
|
|
4
|
-
export declare class Euler extends EventHandler {
|
|
3
|
+
export declare class Euler {
|
|
5
4
|
_x: number;
|
|
6
5
|
_y: number;
|
|
7
6
|
_z: number;
|
|
@@ -24,14 +23,14 @@ export declare class Euler extends EventHandler {
|
|
|
24
23
|
_z: number;
|
|
25
24
|
_order: string;
|
|
26
25
|
}): this;
|
|
27
|
-
setFromRotationMat(m: Mat4, order: string, update: boolean | undefined): this;
|
|
28
|
-
setFromQuat(q: Quat, order?: any, update?: boolean): this;
|
|
26
|
+
setFromRotationMat(m: Mat4, order: string, update: boolean | undefined): this | undefined;
|
|
27
|
+
setFromQuat(q: Quat, order?: any, update?: boolean): this | undefined;
|
|
29
28
|
setFromVec3(v: {
|
|
30
29
|
x: any;
|
|
31
30
|
y: any;
|
|
32
31
|
z: any;
|
|
33
32
|
}, order: any): this;
|
|
34
|
-
reorder(newOrder: any): this;
|
|
33
|
+
reorder(newOrder: any): this | undefined;
|
|
35
34
|
equals(Euler: {
|
|
36
35
|
_x: number;
|
|
37
36
|
_y: number;
|
package/dist/math/Euler.js
CHANGED
|
@@ -1,42 +1,25 @@
|
|
|
1
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 (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
3
|
exports.euler = exports.Euler = void 0;
|
|
17
4
|
var Vec3_1 = require("./Vec3");
|
|
18
5
|
var Math_1 = require("./Math");
|
|
19
6
|
var Mat4_1 = require("./Mat4");
|
|
20
7
|
var Quat_1 = require("./Quat");
|
|
21
|
-
var eventhandler_1 = require("../render/eventhandler");
|
|
22
8
|
var _matrix = Mat4_1.m4();
|
|
23
9
|
var _Quat = Quat_1.quat();
|
|
24
10
|
var RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"];
|
|
25
11
|
var DefaultOrder = "XYZ";
|
|
26
|
-
var Euler = /** @class */ (function (
|
|
27
|
-
__extends(Euler, _super);
|
|
12
|
+
var Euler = /** @class */ (function () {
|
|
28
13
|
function Euler(_x, _y, _z, _order) {
|
|
29
14
|
if (_x === void 0) { _x = 0; }
|
|
30
15
|
if (_y === void 0) { _y = 0; }
|
|
31
16
|
if (_z === void 0) { _z = 0; }
|
|
32
17
|
if (_order === void 0) { _order = DefaultOrder; }
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
_this.isEuler = true;
|
|
39
|
-
return _this;
|
|
18
|
+
this._x = _x;
|
|
19
|
+
this._y = _y;
|
|
20
|
+
this._z = _z;
|
|
21
|
+
this._order = _order;
|
|
22
|
+
this.isEuler = true;
|
|
40
23
|
}
|
|
41
24
|
Object.defineProperty(Euler.prototype, "x", {
|
|
42
25
|
get: function () {
|
|
@@ -45,7 +28,7 @@ var Euler = /** @class */ (function (_super) {
|
|
|
45
28
|
set: function (value) {
|
|
46
29
|
if (this._x !== value) {
|
|
47
30
|
this._x = value;
|
|
48
|
-
this.fire('change', 'x', this._x, value)
|
|
31
|
+
// this.fire('change', 'x', this._x, value)
|
|
49
32
|
}
|
|
50
33
|
},
|
|
51
34
|
enumerable: false,
|
|
@@ -58,7 +41,7 @@ var Euler = /** @class */ (function (_super) {
|
|
|
58
41
|
set: function (value) {
|
|
59
42
|
if (this._y !== value) {
|
|
60
43
|
this._y = value;
|
|
61
|
-
this.fire('change', 'y', this._y, value)
|
|
44
|
+
// this.fire('change', 'y', this._y, value)
|
|
62
45
|
}
|
|
63
46
|
},
|
|
64
47
|
enumerable: false,
|
|
@@ -71,7 +54,7 @@ var Euler = /** @class */ (function (_super) {
|
|
|
71
54
|
set: function (value) {
|
|
72
55
|
if (this._z !== value) {
|
|
73
56
|
this._z = value;
|
|
74
|
-
this.fire('change', 'z', this._z, value)
|
|
57
|
+
// this.fire('change', 'z', this._z, value)
|
|
75
58
|
}
|
|
76
59
|
},
|
|
77
60
|
enumerable: false,
|
|
@@ -83,7 +66,7 @@ var Euler = /** @class */ (function (_super) {
|
|
|
83
66
|
},
|
|
84
67
|
set: function (value) {
|
|
85
68
|
if (this._order !== value) {
|
|
86
|
-
this.fire('change', 'order', this._order, value)
|
|
69
|
+
// this.fire('change', 'order', this._order, value)
|
|
87
70
|
this._order = value;
|
|
88
71
|
}
|
|
89
72
|
},
|
|
@@ -95,7 +78,7 @@ var Euler = /** @class */ (function (_super) {
|
|
|
95
78
|
this._y = y;
|
|
96
79
|
this._z = z;
|
|
97
80
|
this._order = order || this._order;
|
|
98
|
-
this.fire('change')
|
|
81
|
+
// this.fire('change')
|
|
99
82
|
return this;
|
|
100
83
|
};
|
|
101
84
|
Euler.prototype.clone = function () {
|
|
@@ -106,7 +89,7 @@ var Euler = /** @class */ (function (_super) {
|
|
|
106
89
|
this._y = Euler._y;
|
|
107
90
|
this._z = Euler._z;
|
|
108
91
|
this._order = Euler._order;
|
|
109
|
-
this.fire('change')
|
|
92
|
+
// this.fire('change')
|
|
110
93
|
return this;
|
|
111
94
|
};
|
|
112
95
|
Euler.prototype.setFromRotationMat = function (m, order, update) {
|
|
@@ -186,9 +169,8 @@ var Euler = /** @class */ (function (_super) {
|
|
|
186
169
|
console.warn("Euler: .setFromRotationMat() given unsupported order: " + order);
|
|
187
170
|
}
|
|
188
171
|
this._order = order;
|
|
189
|
-
if (update !== false)
|
|
190
|
-
this
|
|
191
|
-
return this;
|
|
172
|
+
if (update !== false) // this.fire('change')
|
|
173
|
+
return this;
|
|
192
174
|
};
|
|
193
175
|
Euler.prototype.setFromQuat = function (q, order, update) {
|
|
194
176
|
_matrix.makeRotationFromQuat(q);
|
|
@@ -214,7 +196,7 @@ var Euler = /** @class */ (function (_super) {
|
|
|
214
196
|
this._z = array[2];
|
|
215
197
|
if (array[3] !== undefined)
|
|
216
198
|
this._order = array[3];
|
|
217
|
-
this.fire('change')
|
|
199
|
+
// this.fire('change')
|
|
218
200
|
return this;
|
|
219
201
|
};
|
|
220
202
|
Euler.prototype.toArray = function (array, offset) {
|
|
@@ -235,7 +217,7 @@ var Euler = /** @class */ (function (_super) {
|
|
|
235
217
|
}
|
|
236
218
|
};
|
|
237
219
|
return Euler;
|
|
238
|
-
}(
|
|
220
|
+
}());
|
|
239
221
|
exports.Euler = Euler;
|
|
240
222
|
function euler(x, y, z) {
|
|
241
223
|
return new Euler(x, y, z);
|
package/dist/math/HVec3.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EventHandler } from '../render/eventhandler';
|
|
2
1
|
import Decimal from 'decimal.js';
|
|
3
2
|
export interface IHVec2 {
|
|
4
3
|
x: Decimal;
|
|
@@ -10,7 +9,7 @@ export interface IHVec3 extends IHVec2 {
|
|
|
10
9
|
export interface IHVec4 extends IHVec3 {
|
|
11
10
|
w: Decimal;
|
|
12
11
|
}
|
|
13
|
-
export declare class HVec3
|
|
12
|
+
export declare class HVec3 implements IHVec3 {
|
|
14
13
|
private _x;
|
|
15
14
|
private _y;
|
|
16
15
|
private _z;
|
package/dist/math/HVec3.js
CHANGED
|
@@ -1,22 +1,4 @@
|
|
|
1
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 (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.HVec3 = void 0;
|
|
20
2
|
/*
|
|
21
3
|
* @Description : arbitrary-precision 任意精度的向量
|
|
22
4
|
* @Author : 赵耀圣
|
|
@@ -25,22 +7,23 @@ exports.HVec3 = void 0;
|
|
|
25
7
|
* @LastEditTime : 2021-08-03 11:32:10
|
|
26
8
|
* @FilePath : \cga.js\src\math\HVec3.ts
|
|
27
9
|
*/
|
|
28
|
-
var
|
|
10
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.HVec3 = void 0;
|
|
29
15
|
var decimal_js_1 = __importDefault(require("decimal.js"));
|
|
30
|
-
var HVec3 = /** @class */ (function (
|
|
31
|
-
__extends(HVec3, _super);
|
|
16
|
+
var HVec3 = /** @class */ (function () {
|
|
32
17
|
function HVec3(_x, _y, _z) {
|
|
33
18
|
if (_x === void 0) { _x = 0; }
|
|
34
19
|
if (_y === void 0) { _y = 0; }
|
|
35
20
|
if (_z === void 0) { _z = 0; }
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_this.z = new decimal_js_1.default(_x);
|
|
43
|
-
return _this;
|
|
21
|
+
this._x = _x;
|
|
22
|
+
this._y = _y;
|
|
23
|
+
this._z = _z;
|
|
24
|
+
this.x = new decimal_js_1.default(_x);
|
|
25
|
+
this.y = new decimal_js_1.default(_x);
|
|
26
|
+
this.z = new decimal_js_1.default(_x);
|
|
44
27
|
}
|
|
45
28
|
HVec3.isVec3 = function (v) {
|
|
46
29
|
return !isNaN(v.x) && !isNaN(v.y) && !isNaN(v.z) && isNaN(v.w);
|
|
@@ -189,5 +172,5 @@ var HVec3 = /** @class */ (function (_super) {
|
|
|
189
172
|
return this.multiplyScalar(new decimal_js_1.default(1).mul(new decimal_js_1.default(scalar)));
|
|
190
173
|
};
|
|
191
174
|
return HVec3;
|
|
192
|
-
}(
|
|
175
|
+
}());
|
|
193
176
|
exports.HVec3 = HVec3;
|