@predy-js/math 0.1.91-beta.2 → 0.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './mat3';
2
2
  export * from './mat4';
3
3
  export * from './vec3';
4
+ export * from './vec4';
4
5
  export * from './vec';
5
6
  export * from './quat';
package/dist/index.js CHANGED
@@ -853,6 +853,13 @@ function vec3RotateByQuat(out, a, quat) {
853
853
  return out;
854
854
  }
855
855
 
856
+ function vec4Create(v) {
857
+ if (v) {
858
+ return [v[0], v[1], v[2], v[3]];
859
+ }
860
+ return [0, 0, 0, 0];
861
+ }
862
+
856
863
  const d2r = Math.PI / 180;
857
864
  const cos = Math.cos;
858
865
  const sin = Math.sin;
@@ -965,6 +972,7 @@ exports.vec3MulVec3 = vec3MulVec3;
965
972
  exports.vec3RotateByMat4 = vec3RotateByMat4;
966
973
  exports.vec3RotateByQuat = vec3RotateByQuat;
967
974
  exports.vec3TranslateByMat4 = vec3TranslateByMat4;
975
+ exports.vec4Create = vec4Create;
968
976
  exports.vecAdd = vecAdd;
969
977
  exports.vecAddCombine = vecAddCombine;
970
978
  exports.vecAssign = vecAssign;
package/dist/index.mjs CHANGED
@@ -849,6 +849,13 @@ function vec3RotateByQuat(out, a, quat) {
849
849
  return out;
850
850
  }
851
851
 
852
+ function vec4Create(v) {
853
+ if (v) {
854
+ return [v[0], v[1], v[2], v[3]];
855
+ }
856
+ return [0, 0, 0, 0];
857
+ }
858
+
852
859
  const d2r = Math.PI / 180;
853
860
  const cos = Math.cos;
854
861
  const sin = Math.sin;
@@ -916,4 +923,4 @@ function quatStar(out, quat) {
916
923
  return out;
917
924
  }
918
925
 
919
- export { NumberEpsilon, clamp, ensureVec3, getMat4TR, getMat4TRS, invertMat4, isZeroVec, mat3FromQuat, mat3FromRotation, mat3FromRotationZ, mat3MulMat3, mat3NormalFromMat4, mat3Rotate, mat3Scale, mat3Translate, mat3create, mat4Clone, mat4Determinate, mat4create, mat4fromRotationTranslationScale, mat4identity, mat4invert, mat4multiply, mat4perspective, mat4rotate, mat4scale, mat4translate, quatCreate, quatEquals, quatFromRotation, quatMultiply, quatStar, rotateVec2, rotationFromMat3, vec2TransformByMat3, vec3AddVec3, vec3Create, vec3Cross, vec3MulMat3, vec3MulMat4, vec3MulNum, vec3MulVec3, vec3RotateByMat4, vec3RotateByQuat, vec3TranslateByMat4, vecAdd, vecAddCombine, vecAssign, vecDot, vecFill, vecMinus, vecMulCombine, vecMulScalar, vecNormalize, vecSquareDistance };
926
+ export { NumberEpsilon, clamp, ensureVec3, getMat4TR, getMat4TRS, invertMat4, isZeroVec, mat3FromQuat, mat3FromRotation, mat3FromRotationZ, mat3MulMat3, mat3NormalFromMat4, mat3Rotate, mat3Scale, mat3Translate, mat3create, mat4Clone, mat4Determinate, mat4create, mat4fromRotationTranslationScale, mat4identity, mat4invert, mat4multiply, mat4perspective, mat4rotate, mat4scale, mat4translate, quatCreate, quatEquals, quatFromRotation, quatMultiply, quatStar, rotateVec2, rotationFromMat3, vec2TransformByMat3, vec3AddVec3, vec3Create, vec3Cross, vec3MulMat3, vec3MulMat4, vec3MulNum, vec3MulVec3, vec3RotateByMat4, vec3RotateByQuat, vec3TranslateByMat4, vec4Create, vecAdd, vecAddCombine, vecAssign, vecDot, vecFill, vecMinus, vecMulCombine, vecMulScalar, vecNormalize, vecSquareDistance };
package/dist/vec4.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import type { vec4 } from '@predy-js/render-interface';
2
+ export declare function vec4Create(v: vec4): vec4;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@predy-js/math",
3
- "version": "0.1.91-beta.2",
3
+ "version": "0.2.0-beta.1",
4
4
  "description": "Mars JSON Specification",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "prepublishOnly": "npm run build"
29
29
  },
30
30
  "devDependencies": {
31
- "@predy-js/render-interface": "0.1.91-beta.2",
31
+ "@predy-js/render-interface": "0.2.0-beta.1",
32
32
  "@commitlint/cli": "^13.2.1",
33
33
  "@commitlint/config-conventional": "^13.2.0",
34
34
  "@rollup/plugin-commonjs": "^21.0.3",