@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.
Files changed (261) hide show
  1. package/dist/IKanimation/Bone.js +3 -1
  2. package/dist/IKanimation/CCDSolver.js +2 -2
  3. package/dist/IKanimation/constaint/hinge.js +3 -1
  4. package/dist/IKanimation/constaint/slider.js +3 -1
  5. package/dist/alg/common.js +2 -2
  6. package/dist/alg/extrude.js +56 -54
  7. package/dist/alg/pointset.js +5 -5
  8. package/dist/alg/trianglution.js +12 -10
  9. package/dist/app.js +18 -11
  10. package/dist/diamondMaterialShader.js +6 -2
  11. package/dist/effect/breath-light.js +3 -1
  12. package/dist/extends/geometryaid.js +7 -7
  13. package/dist/index.js +6 -2
  14. package/dist/math/Color.d.ts +6 -9
  15. package/dist/math/Color.js +18 -55
  16. package/dist/math/Euler.js +12 -10
  17. package/dist/math/HVec3.js +3 -1
  18. package/dist/math/Mat3.js +1 -1
  19. package/dist/math/Mat4.js +6 -6
  20. package/dist/math/Quat.js +4 -2
  21. package/dist/math/Vec.js +3 -1
  22. package/dist/math/Vec2.js +3 -1
  23. package/dist/math/Vec3.js +7 -5
  24. package/dist/math/Vec4.js +3 -1
  25. package/dist/math/vector.js +9 -7
  26. package/dist/render/buffer-attribute.js +12 -28
  27. package/dist/render/eventhandler.d.ts +1 -1
  28. package/dist/render/eventhandler.js +9 -7
  29. package/dist/render/geometry.js +2 -2
  30. package/dist/render/mesh.js +11 -9
  31. package/dist/render/thing.js +10 -8
  32. package/dist/render/types.js +2 -1
  33. package/dist/struct/3d/Box.js +3 -3
  34. package/dist/struct/3d/Capsule.js +3 -1
  35. package/dist/struct/3d/Circle.js +2 -2
  36. package/dist/struct/3d/Disk.js +1 -1
  37. package/dist/struct/3d/Line.js +4 -4
  38. package/dist/struct/3d/Path.js +13 -11
  39. package/dist/struct/3d/Plane.js +12 -10
  40. package/dist/struct/3d/Point.js +3 -1
  41. package/dist/struct/3d/Polygon.js +3 -1
  42. package/dist/struct/3d/Polyline.js +3 -1
  43. package/dist/struct/3d/Rectangle.js +3 -1
  44. package/dist/struct/3d/Segment.js +9 -7
  45. package/dist/struct/3d/Shape.js +3 -1
  46. package/dist/struct/3d/Sphere.js +1 -1
  47. package/dist/struct/3d/Triangle.js +3 -1
  48. package/dist/struct/data/ArrayList.js +11 -9
  49. package/dist/struct/data/ArrayObject.js +3 -1
  50. package/package.json +4 -3
  51. package/src/app.ts +4 -1
  52. package/src/index.ts +1 -0
  53. package/src/math/Color.ts +14 -32
  54. package/dist/src/IKanimation/Bone.d.ts +0 -9
  55. package/dist/src/IKanimation/Bone.js +0 -40
  56. package/dist/src/IKanimation/CCDSolver.d.ts +0 -37
  57. package/dist/src/IKanimation/CCDSolver.js +0 -93
  58. package/dist/src/IKanimation/Joint.d.ts +0 -3
  59. package/dist/src/IKanimation/Joint.js +0 -17
  60. package/dist/src/IKanimation/constaint/constraint.d.ts +0 -10
  61. package/dist/src/IKanimation/constaint/constraint.js +0 -25
  62. package/dist/src/IKanimation/constaint/hinge.d.ts +0 -12
  63. package/dist/src/IKanimation/constaint/hinge.js +0 -46
  64. package/dist/src/IKanimation/constaint/slider.d.ts +0 -12
  65. package/dist/src/IKanimation/constaint/slider.js +0 -44
  66. package/dist/src/IKanimation/index.d.ts +0 -0
  67. package/dist/src/IKanimation/index.js +0 -9
  68. package/dist/src/IKanimation/isolver.d.ts +0 -4
  69. package/dist/src/IKanimation/isolver.js +0 -10
  70. package/dist/src/IKanimation/skeleton.d.ts +0 -13
  71. package/dist/src/IKanimation/skeleton.js +0 -31
  72. package/dist/src/alg/common.d.ts +0 -114
  73. package/dist/src/alg/common.js +0 -302
  74. package/dist/src/alg/curve.d.ts +0 -4
  75. package/dist/src/alg/curve.js +0 -11
  76. package/dist/src/alg/delaunator.d.ts +0 -29
  77. package/dist/src/alg/delaunator.js +0 -442
  78. package/dist/src/alg/delaunay.d.ts +0 -20
  79. package/dist/src/alg/delaunay.js +0 -199
  80. package/dist/src/alg/delaunayslow.d.ts +0 -18
  81. package/dist/src/alg/delaunayslow.js +0 -140
  82. package/dist/src/alg/extrude/extrude.d.ts +0 -3
  83. package/dist/src/alg/extrude/extrude.js +0 -17
  84. package/dist/src/alg/extrude.d.ts +0 -199
  85. package/dist/src/alg/extrude.js +0 -731
  86. package/dist/src/alg/offset/index.d.ts +0 -0
  87. package/dist/src/alg/offset/index.js +0 -9
  88. package/dist/src/alg/offset.d.ts +0 -0
  89. package/dist/src/alg/offset.js +0 -472
  90. package/dist/src/alg/pointset.d.ts +0 -94
  91. package/dist/src/alg/pointset.js +0 -223
  92. package/dist/src/alg/recognition.d.ts +0 -14
  93. package/dist/src/alg/recognition.js +0 -37
  94. package/dist/src/alg/result.d.ts +0 -22
  95. package/dist/src/alg/result.js +0 -2
  96. package/dist/src/alg/segmentset.d.ts +0 -11
  97. package/dist/src/alg/segmentset.js +0 -45
  98. package/dist/src/alg/sort.d.ts +0 -2
  99. package/dist/src/alg/sort.js +0 -14
  100. package/dist/src/alg/split.d.ts +0 -8
  101. package/dist/src/alg/split.js +0 -10
  102. package/dist/src/alg/trianglution.d.ts +0 -20
  103. package/dist/src/alg/trianglution.js +0 -77
  104. package/dist/src/alg/vol.d.ts +0 -6
  105. package/dist/src/alg/vol.js +0 -18
  106. package/dist/src/alg/voronoi.d.ts +0 -31
  107. package/dist/src/alg/voronoi.js +0 -418
  108. package/dist/src/app.d.ts +0 -1
  109. package/dist/src/app.js +0 -245
  110. package/dist/src/basic/distance.d.ts +0 -12
  111. package/dist/src/basic/distance.js +0 -42
  112. package/dist/src/csg/bsp.d.ts +0 -9
  113. package/dist/src/csg/bsp.js +0 -22
  114. package/dist/src/csg/node.d.ts +0 -12
  115. package/dist/src/csg/node.js +0 -75
  116. package/dist/src/csg/polygon.d.ts +0 -43
  117. package/dist/src/csg/polygon.js +0 -161
  118. package/dist/src/diamondMaterialShader.d.ts +0 -92
  119. package/dist/src/diamondMaterialShader.js +0 -118
  120. package/dist/src/effect/breath-light.d.ts +0 -4
  121. package/dist/src/effect/breath-light.js +0 -39
  122. package/dist/src/extends/geometryaid.d.ts +0 -28
  123. package/dist/src/extends/geometryaid.js +0 -80
  124. package/dist/src/extends/split.d.ts +0 -3
  125. package/dist/src/extends/split.js +0 -13
  126. package/dist/src/glview.d.ts +0 -112
  127. package/dist/src/glview.js +0 -564
  128. package/dist/src/index.d.ts +0 -36
  129. package/dist/src/index.js +0 -54
  130. package/dist/src/math/Euler.d.ts +0 -47
  131. package/dist/src/math/Euler.js +0 -245
  132. package/dist/src/math/HVec3.d.ts +0 -44
  133. package/dist/src/math/HVec3.js +0 -195
  134. package/dist/src/math/Mat3.d.ts +0 -29
  135. package/dist/src/math/Mat3.js +0 -244
  136. package/dist/src/math/Mat4.d.ts +0 -85
  137. package/dist/src/math/Mat4.js +0 -791
  138. package/dist/src/math/Math.d.ts +0 -130
  139. package/dist/src/math/Math.js +0 -198
  140. package/dist/src/math/Quat.d.ts +0 -83
  141. package/dist/src/math/Quat.js +0 -440
  142. package/dist/src/math/Vec.d.ts +0 -7
  143. package/dist/src/math/Vec.js +0 -43
  144. package/dist/src/math/Vec2.d.ts +0 -68
  145. package/dist/src/math/Vec2.js +0 -347
  146. package/dist/src/math/Vec3.d.ts +0 -232
  147. package/dist/src/math/Vec3.js +0 -1089
  148. package/dist/src/math/Vec4.d.ts +0 -81
  149. package/dist/src/math/Vec4.js +0 -494
  150. package/dist/src/math/vector.d.ts +0 -114
  151. package/dist/src/math/vector.js +0 -373
  152. package/dist/src/render/buffer-attribute.d.ts +0 -100
  153. package/dist/src/render/buffer-attribute.js +0 -340
  154. package/dist/src/render/eventhandler.d.ts +0 -78
  155. package/dist/src/render/eventhandler.js +0 -189
  156. package/dist/src/render/geometry.d.ts +0 -89
  157. package/dist/src/render/geometry.js +0 -775
  158. package/dist/src/render/mesh.d.ts +0 -25
  159. package/dist/src/render/mesh.js +0 -82
  160. package/dist/src/render/thing.d.ts +0 -34
  161. package/dist/src/render/thing.js +0 -196
  162. package/dist/src/render/types.d.ts +0 -2
  163. package/dist/src/render/types.js +0 -8
  164. package/dist/src/robust/plane.d.ts +0 -7
  165. package/dist/src/robust/plane.js +0 -17
  166. package/dist/src/robust/vec.d.ts +0 -15
  167. package/dist/src/robust/vec.js +0 -71
  168. package/dist/src/shape/arc.d.ts +0 -2
  169. package/dist/src/shape/arc.js +0 -14
  170. package/dist/src/struct/3d/Box.d.ts +0 -23
  171. package/dist/src/struct/3d/Box.js +0 -109
  172. package/dist/src/struct/3d/Capsule.d.ts +0 -12
  173. package/dist/src/struct/3d/Capsule.js +0 -36
  174. package/dist/src/struct/3d/Circle.d.ts +0 -34
  175. package/dist/src/struct/3d/Circle.js +0 -80
  176. package/dist/src/struct/3d/Disk.d.ts +0 -10
  177. package/dist/src/struct/3d/Disk.js +0 -22
  178. package/dist/src/struct/3d/Frustum.d.ts +0 -35
  179. package/dist/src/struct/3d/Frustum.js +0 -159
  180. package/dist/src/struct/3d/Line.d.ts +0 -40
  181. package/dist/src/struct/3d/Line.js +0 -339
  182. package/dist/src/struct/3d/Path.d.ts +0 -75
  183. package/dist/src/struct/3d/Path.js +0 -308
  184. package/dist/src/struct/3d/Plane.d.ts +0 -74
  185. package/dist/src/struct/3d/Plane.js +0 -295
  186. package/dist/src/struct/3d/Point.d.ts +0 -4
  187. package/dist/src/struct/3d/Point.js +0 -30
  188. package/dist/src/struct/3d/Polygon.d.ts +0 -8
  189. package/dist/src/struct/3d/Polygon.js +0 -55
  190. package/dist/src/struct/3d/Polyline.d.ts +0 -25
  191. package/dist/src/struct/3d/Polyline.js +0 -109
  192. package/dist/src/struct/3d/Ray.d.ts +0 -21
  193. package/dist/src/struct/3d/Ray.js +0 -262
  194. package/dist/src/struct/3d/Rectangle.d.ts +0 -7
  195. package/dist/src/struct/3d/Rectangle.js +0 -35
  196. package/dist/src/struct/3d/Segment.d.ts +0 -32
  197. package/dist/src/struct/3d/Segment.js +0 -334
  198. package/dist/src/struct/3d/Shape.d.ts +0 -4
  199. package/dist/src/struct/3d/Shape.js +0 -27
  200. package/dist/src/struct/3d/Sphere.d.ts +0 -11
  201. package/dist/src/struct/3d/Sphere.js +0 -30
  202. package/dist/src/struct/3d/Triangle.d.ts +0 -8
  203. package/dist/src/struct/3d/Triangle.js +0 -53
  204. package/dist/src/struct/data/ArrayList.d.ts +0 -42
  205. package/dist/src/struct/data/ArrayList.js +0 -172
  206. package/dist/src/struct/data/ArrayObject.d.ts +0 -30
  207. package/dist/src/struct/data/ArrayObject.js +0 -131
  208. package/dist/src/struct/data/type.d.ts +0 -13
  209. package/dist/src/struct/data/type.js +0 -18
  210. package/dist/src/utils/array.d.ts +0 -24
  211. package/dist/src/utils/array.js +0 -89
  212. package/dist/src/utils/types.d.ts +0 -24
  213. package/dist/src/utils/types.js +0 -20
  214. package/dist/src-gis/app.d.ts +0 -1
  215. package/dist/src-gis/app.js +0 -4
  216. package/dist/src-gis/core/Cartographic.d.ts +0 -20
  217. package/dist/src-gis/core/Cartographic.js +0 -52
  218. package/dist/src-gis/core/EllipsoidGeodesic.d.ts +0 -14
  219. package/dist/src-gis/core/EllipsoidGeodesic.js +0 -51
  220. package/dist/src-gis/core/EllipsoidTerrainProvider.d.ts +0 -10
  221. package/dist/src-gis/core/EllipsoidTerrainProvider.js +0 -29
  222. package/dist/src-gis/core/HeightmapTerrainData.d.ts +0 -3
  223. package/dist/src-gis/core/HeightmapTerrainData.js +0 -9
  224. package/dist/src-gis/core/Rectangle.d.ts +0 -45
  225. package/dist/src-gis/core/Rectangle.js +0 -127
  226. package/dist/src-gis/core/TaskProcessor.d.ts +0 -35
  227. package/dist/src-gis/core/TaskProcessor.js +0 -183
  228. package/dist/src-gis/gis.d.ts +0 -5
  229. package/dist/src-gis/gis.js +0 -12
  230. package/dist/src-gis/globe.d.ts +0 -12
  231. package/dist/src-gis/globe.js +0 -61
  232. package/dist/src-gis/math/Cartographic.d.ts +0 -8
  233. package/dist/src-gis/math/Cartographic.js +0 -26
  234. package/dist/src-gis/math/GVec3.d.ts +0 -12
  235. package/dist/src-gis/math/GVec3.js +0 -69
  236. package/dist/src-gis/math/ellipsoid.d.ts +0 -8
  237. package/dist/src-gis/math/ellipsoid.js +0 -14
  238. package/dist/src-gis/provider/DcTerrainProvider.d.ts +0 -15
  239. package/dist/src-gis/provider/DcTerrainProvider.js +0 -19
  240. package/dist/src-gis/provider/TerrainProvider.d.ts +0 -3
  241. package/dist/src-gis/provider/TerrainProvider.js +0 -17
  242. package/dist/src-gis/scene/DcImageryProvider.d.ts +0 -6
  243. package/dist/src-gis/scene/DcImageryProvider.js +0 -35
  244. package/dist/src-gis/scene/GeographicTilingScheme.d.ts +0 -21
  245. package/dist/src-gis/scene/GeographicTilingScheme.js +0 -46
  246. package/dist/src-gis/scene/Globe.d.ts +0 -34
  247. package/dist/src-gis/scene/Globe.js +0 -62
  248. package/dist/src-gis/scene/GlobeSurfaceShaderSet.d.ts +0 -6
  249. package/dist/src-gis/scene/GlobeSurfaceShaderSet.js +0 -11
  250. package/dist/src-gis/scene/GlobeSurfaceTileProvider.d.ts +0 -21
  251. package/dist/src-gis/scene/GlobeSurfaceTileProvider.js +0 -15
  252. package/dist/src-gis/scene/ImageryLayerCollection.d.ts +0 -21
  253. package/dist/src-gis/scene/ImageryLayerCollection.js +0 -87
  254. package/dist/src-gis/scene/ImageryProvider.d.ts +0 -4
  255. package/dist/src-gis/scene/ImageryProvider.js +0 -28
  256. package/dist/src-gis/scene/QuadtreeTile.d.ts +0 -48
  257. package/dist/src-gis/scene/QuadtreeTile.js +0 -137
  258. package/dist/src-gis/scene/UrlTemplateImageryProvider.d.ts +0 -9
  259. package/dist/src-gis/scene/UrlTemplateImageryProvider.js +0 -29
  260. package/dist/src-gis/scene/quadtree_primitive.d.ts +0 -14
  261. 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,3 +0,0 @@
