@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
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* @Description :
|
|
4
|
-
* @Author : 赵耀圣
|
|
5
|
-
* @QQ : 549184003
|
|
6
|
-
* @Date : 2021-03-22 17:27:16
|
|
7
|
-
* @LastEditTime : 2021-03-23 18:01:49
|
|
8
|
-
* @FilePath : \cga.js\src\IKanimation\CCDSolver.ts
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.CCDSolver = void 0;
|
|
12
|
-
var Math_1 = require("../math/Math");
|
|
13
|
-
var Plane_1 = require("../struct/3d/Plane");
|
|
14
|
-
var Quat_1 = require("../math/Quat");
|
|
15
|
-
var Vec3_1 = require("../math/Vec3");
|
|
16
|
-
var _quat = new Quat_1.Quat();
|
|
17
|
-
var _plane = new Plane_1.Plane();
|
|
18
|
-
/**
|
|
19
|
-
* @description :
|
|
20
|
-
* @param {*}
|
|
21
|
-
* @return {*}
|
|
22
|
-
* @example :
|
|
23
|
-
*/
|
|
24
|
-
var CCDSolver = /** @class */ (function () {
|
|
25
|
-
function CCDSolver() {
|
|
26
|
-
}
|
|
27
|
-
CCDSolver.prototype.updateTarget = function () {
|
|
28
|
-
};
|
|
29
|
-
CCDSolver.prototype.projectPlane = function (v, normal) {
|
|
30
|
-
return v.clone().projectOnPlaneNormal(normal);
|
|
31
|
-
};
|
|
32
|
-
CCDSolver.prototype.calcAngle = function (v1, v2, dir) {
|
|
33
|
-
var vc1 = v1.clone();
|
|
34
|
-
var vc2 = v2.clone();
|
|
35
|
-
var angle = (0, Math_1.clamp)(vc1.normalize().dot(vc2.normalize()), -1, 1);
|
|
36
|
-
angle = Math.acos(angle);
|
|
37
|
-
if (vc1.cross(vc2).dot(dir) < 0)
|
|
38
|
-
return -angle;
|
|
39
|
-
return angle;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* @description :
|
|
43
|
-
* @param {Vec3} target 目标点
|
|
44
|
-
* @param {Vec3} zeroPos 关节原点
|
|
45
|
-
* @param {Vec3} effector 末端效应点
|
|
46
|
-
* @return {*}
|
|
47
|
-
* @example :
|
|
48
|
-
*/
|
|
49
|
-
CCDSolver.prototype.solveTranslate = function (target, zeroPos, effector) {
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* @description :
|
|
53
|
-
* @param {Vec3} target 目标点
|
|
54
|
-
* @param {Vec3} zeroPos 关节原点
|
|
55
|
-
* @param {Vec3} effector 末端效应点
|
|
56
|
-
* @return {*}
|
|
57
|
-
* @example :
|
|
58
|
-
*/
|
|
59
|
-
CCDSolver.prototype.solveRotation = function (target, zeroPos, effector, contraints) {
|
|
60
|
-
var dir0 = effector.clone().sub(zeroPos).normalize();
|
|
61
|
-
var dir1 = target.clone().sub(zeroPos).normalize();
|
|
62
|
-
var rotationAxis = (0, Vec3_1.v3)().cross(dir0, dir1).normalize();
|
|
63
|
-
_plane.setFromPointNormal(zeroPos, rotationAxis);
|
|
64
|
-
//最近点
|
|
65
|
-
var closestDir = this.projectPlane(target, rotationAxis);
|
|
66
|
-
closestDir.sub(zeroPos);
|
|
67
|
-
var angle = 0;
|
|
68
|
-
_quat.setFromUnitVecs(dir0, closestDir);
|
|
69
|
-
return _quat.clone();
|
|
70
|
-
};
|
|
71
|
-
CCDSolver.prototype.solveIK = function (skeleton, target) {
|
|
72
|
-
var i = 0;
|
|
73
|
-
while (i++ < skeleton.boneNum) {
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
CCDSolver.prototype.solve = function (bones) {
|
|
77
|
-
// for (var i = bones.Length - 2; i > -1; i--) {
|
|
78
|
-
// // Slerp if weight is < 0
|
|
79
|
-
// //CCD tends to overemphasise the rotations of the bones closer to the target position. Reducing bone weight down the hierarchy will compensate for this effect.
|
|
80
|
-
// var w = bones[i].weight * IKPositionWeight;
|
|
81
|
-
// if (w > 0) {
|
|
82
|
-
// Vec3 toLastBone = bones[bones.Length - 1].transform.position - bones[i].transform.position;
|
|
83
|
-
// Vec3 toTarget = targetPosition - bones[i].transform.position;
|
|
84
|
-
// // Get the rotation to direct the last bone to the target
|
|
85
|
-
// Quat targetRotation = Quat.FromToRotation(toLastBone, toTarget) * bones[i].transform.rotation;
|
|
86
|
-
// if (w >= 1) bones[i].transform.rotation = targetRotation;
|
|
87
|
-
// else bones[i].transform.rotation = Quaternion.Lerp(bones[i].transform.rotation, targetRotation, w);
|
|
88
|
-
// }
|
|
89
|
-
// }
|
|
90
|
-
};
|
|
91
|
-
return CCDSolver;
|
|
92
|
-
}());
|
|
93
|
-
exports.CCDSolver = CCDSolver;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Joint = void 0;
|
|
4
|
-
/*
|
|
5
|
-
* @Description :
|
|
6
|
-
* @Author : 赵耀圣
|
|
7
|
-
* @QQ : 549184003
|
|
8
|
-
* @Date : 2021-03-23 16:09:29
|
|
9
|
-
* @LastEditTime : 2021-03-23 16:31:32
|
|
10
|
-
* @FilePath : \cga.js\src\IKanimation\Joint.ts
|
|
11
|
-
*/
|
|
12
|
-
var Joint = /** @class */ (function () {
|
|
13
|
-
function Joint() {
|
|
14
|
-
}
|
|
15
|
-
return Joint;
|
|
16
|
-
}());
|
|
17
|
-
exports.Joint = Joint;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* @Description :
|
|
4
|
-
* @Author : 赵耀圣
|
|
5
|
-
* @QQ : 549184003
|
|
6
|
-
* @Date : 2021-03-23 15:38:27
|
|
7
|
-
* @LastEditTime : 2021-03-23 16:05:43
|
|
8
|
-
* @FilePath : \cga.js\src\IKanimation\constaint\constraint.ts
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.TypedConstraint = exports.ISpace = void 0;
|
|
12
|
-
var Mat4_1 = require("../../math/Mat4");
|
|
13
|
-
var ISpace;
|
|
14
|
-
(function (ISpace) {
|
|
15
|
-
ISpace[ISpace["Globe"] = 0] = "Globe";
|
|
16
|
-
ISpace[ISpace["Local"] = 1] = "Local";
|
|
17
|
-
})(ISpace = exports.ISpace || (exports.ISpace = {}));
|
|
18
|
-
var TypedConstraint = /** @class */ (function () {
|
|
19
|
-
function TypedConstraint() {
|
|
20
|
-
this.space = ISpace.Local;
|
|
21
|
-
this.matrix = Mat4_1.Mat4.Identity;
|
|
22
|
-
}
|
|
23
|
-
return TypedConstraint;
|
|
24
|
-
}());
|
|
25
|
-
exports.TypedConstraint = TypedConstraint;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Vec3 } from "src/math/Vec3";
|
|
2
|
-
import { TypedConstraint } from "./constraint";
|
|
3
|
-
/**
|
|
4
|
-
* @description : 铰链约束
|
|
5
|
-
* @example :
|
|
6
|
-
*/
|
|
7
|
-
export declare class HingeContraint extends TypedConstraint {
|
|
8
|
-
axis: Vec3;
|
|
9
|
-
minAngle: number;
|
|
10
|
-
maxAngle: number;
|
|
11
|
-
constructor();
|
|
12
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* @Description :
|
|
4
|
-
* @Author : 赵耀圣
|
|
5
|
-
* @QQ : 549184003
|
|
6
|
-
* @Date : 2021-03-23 15:38:13
|
|
7
|
-
* @LastEditTime : 2021-03-23 16:05:01
|
|
8
|
-
* @FilePath : \cga.js\src\IKanimation\constaint\hinge.ts
|
|
9
|
-
*/
|
|
10
|
-
var __extends = (this && this.__extends) || (function () {
|
|
11
|
-
var extendStatics = function (d, b) {
|
|
12
|
-
extendStatics = Object.setPrototypeOf ||
|
|
13
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
14
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
15
|
-
return extendStatics(d, b);
|
|
16
|
-
};
|
|
17
|
-
return function (d, b) {
|
|
18
|
-
if (typeof b !== "function" && b !== null)
|
|
19
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
20
|
-
extendStatics(d, b);
|
|
21
|
-
function __() { this.constructor = d; }
|
|
22
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
23
|
-
};
|
|
24
|
-
})();
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.HingeContraint = void 0;
|
|
27
|
-
var Vec3_1 = require("src/math/Vec3");
|
|
28
|
-
var constraint_1 = require("./constraint");
|
|
29
|
-
/**
|
|
30
|
-
* @description : 铰链约束
|
|
31
|
-
* @example :
|
|
32
|
-
*/
|
|
33
|
-
var HingeContraint = /** @class */ (function (_super) {
|
|
34
|
-
__extends(HingeContraint, _super);
|
|
35
|
-
function HingeContraint() {
|
|
36
|
-
var _this = _super.call(this) || this;
|
|
37
|
-
_this.axis = Vec3_1.Vec3.UnitX;
|
|
38
|
-
//旋转的最小角度
|
|
39
|
-
_this.minAngle = -Infinity;
|
|
40
|
-
//旋转的最大角度
|
|
41
|
-
_this.maxAngle = +Infinity;
|
|
42
|
-
return _this;
|
|
43
|
-
}
|
|
44
|
-
return HingeContraint;
|
|
45
|
-
}(constraint_1.TypedConstraint));
|
|
46
|
-
exports.HingeContraint = HingeContraint;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Vec3 } from "src/math/Vec3";
|
|
2
|
-
import { TypedConstraint } from "./constraint";
|
|
3
|
-
/**
|
|
4
|
-
* @description : 滑块约束
|
|
5
|
-
* @example :
|
|
6
|
-
*/
|
|
7
|
-
export declare class SliderConstraint extends TypedConstraint {
|
|
8
|
-
axis: Vec3;
|
|
9
|
-
min: number;
|
|
10
|
-
max: number;
|
|
11
|
-
constructor();
|
|
12
|
-
}
|
|
@@ -1,44 +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.SliderConstraint = void 0;
|
|
19
|
-
var Vec3_1 = require("src/math/Vec3");
|
|
20
|
-
var constraint_1 = require("./constraint");
|
|
21
|
-
/*
|
|
22
|
-
* @Description :
|
|
23
|
-
* @Author : 赵耀圣
|
|
24
|
-
* @QQ : 549184003
|
|
25
|
-
* @Date : 2021-03-23 15:38:05
|
|
26
|
-
* @LastEditTime : 2021-03-23 16:01:18
|
|
27
|
-
* @FilePath : \cga.js\src\IKanimation\constaint\slider.ts
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* @description : 滑块约束
|
|
31
|
-
* @example :
|
|
32
|
-
*/
|
|
33
|
-
var SliderConstraint = /** @class */ (function (_super) {
|
|
34
|
-
__extends(SliderConstraint, _super);
|
|
35
|
-
function SliderConstraint() {
|
|
36
|
-
var _this = _super.call(this) || this;
|
|
37
|
-
_this.axis = Vec3_1.Vec3.UnitX;
|
|
38
|
-
_this.min = 0;
|
|
39
|
-
_this.max = 10;
|
|
40
|
-
return _this;
|
|
41
|
-
}
|
|
42
|
-
return SliderConstraint;
|
|
43
|
-
}(constraint_1.TypedConstraint));
|
|
44
|
-
exports.SliderConstraint = SliderConstraint;
|
|
File without changes
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* @Description :
|
|
4
|
-
* @Author : 赵耀圣
|
|
5
|
-
* @QQ : 549184003
|
|
6
|
-
* @Date : 2021-03-22 17:22:02
|
|
7
|
-
* @LastEditTime : 2021-03-22 17:26:46
|
|
8
|
-
* @FilePath : \cga.js\src\IKanimation\solver.ts
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* @Description :
|
|
4
|
-
* @Author : 赵耀圣
|
|
5
|
-
* @QQ : 549184003
|
|
6
|
-
* @Date : 2021-03-22 17:38:38
|
|
7
|
-
* @LastEditTime : 2021-03-23 16:45:35
|
|
8
|
-
* @FilePath : \cga.js\src\IKanimation\skeleton.ts
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.Skeleton = void 0;
|
|
12
|
-
/**
|
|
13
|
-
* @description : 骨架
|
|
14
|
-
* @param {*}
|
|
15
|
-
* @return {*}
|
|
16
|
-
* @example :
|
|
17
|
-
*/
|
|
18
|
-
var Skeleton = /** @class */ (function () {
|
|
19
|
-
function Skeleton() {
|
|
20
|
-
this.bones = [[]]; //多级骨骼
|
|
21
|
-
}
|
|
22
|
-
Object.defineProperty(Skeleton.prototype, "boneNum", {
|
|
23
|
-
get: function () {
|
|
24
|
-
return this.bones.length;
|
|
25
|
-
},
|
|
26
|
-
enumerable: false,
|
|
27
|
-
configurable: true
|
|
28
|
-
});
|
|
29
|
-
return Skeleton;
|
|
30
|
-
}());
|
|
31
|
-
exports.Skeleton = Skeleton;
|
package/dist/src/alg/common.d.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { Vec3 } from '../math/Vec3';
|
|
2
|
-
import { Circle } from '../struct/3d/Circle';
|
|
3
|
-
import { Quat } from '../math/Quat';
|
|
4
|
-
import { Plane } from '../struct/3d/Plane';
|
|
5
|
-
import { Mat4 } from '../math/Mat4';
|
|
6
|
-
/**
|
|
7
|
-
* 数组深度复制
|
|
8
|
-
* @param {Array} array
|
|
9
|
-
*/
|
|
10
|
-
export declare function clone(array: any | any[]): any;
|
|
11
|
-
/**
|
|
12
|
-
* 点排序函数 xyz 有序排序回调
|
|
13
|
-
* @param {Vector*} a
|
|
14
|
-
* @param {Vector*} b
|
|
15
|
-
*/
|
|
16
|
-
export declare function vectorCompare(a: any | Vec3, b: any | Vec3): number;
|
|
17
|
-
/**
|
|
18
|
-
* 计算包围盒
|
|
19
|
-
* @param {*} points 点集
|
|
20
|
-
* @returns {Array[min,max]} 返回最小最大值
|
|
21
|
-
*/
|
|
22
|
-
export declare function boundingBox(points: Vec3[]): Vec3[];
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* @param {*} points
|
|
26
|
-
* @param {*} Quat
|
|
27
|
-
* @param {Boolean} ref 是否是引用
|
|
28
|
-
*/
|
|
29
|
-
export declare function applyQuat(points: any | Vec3[], Quat: Quat, ref?: boolean): Vec3 | any;
|
|
30
|
-
/**
|
|
31
|
-
* 平移
|
|
32
|
-
* @param {*} points
|
|
33
|
-
* @param {*} distance
|
|
34
|
-
* @param {*} ref
|
|
35
|
-
*/
|
|
36
|
-
export declare function translate(points: any | Vec3[], distance: Vec3, ref?: boolean): Vec3[] | any;
|
|
37
|
-
/**
|
|
38
|
-
* 旋转
|
|
39
|
-
* @param {*} points
|
|
40
|
-
* @param {*} axis
|
|
41
|
-
* @param {*} angle
|
|
42
|
-
* @param {*} ref
|
|
43
|
-
*/
|
|
44
|
-
export declare function rotate(points: any | Vec3[], axis: Vec3, angle: number, ref?: boolean): any;
|
|
45
|
-
/**
|
|
46
|
-
* 两个向量之间存在的旋转量来旋转点集
|
|
47
|
-
* @param {*} points
|
|
48
|
-
* @param {*} axis
|
|
49
|
-
* @param {*} angle
|
|
50
|
-
* @param {*} ref
|
|
51
|
-
*/
|
|
52
|
-
export declare function rotateByUnitVectors(points: any | Vec3[], vFrom: Vec3, vTo: Vec3, ref?: boolean): any;
|
|
53
|
-
/**
|
|
54
|
-
* 缩放
|
|
55
|
-
* @param {*} points
|
|
56
|
-
* @param {*} axis
|
|
57
|
-
* @param {*} angle
|
|
58
|
-
* @param {*} ref
|
|
59
|
-
*/
|
|
60
|
-
export declare function scale(points: any | Vec3[], _scale: Vec3, ref?: boolean): Vec3[] | any;
|
|
61
|
-
/**
|
|
62
|
-
* 响应矩阵
|
|
63
|
-
* @param {*} points
|
|
64
|
-
* @param {*} axis
|
|
65
|
-
* @param {*} angle
|
|
66
|
-
* @param {*} ref
|
|
67
|
-
*/
|
|
68
|
-
export declare function applyMatrix4(points: any | Vec3[], matrix: Mat4, ref?: boolean): Vec3[] | any;
|
|
69
|
-
/**
|
|
70
|
-
* 简化点集数组,折线,路径
|
|
71
|
-
* @param {*} points 点集数组,折线,路径 ,继承Array
|
|
72
|
-
* @param {*} maxDistance 简化最大距离
|
|
73
|
-
* @param {*} maxAngle 简化最大角度
|
|
74
|
-
*/
|
|
75
|
-
export declare function simplifyPointList(points: any | Vec3[], maxDistance?: number, maxAngle?: number): any;
|
|
76
|
-
/**
|
|
77
|
-
* 以某个平面生成对称镜像
|
|
78
|
-
* @param {*} points 点集
|
|
79
|
-
* @param {*} plane 对称镜像平面
|
|
80
|
-
*/
|
|
81
|
-
export declare function reverseOnPlane(points: any | Vec3[], plane: Plane): void;
|
|
82
|
-
/**
|
|
83
|
-
* 投影到平面
|
|
84
|
-
* @param {*} points 点集
|
|
85
|
-
* @param {*} plane 投影平面
|
|
86
|
-
* @param {*} projectDirect 默认是法线的方向
|
|
87
|
-
*/
|
|
88
|
-
export declare function projectOnPlane(points: any | Vec3[], plane: Plane, projectDirect: Vec3): any;
|
|
89
|
-
/**
|
|
90
|
-
* 计算共面点集所在的平面
|
|
91
|
-
* @param {Array<Vec3|Point>} points
|
|
92
|
-
*/
|
|
93
|
-
export declare function recognitionPlane(points: Vec3[] | any): Plane;
|
|
94
|
-
/**
|
|
95
|
-
* 判断所有点是否在同一个平面
|
|
96
|
-
* @param {Array<Vec3|Point>} points
|
|
97
|
-
* @param {*} precision
|
|
98
|
-
* @returns {Boolean|Plane} 如果在同一个平面返回所在平面,否则返回false
|
|
99
|
-
*/
|
|
100
|
-
export declare function isInOnePlane(points: Vec3[] | any, precision?: number): false | Plane;
|
|
101
|
-
/**
|
|
102
|
-
* 判断多边是否共线:
|
|
103
|
-
* 考虑情况点之间的距离应该大于最小容忍值
|
|
104
|
-
* @param {...Vec3[]} ps
|
|
105
|
-
*/
|
|
106
|
-
export declare function pointsCollinear(...ps: Vec3[]): boolean;
|
|
107
|
-
/**
|
|
108
|
-
* 三点计算圆
|
|
109
|
-
* @param p0
|
|
110
|
-
* @param p1
|
|
111
|
-
* @param p2
|
|
112
|
-
*/
|
|
113
|
-
export declare function calcCircleFromThreePoint(p0: Vec3, p1: Vec3, p2: Vec3): Circle;
|
|
114
|
-
export declare function angle(v0: Vec3, v1: Vec3, normal?: Vec3): number;
|