@xort/cga 0.0.77 → 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 +5 -5
  15. package/dist/math/Color.js +16 -10
  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 +1 -1
  51. package/src/app.ts +4 -1
  52. package/src/index.ts +1 -0
  53. package/src/math/Color.ts +13 -6
  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,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;
@@ -1,302 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.angle = exports.calcCircleFromThreePoint = exports.pointsCollinear = exports.isInOnePlane = exports.recognitionPlane = exports.projectOnPlane = exports.reverseOnPlane = exports.simplifyPointList = exports.applyMatrix4 = exports.scale = exports.rotateByUnitVectors = exports.rotate = exports.translate = exports.applyQuat = exports.boundingBox = exports.vectorCompare = exports.clone = void 0;
4
- var Vec3_1 = require("../math/Vec3");
5
- var Math_1 = require("../math/Math");
6
- var Line_1 = require("../struct/3d/Line");
7
- var Circle_1 = require("../struct/3d/Circle");
8
- var Quat_1 = require("../math/Quat");
9
- var Plane_1 = require("../struct/3d/Plane");
10
- var types_1 = require("../utils/types");
11
- var XYZSort = function (e1, e2) {
12
- if (e1.x !== e2.x)
13
- return e1.x - e2.x;
14
- else if (e1.y !== e2.y)
15
- return e1.y - e2.y;
16
- else
17
- return e1.z - e2.z;
18
- };
19
- var _vector = (0, Vec3_1.v3)();
20
- /**
21
- * 数组深度复制
22
- * @param {Array} array
23
- */
24
- function clone(array) {
25
- if (!(0, types_1.isDefined)(array))
26
- return array;
27
- if (Array.isArray(array)) {
28
- var result = new Array();
29
- for (var i = 0; i < array.length; i++) {
30
- result[i] = clone(array[i]);
31
- }
32
- return result;
33
- }
34
- else {
35
- if (array.clone)
36
- return array.clone();
37
- else
38
- return array;
39
- }
40
- }
41
- exports.clone = clone;
42
- /**
43
- * 点排序函数 xyz 有序排序回调
44
- * @param {Vector*} a
45
- * @param {Vector*} b
46
- */
47
- function vectorCompare(a, b) {
48
- if (a.x === b.x) {
49
- if (a.z !== undefined && a.y === b.y)
50
- return a.z - b.z;
51
- else
52
- return a.y - b.y;
53
- }
54
- else
55
- return a.x - b.x;
56
- }
57
- exports.vectorCompare = vectorCompare;
58
- /**
59
- * 计算包围盒
60
- * @param {*} points 点集
61
- * @returns {Array[min,max]} 返回最小最大值
62
- */
63
- function boundingBox(points) {
64
- var min = new Vec3_1.Vec3(+Infinity, +Infinity, +Infinity);
65
- var max = new Vec3_1.Vec3(-Infinity, -Infinity, -Infinity);
66
- for (var i = 0; i < points.length; i++) {
67
- min.min(points[i]);
68
- max.max(points[i]);
69
- }
70
- return [min, max];
71
- }
72
- exports.boundingBox = boundingBox;
73
- /**
74
- *
75
- * @param {*} points
76
- * @param {*} Quat
77
- * @param {Boolean} ref 是否是引用
78
- */
79
- function applyQuat(points, Quat, ref) {
80
- if (ref === void 0) { ref = true; }
81
- if (ref) {
82
- points.flat(Infinity).forEach(function (point) {
83
- point.applyQuat(Quat);
84
- });
85
- return points;
86
- }
87
- return applyQuat(clone(points), Quat);
88
- }
89
- exports.applyQuat = applyQuat;
90
- /**
91
- * 平移
92
- * @param {*} points
93
- * @param {*} distance
94
- * @param {*} ref
95
- */
96
- function translate(points, distance, ref) {
97
- if (ref === void 0) { ref = true; }
98
- if (ref) {
99
- points.flat(Infinity).forEach(function (point) {
100
- point.add(distance);
101
- });
102
- return points;
103
- }
104
- return translate(clone(points), distance);
105
- }
106
- exports.translate = translate;
107
- /**
108
- * 旋转
109
- * @param {*} points
110
- * @param {*} axis
111
- * @param {*} angle
112
- * @param {*} ref
113
- */
114
- function rotate(points, axis, angle, ref) {
115
- if (ref === void 0) { ref = true; }
116
- return applyQuat(points, new Quat_1.Quat().setFromAxisAngle(axis, angle), ref);
117
- }
118
- exports.rotate = rotate;
119
- /**
120
- * 两个向量之间存在的旋转量来旋转点集
121
- * @param {*} points
122
- * @param {*} axis
123
- * @param {*} angle
124
- * @param {*} ref
125
- */
126
- function rotateByUnitVectors(points, vFrom, vTo, ref) {
127
- if (ref === void 0) { ref = true; }
128
- return applyQuat(points, new Quat_1.Quat().setFromUnitVecs(vFrom, vTo), ref);
129
- }
130
- exports.rotateByUnitVectors = rotateByUnitVectors;
131
- /**
132
- * 缩放
133
- * @param {*} points
134
- * @param {*} axis
135
- * @param {*} angle
136
- * @param {*} ref
137
- */
138
- function scale(points, _scale, ref) {
139
- if (ref === void 0) { ref = true; }
140
- if (ref) {
141
- points.flat(Infinity).forEach(function (point) {
142
- point.multiply(_scale);
143
- });
144
- return points;
145
- }
146
- return scale(clone(points), _scale);
147
- }
148
- exports.scale = scale;
149
- /**
150
- * 响应矩阵
151
- * @param {*} points
152
- * @param {*} axis
153
- * @param {*} angle
154
- * @param {*} ref
155
- */
156
- function applyMatrix4(points, matrix, ref) {
157
- if (ref === void 0) { ref = true; }
158
- if (ref) {
159
- points.flat(Infinity).forEach(function (point) {
160
- point.applyMatrix4(matrix);
161
- });
162
- return points;
163
- }
164
- return applyMatrix4(clone(points), matrix);
165
- }
166
- exports.applyMatrix4 = applyMatrix4;
167
- /**
168
- * 简化点集数组,折线,路径
169
- * @param {*} points 点集数组,折线,路径 ,继承Array
170
- * @param {*} maxDistance 简化最大距离
171
- * @param {*} maxAngle 简化最大角度
172
- */
173
- function simplifyPointList(points, maxDistance, maxAngle) {
174
- if (maxDistance === void 0) { maxDistance = 0.1; }
175
- if (maxAngle === void 0) { maxAngle = Math.PI / 180 * 5; }
176
- for (var i = 0; i < points.length; i++) {
177
- // 删除小距离
178
- var P = points[i];
179
- var nextP = points[i + 1];
180
- if (P.distanceTo(nextP) < maxDistance) {
181
- if (i === 0)
182
- points.remove(i + 1, 1);
183
- else if (i === points.length - 2)
184
- points.splice(i, 1);
185
- else {
186
- points.splice(i, 2, P.clone().add(nextP).multiplyScalar(0.5));
187
- }
188
- i--;
189
- }
190
- }
191
- for (var i = 1; i < points.length - 1; i++) {
192
- // 删除小小角度
193
- var preP = points[i - 1];
194
- var P = points[i];
195
- var nextP = points[i + 1];
196
- if (Math.acos(P.clone().sub(preP).normalize().dot(nextP.clone().sub(P).normalize())) < maxAngle) {
197
- points.splice(i, 1);
198
- i--;
199
- }
200
- }
201
- return points;
202
- }
203
- exports.simplifyPointList = simplifyPointList;
204
- /**
205
- * 以某个平面生成对称镜像
206
- * @param {*} points 点集
207
- * @param {*} plane 对称镜像平面
208
- */
209
- function reverseOnPlane(points, plane) {
210
- }
211
- exports.reverseOnPlane = reverseOnPlane;
212
- /**
213
- * 投影到平面
214
- * @param {*} points 点集
215
- * @param {*} plane 投影平面
216
- * @param {*} projectDirect 默认是法线的方向
217
- */
218
- function projectOnPlane(points, plane, projectDirect) {
219
- return points;
220
- }
221
- exports.projectOnPlane = projectOnPlane;
222
- /**
223
- * 计算共面点集所在的平面
224
- * @param {Array<Vec3|Point>} points
225
- */
226
- function recognitionPlane(points) {
227
- points.sort(vectorCompare);
228
- var line = new Line_1.Line(points[0], points.get(-1));
229
- var maxDistance = -Infinity;
230
- var ipos = -1;
231
- for (var i = 1; i < points.length - 1; i++) {
232
- var pt = points[i];
233
- var distance = line.distancePoint(pt).distance;
234
- if (distance > maxDistance) {
235
- maxDistance = distance;
236
- ipos = i;
237
- }
238
- }
239
- var plane = new Plane_1.Plane();
240
- plane.setFromThreePoint(points[0], points.get(-1), points[ipos]);
241
- return plane;
242
- }
243
- exports.recognitionPlane = recognitionPlane;
244
- /**
245
- * 判断所有点是否在同一个平面
246
- * @param {Array<Vec3|Point>} points
247
- * @param {*} precision
248
- * @returns {Boolean|Plane} 如果在同一个平面返回所在平面,否则返回false
249
- */
250
- function isInOnePlane(points, precision) {
251
- if (precision === void 0) { precision = Math_1.delta4; }
252
- var plane = recognitionPlane(points);
253
- for (var i = 0; i < points.length; i++) {
254
- var pt = points[i];
255
- if (plane.distancePoint(pt) >= precision)
256
- return false;
257
- }
258
- return plane;
259
- }
260
- exports.isInOnePlane = isInOnePlane;
261
- /**
262
- * 判断多边是否共线:
263
- * 考虑情况点之间的距离应该大于最小容忍值
264
- * @param {...Vec3[]} ps
265
- */
266
- function pointsCollinear() {
267
- var ps = [];
268
- for (var _i = 0; _i < arguments.length; _i++) {
269
- ps[_i] = arguments[_i];
270
- }
271
- ps.sort(XYZSort);
272
- var sedir = ps[ps.length - 1].clone().sub(ps[0]);
273
- var selen = ps[ps.length - 1].distanceTo(ps[0]);
274
- for (var i = 1; i < ps.length - 1; i++) {
275
- var ilens = ps[i].distanceTo(ps[0]);
276
- var ilene = ps[i].distanceTo(ps[ps.length - 1]);
277
- if (ilens < ilene) {
278
- if (Math.abs(ps[i].clone().sub(ps[0]).dot(sedir) - selen * ilens) > Math_1.delta4)
279
- return false;
280
- }
281
- else {
282
- if (Math.abs(ps[i].clone().sub(ps[ps.length - 1]).dot(sedir) - selen * ilene) > Math_1.delta4)
283
- return false;
284
- }
285
- }
286
- return true;
287
- }
288
- exports.pointsCollinear = pointsCollinear;
289
- /**
290
- * 三点计算圆
291
- * @param p0
292
- * @param p1
293
- * @param p2
294
- */
295
- function calcCircleFromThreePoint(p0, p1, p2) {
296
- return new Circle_1.Circle().setFrom3Points(p0, p1, p2);
297
- }
298
- exports.calcCircleFromThreePoint = calcCircleFromThreePoint;
299
- function angle(v0, v1, normal) {
300
- return v0.angleTo(v1, normal);
301
- }
302
- exports.angle = angle;
@@ -1,4 +0,0 @@
1
- export declare class Curve {
2
- constructor();
3
- static cutmull(): void;
4
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Curve = void 0;
4
- var Curve = /** @class */ (function () {
5
- function Curve() {
6
- }
7
- Curve.cutmull = function () {
8
- };
9
- return Curve;
10
- }());
11
- exports.Curve = Curve;