@predy-js/math 0.3.0-beta.73 → 0.3.0-beta.74

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -782,9 +782,9 @@ function getMat4Transform(te) {
782
782
  // create vec2
783
783
  function vec2Create(v2) {
784
784
  if (v2) {
785
- return [v2[0], v2[1]];
785
+ return new Float32Array([v2[0], v2[1]]);
786
786
  }
787
- return [0, 0];
787
+ return new Float32Array([0, 0]);
788
788
  }
789
789
  // vec2 add vec2
790
790
  function vec2AddVec2(out, a, b) {
@@ -947,9 +947,9 @@ function clamp(v, min, max) {
947
947
  const r2d = 180 / Math.PI;
948
948
  function vec3Create(v) {
949
949
  if (v) {
950
- return [v[0], v[1], v[2]];
950
+ return new Float32Array([v[0], v[1], v[2]]);
951
951
  }
952
- return [0, 0, 0];
952
+ return new Float32Array([0, 0, 0]);
953
953
  }
954
954
  function vec3MulVec3(out, a, b) {
955
955
  out[0] = a[0] * b[0];
@@ -1053,9 +1053,9 @@ function vec3RotateByQuat(out, a, quat) {
1053
1053
 
1054
1054
  function vec4Create(v) {
1055
1055
  if (v) {
1056
- return [v[0], v[1], v[2], v[3]];
1056
+ return new Float32Array([v[0], v[1], v[2], v[3]]);
1057
1057
  }
1058
- return [0, 0, 0, 0];
1058
+ return new Float32Array([0, 0, 0, 0]);
1059
1059
  }
1060
1060
 
1061
1061
  const d2r = Math.PI / 180;
package/dist/index.mjs CHANGED
@@ -778,9 +778,9 @@ function getMat4Transform(te) {
778
778
  // create vec2
779
779
  function vec2Create(v2) {
780
780
  if (v2) {
781
- return [v2[0], v2[1]];
781
+ return new Float32Array([v2[0], v2[1]]);
782
782
  }
783
- return [0, 0];
783
+ return new Float32Array([0, 0]);
784
784
  }
785
785
  // vec2 add vec2
786
786
  function vec2AddVec2(out, a, b) {
@@ -943,9 +943,9 @@ function clamp(v, min, max) {
943
943
  const r2d = 180 / Math.PI;
944
944
  function vec3Create(v) {
945
945
  if (v) {
946
- return [v[0], v[1], v[2]];
946
+ return new Float32Array([v[0], v[1], v[2]]);
947
947
  }
948
- return [0, 0, 0];
948
+ return new Float32Array([0, 0, 0]);
949
949
  }
950
950
  function vec3MulVec3(out, a, b) {
951
951
  out[0] = a[0] * b[0];
@@ -1049,9 +1049,9 @@ function vec3RotateByQuat(out, a, quat) {
1049
1049
 
1050
1050
  function vec4Create(v) {
1051
1051
  if (v) {
1052
- return [v[0], v[1], v[2], v[3]];
1052
+ return new Float32Array([v[0], v[1], v[2], v[3]]);
1053
1053
  }
1054
- return [0, 0, 0, 0];
1054
+ return new Float32Array([0, 0, 0, 0]);
1055
1055
  }
1056
1056
 
1057
1057
  const d2r = Math.PI / 180;
package/dist/vec2.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { vec2, mat3 } from '@predy-js/render-interface';
2
- export declare function vec2Create(v2?: vec2): number[];
2
+ export declare function vec2Create(v2?: vec2): any;
3
3
  export declare function vec2AddVec2(out: vec2, a: vec2, b: vec2): vec2;
4
4
  export declare function vec2SubVec2(out: vec2, a: vec2, b: vec2): vec2;
5
5
  export declare function vec2MulVec2(out: vec2, a: vec2, b: vec2): vec2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@predy-js/math",
3
- "version": "0.3.0-beta.73",
3
+ "version": "0.3.0-beta.74",
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.3.0-beta.73",
31
+ "@predy-js/render-interface": "0.3.0-beta.74",
32
32
  "@commitlint/cli": "^13.2.1",
33
33
  "@commitlint/config-conventional": "^13.2.0",
34
34
  "@rollup/plugin-commonjs": "^21.0.3",