1
- export declare class Joint {
2
- constructor();
3
- }
@@ -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,10 +0,0 @@
1
- import { Mat4 } from "../../math/Mat4";
2
- export declare enum ISpace {
3
- Globe = 0,
4
- Local = 1
5
- }
6
- export declare abstract class TypedConstraint {
7
- space: ISpace;
8
- matrix: Mat4;
9
- constructor();
10
- }
@@ -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,9 +0,0 @@
1
- "use strict";
2
- /*
3
- * @Description :
4
- * @Author : 赵耀圣
5
- * @QQ : 549184003
6
- * @Date : 2021-03-23 17:05:30
7
- * @LastEditTime : 2021-03-23 17:05:31
8
- * @FilePath : \cga.js\src\IKanimation\index.ts
9
- */
@@ -1,4 +0,0 @@
1
- export interface ISolver {
2
- updateTarget: Function;
3
- solveIK: Function;
4
- }
@@ -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,13 +0,0 @@
1
- import { Bone } from "./Bone";
2
- /**
3
- * @description : 骨架
4
- * @param {*}
5
- * @return {*}
6
- * @example :
7
- */
8
- export declare class Skeleton {
9
- bones: Bone[][];
10
- rootBone: Bone | undefined;
11
- constructor();
12
- get boneNum(): number;
13
- }
@@ -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;
@@ -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;