@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
@@ -35,7 +35,7 @@ var Circle = /** @class */ (function () {
35
35
  Circle.prototype.arc1 = function (fixp0, fixp1, movep, normal) {
36
36
  this.setFrom3Points(fixp0, fixp1, movep);
37
37
  this.startAngle = 0;
38
- this.endAngle = common_1.angle(fixp0.clone().sub(this.center).normalize(), fixp1.clone().sub(this.center).normalize(), this.normal || normal);
38
+ this.endAngle = (0, common_1.angle)(fixp0.clone().sub(this.center).normalize(), fixp1.clone().sub(this.center).normalize(), this.normal || normal);
39
39
  };
40
40
  /**
41
41
  * 全两个点确定半径,后面点确定 弧度 ,只需要检测鼠标移动时鼠标是否跨过第一条半径即可确定顺逆时针
@@ -49,7 +49,7 @@ var Circle = /** @class */ (function () {
49
49
  this.center.copy(center);
50
50
  var v2 = movep.clone().sub(center);
51
51
  var v1 = fixp1.clone().sub(center);
52
- var jd = common_1.angle(v1, v2);
52
+ var jd = (0, common_1.angle)(v1, v2);
53
53
  };
54
54
  Circle.prototype.setFrom3Points = function (p0, p1, p2, normal) {
55
55
  // if (pointsCollinear(p0, p1, p2))
@@ -5,7 +5,7 @@ var Vec3_1 = require("../../math/Vec3");
5
5
  var Disk = /** @class */ (function () {
6
6
  function Disk(center, radius, normal) {
7
7
  if (normal === void 0) { normal = Vec3_1.Vec3.UnitY; }
8
- this.center = center || Vec3_1.v3();
8
+ this.center = center || (0, Vec3_1.v3)();
9
9
  this.normal = normal;
10
10
  this.radius = radius || 0;
11
11
  this.w = this.normal.dot(center);
@@ -8,8 +8,8 @@ var _v1 = new Vec3_1.Vec3;
8
8
  ;
9
9
  var Line = /** @class */ (function () {
10
10
  function Line(origin, end) {
11
- if (origin === void 0) { origin = Vec3_1.v3(); }
12
- if (end === void 0) { end = Vec3_1.v3(); }
11
+ if (origin === void 0) { origin = (0, Vec3_1.v3)(); }
12
+ if (end === void 0) { end = (0, Vec3_1.v3)(); }
13
13
  this.origin = origin;
14
14
  this.end = end;
15
15
  this.direction = this.end
@@ -192,10 +192,10 @@ var Line = /** @class */ (function () {
192
192
  if (robust === void 0) { robust = false; }
193
193
  if (numInputs === 1) {
194
194
  if (Math.abs(v[0][0]) > Math.abs(v[0][1])) {
195
- v[1] = Vec3_1.v3(-v[0].z, 0, +v[0].x);
195
+ v[1] = (0, Vec3_1.v3)(-v[0].z, 0, +v[0].x);
196
196
  }
197
197
  else {
198
- v[1] = Vec3_1.v3(0, +v[0].z, -v[0].y);
198
+ v[1] = (0, Vec3_1.v3)(0, +v[0].z, -v[0].y);
199
199
  }
200
200
  ;
201
201
  numInputs = 2;
@@ -10,10 +10,12 @@ var __extends = (this && this.__extends) || (function () {
10
10
  var extendStatics = function (d, b) {
11
11
  extendStatics = Object.setPrototypeOf ||
12
12
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
13
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
13
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
14
14
  return extendStatics(d, b);
15
15
  };
16
16
  return function (d, b) {
17
+ if (typeof b !== "function" && b !== null)
18
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
17
19
  extendStatics(d, b);
18
20
  function __() { this.constructor = d; }
19
21
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -73,15 +75,15 @@ var Path = /** @class */ (function (_super) {
73
75
  var normal = new Vec3_1.Vec3();
74
76
  normal.crossVecs(d1, d2).normalize();
75
77
  this.get(i).normal = normal;
76
- var bdir = Vec3_1.v3().addVecs(d1, d2).normalize();
78
+ var bdir = (0, Vec3_1.v3)().addVecs(d1, d2).normalize();
77
79
  this.get(i).bdirection = bdir;
78
- this.get(i).bnormal = Vec3_1.v3().crossVecs(bdir, normal).normalize();
80
+ this.get(i).bnormal = (0, Vec3_1.v3)().crossVecs(bdir, normal).normalize();
79
81
  // }
80
82
  }
81
83
  if (!this._closed) { //不闭合路径 最后一个点没有
82
- this.get(-1).bdirection = Vec3_1.v3();
83
- this.get(-1).normal = Vec3_1.v3();
84
- this.get(-1).bnormal = Vec3_1.v3();
84
+ this.get(-1).bdirection = (0, Vec3_1.v3)();
85
+ this.get(-1).normal = (0, Vec3_1.v3)();
86
+ this.get(-1).bnormal = (0, Vec3_1.v3)();
85
87
  }
86
88
  if (!this._closed) {
87
89
  // 不闭合的情况下怎么样去计算端点的up和normal
@@ -116,10 +118,10 @@ var Path = /** @class */ (function (_super) {
116
118
  configurable: true
117
119
  });
118
120
  Path.prototype.applyMat4 = function (mat4) {
119
- pointset_1.applyMat4(this._array, mat4);
121
+ (0, pointset_1.applyMat4)(this._array, mat4);
120
122
  };
121
123
  Path.prototype.scale = function (x, y, z) {
122
- common_1.scale(this._array, Vec3_1.v3(x, y, z), true);
124
+ (0, common_1.scale)(this._array, (0, Vec3_1.v3)(x, y, z), true);
123
125
  };
124
126
  /**
125
127
  * 截取一段从from到to的path
@@ -157,7 +159,7 @@ var Path = /** @class */ (function (_super) {
157
159
  Path.prototype.getPointByDistance = function (arg_distance, left, right) {
158
160
  if (left === void 0) { left = 0; }
159
161
  if (right === void 0) { right = this.length - 1; }
160
- var distance = Math_1.clamp(arg_distance, 0, this.get(-1).tlen);
162
+ var distance = (0, Math_1.clamp)(arg_distance, 0, this.get(-1).tlen);
161
163
  if (distance !== arg_distance)
162
164
  return null;
163
165
  if (right - left === 1) {
@@ -186,7 +188,7 @@ var Path = /** @class */ (function (_super) {
186
188
  Path.prototype.getPointByDistancePure = function (arg_distance, left, right) {
187
189
  if (left === void 0) { left = 0; }
188
190
  if (right === void 0) { right = this.length - 1; }
189
- var distance = Math_1.clamp(arg_distance, 0, this.get(-1).tlen);
191
+ var distance = (0, Math_1.clamp)(arg_distance, 0, this.get(-1).tlen);
190
192
  if (distance !== arg_distance)
191
193
  return null;
192
194
  if (right - left === 1) {
@@ -294,7 +296,7 @@ var Path = /** @class */ (function (_super) {
294
296
  res.push(mileages);
295
297
  }
296
298
  if (normalize) {
297
- var tl = types_1.isDefined(totalMileage) ? totalMileage : this.totalMileages(ps);
299
+ var tl = (0, types_1.isDefined)(totalMileage) ? totalMileage : this.totalMileages(ps);
298
300
  for (var i = 0, len = ps.length; i < len; i++) {
299
301
  res[i] /= tl;
300
302
  }
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
- var __spreadArrays = (this && this.__spreadArrays) || function () {
3
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
5
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
6
- r[k] = a[j];
7
- return r;
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
8
10
  };
9
11
  Object.defineProperty(exports, "__esModule", { value: true });
10
12
  exports.Plane = void 0;
@@ -68,9 +70,9 @@ var Plane = /** @class */ (function () {
68
70
  */
69
71
  Plane.prototype.frontback = function (point) {
70
72
  var value = this.normal.dot(point);
71
- if (Math_1.approximateEqual(value, 0))
73
+ if ((0, Math_1.approximateEqual)(value, 0))
72
74
  return 0;
73
- return Math_1.sign(this.normal.dot(point));
75
+ return (0, Math_1.sign)(this.normal.dot(point));
74
76
  };
75
77
  //---Distance-------------------------------------------------------------------------------
76
78
  Plane.prototype.distancePoint = function (point) {
@@ -223,8 +225,8 @@ var Plane = /** @class */ (function () {
223
225
  * @param polyVS
224
226
  */
225
227
  Plane.prototype.splitPolyVS = function (polyVS) {
226
- polyVS = __spreadArrays(polyVS);
227
- mesh_1.indexable(polyVS);
228
+ polyVS = __spreadArray([], polyVS, true);
229
+ (0, mesh_1.indexable)(polyVS);
228
230
  var jd0 = -1; //找出第一个交点
229
231
  var jdp0; //找出第一个交点
230
232
  var lastOriention = this.orientationPoint(polyVS[0]);
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -23,16 +25,16 @@ var Segment = /** @class */ (function (_super) {
23
25
  * @param {Point|Vec3} p1
24
26
  */
25
27
  function Segment(_p0, _p1) {
26
- if (_p0 === void 0) { _p0 = Vec3_1.v3(); }
27
- if (_p1 === void 0) { _p1 = Vec3_1.v3(); }
28
+ if (_p0 === void 0) { _p0 = (0, Vec3_1.v3)(); }
29
+ if (_p1 === void 0) { _p1 = (0, Vec3_1.v3)(); }
28
30
  var _this = _super.call(this) || this;
29
31
  Object.setPrototypeOf(_this, Segment.prototype);
30
- _this.push(Vec3_1.v3().copy(_p0), Vec3_1.v3().copy(_p1));
31
- _this.center = Vec3_1.v3().addVecs(_p0, _p1).multiplyScalar(0.5);
32
- _this.extentDirection = Vec3_1.v3().subVecs(_p1, _p0);
32
+ _this.push((0, Vec3_1.v3)().copy(_p0), (0, Vec3_1.v3)().copy(_p1));
33
+ _this.center = (0, Vec3_1.v3)().addVecs(_p0, _p1).multiplyScalar(0.5);
34
+ _this.extentDirection = (0, Vec3_1.v3)().subVecs(_p1, _p0);
33
35
  _this.extentSqr = _this.extentDirection.lengthSq();
34
36
  _this.extent = Math.sqrt(_this.extentSqr);
35
- _this.direction = Vec3_1.v3().copy(_this.extentDirection).normalize();
37
+ _this.direction = (0, Vec3_1.v3)().copy(_this.extentDirection).normalize();
36
38
  return _this;
37
39
  }
38
40
  Segment.prototype.set = function (p0, p1) {
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -4,7 +4,7 @@ exports.Sphere = void 0;
4
4
  var Vec3_1 = require("../../math/Vec3");
5
5
  var Sphere = /** @class */ (function () {
6
6
  function Sphere(center, radius) {
7
- if (center === void 0) { center = Vec3_1.v3(); }
7
+ if (center === void 0) { center = (0, Vec3_1.v3)(); }
8
8
  if (radius === void 0) { radius = 0; }
9
9
  this.center = center;
10
10
  this.radius = radius;
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
- var __spreadArrays = (this && this.__spreadArrays) || function () {
3
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
5
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
6
- r[k] = a[j];
7
- return r;
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
8
10
  };
9
11
  Object.defineProperty(exports, "__esModule", { value: true });
10
12
  exports.ArrayList = void 0;
@@ -83,7 +85,7 @@ var ArrayList = /** @class */ (function () {
83
85
  for (var _i = 1; _i < arguments.length; _i++) {
84
86
  value[_i - 1] = arguments[_i];
85
87
  }
86
- (_a = this._array).splice.apply(_a, __spreadArrays([i, 0], value));
88
+ (_a = this._array).splice.apply(_a, __spreadArray([i, 0], value, false));
87
89
  };
88
90
  ArrayList.prototype.splice = function (start, deleteCount) {
89
91
  var _a;
@@ -91,7 +93,7 @@ var ArrayList = /** @class */ (function () {
91
93
  for (var _i = 2; _i < arguments.length; _i++) {
92
94
  items[_i - 2] = arguments[_i];
93
95
  }
94
- (_a = this._array).splice.apply(_a, __spreadArrays([start, deleteCount], items));
96
+ (_a = this._array).splice.apply(_a, __spreadArray([start, deleteCount], items, false));
95
97
  };
96
98
  ArrayList.prototype.get = function (index) {
97
99
  if (index < 0)
@@ -111,7 +113,7 @@ var ArrayList = /** @class */ (function () {
111
113
  * 克隆
112
114
  */
113
115
  ArrayList.prototype.clone = function () {
114
- return new this.constructor(common_1.clone(this._array));
116
+ return new this.constructor((0, common_1.clone)(this._array));
115
117
  };
116
118
  /**
117
119
  * 分类
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xort/cga",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "description": "Xtor Compute Geometry Algorithm Libary 计算几何算法库",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/app.ts CHANGED
@@ -214,6 +214,7 @@ import * as THREE from "three"
214
214
  import { diamondMaterial } from "./diamondMaterialShader";
215
215
  import { BreathLight } from "./effect/breath-light";
216
216
  import { Mat4 } from "./math/Mat4";
217
+ import { Color } from "./index";
217
218
  var tgeo = new THREE.BufferGeometry();
218
219
  tgeo.setAttribute('position', new THREE.Float32BufferAttribute(geometry.getAttribute('position').array, 3));
219
220
  tgeo.setAttribute('normal', new THREE.Float32BufferAttribute(geometry.getAttribute('normal').array, 3));
@@ -233,9 +234,11 @@ glv.add(mesh);
233
234
  // glv.renderer.setRenderTarget(renderTarget);
234
235
  // glv.render();
235
236
  // glv.renderer.setRenderTarget(null);
236
- // })
237
+ // })
237
238
 
238
239
 
240
+ const color = new Color()
241
+ debugger
239
242
 
240
243
  class LabelTexture {
241
244
  width: number;
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ export * from "./math/Mat4"
7
7
  export * from "./math/Quat"
8
8
  export * from "./math/Math"
9
9
  export * from "./math/Euler"
10
+
10
11
  export * from "./math/Color"
11
12
  //common
12
13
  export * from "./math/vector"
package/src/math/Color.ts CHANGED
@@ -1,15 +1,22 @@
1
- import { EventHandler } from "../render/eventhandler";
1
+ import { EventHandler } from "../render/eventhandler";
2
2
 
3
3
  export class Color extends EventHandler {
4
- constructor(private _r: number = 0, private _g: number = 0, private _b: number = 0, private _a: number = 1) {
4
+ _r: number =0.0;
5
+ _g: number =0.0;
6
+ _b: number =0.0;
7
+ _a: number =1.0;
8
+ constructor(r: number = 0, g: number = 0, b: number = 0, a: number = 1) {
5
9
  super();
10
+ this._r = r;
11
+ this._g = g;
12
+ this._b = b;
13
+ this._a = a;
6
14
  }
7
-
15
+
8
16
  get isColor() {
9
17
  return true;
10
18
  }
11
19
 
12
-
13
20
  get r() {
14
21
  return this._r;
15
22
  }
@@ -40,7 +47,7 @@ export class Color extends EventHandler {
40
47
  if (this._b !== value) {
41
48
  this._b = value;
42
49
  this.fire('change', 'b', this._b, value)
43
- }
50
+ }
44
51
  }
45
52
 
46
53
  get a() {
@@ -128,5 +135,5 @@ export class Color extends EventHandler {
128
135
  toJSON() {
129
136
  return this.getHex();
130
137
  }
131
-
138
+
132
139
  }
@@ -1,9 +0,0 @@
1
- import { Mat4 } from "src/math/Mat4";
2
- import { Thing } from "src/render/thing";
3
- import { TypedConstraint } from "./constaint/constraint";
4
- export declare class Bone extends Thing {
5
- children: Bone[];
6
- contraints: TypedConstraint[];
7
- matrix: Mat4;
8
- constructor();
9
- }
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.Bone = void 0;
19
- var Mat4_1 = require("src/math/Mat4");
20
- var thing_1 = require("src/render/thing");
21
- /*
22
- * @Description :
23
- * @Author : 赵耀圣
24
- * @QQ : 549184003
25
- * @Date : 2021-03-22 17:41:30
26
- * @LastEditTime : 2021-03-23 16:19:09
27
- * @FilePath : \cga.js\src\IKanimation\Bone.ts
28
- */
29
- var Bone = /** @class */ (function (_super) {
30
- __extends(Bone, _super);
31
- function Bone() {
32
- var _this = _super.call(this) || this;
33
- _this.children = [];
34
- _this.contraints = [];
35
- _this.matrix = Mat4_1.Mat4.Identity;
36
- return _this;
37
- }
38
- return Bone;
39
- }(thing_1.Thing));
40
- exports.Bone = Bone;
@@ -1,37 +0,0 @@
1
- import { Quat } from "../math/Quat";
2
- import { Vec3 } from "../math/Vec3";
3
- import { TypedConstraint } from "./constaint/constraint";
4
- import { ISolver } from "./isolver";
5
- import { Skeleton } from "./skeleton";
6
- /**
7
- * @description :
8
- * @param {*}
9
- * @return {*}
10
- * @example :
11
- */
12
- export declare class CCDSolver implements ISolver {
13
- constructor();
14
- updateTarget(): void;
15
- projectPlane(v: Vec3, normal: Vec3): Vec3;
16
- calcAngle(v1: Vec3, v2: Vec3, dir: Vec3): number;
17
- /**
18
- * @description :
19
- * @param {Vec3} target 目标点
20
- * @param {Vec3} zeroPos 关节原点
21
- * @param {Vec3} effector 末端效应点
22
- * @return {*}
23
- * @example :
24
- */
25
- solveTranslate(target: Vec3, zeroPos: Vec3, effector: Vec3): void;
26
- /**
27
- * @description :
28
- * @param {Vec3} target 目标点
29
- * @param {Vec3} zeroPos 关节原点
30
- * @param {Vec3} effector 末端效应点
31
- * @return {*}
32
- * @example :
33
- */
34
- solveRotation(target: Vec3, zeroPos: Vec3, effector: Vec3, contraints?: TypedConstraint[]): Quat;
35
- solveIK(skeleton: Skeleton, target: Vec3): void;
36
- solve(bones: any): void;
37
- }
@@ -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
- }