math-rust-lib 0.1.2 → 0.1.3
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/math_rust_lib.d.ts +2 -0
- package/math_rust_lib.js +22 -0
- package/math_rust_lib_bg.wasm +0 -0
- package/package.json +1 -1
package/math_rust_lib.d.ts
CHANGED
|
@@ -10,7 +10,9 @@ export class Mat4 {
|
|
|
10
10
|
scale_in_place(sx: number, sy: number, sz: number): Mat4;
|
|
11
11
|
static to_quat_from_array(m: Float32Array, offset: number): Quat;
|
|
12
12
|
translate_in_place(tx: number, ty: number, tz: number): Mat4;
|
|
13
|
+
static from_position_rotation(position: Vec3, rotation: Quat): Mat4;
|
|
13
14
|
scale_in_place_by_vec3(scale: Vec3): Mat4;
|
|
15
|
+
static from_position_rotation_to_ref(position: Vec3, rotation: Quat, result: Mat4): void;
|
|
14
16
|
constructor(val: Float32Array);
|
|
15
17
|
set(val: Float32Array): void;
|
|
16
18
|
static look_at(eye: Vec3, target: Vec3, up: Vec3): Mat4;
|
package/math_rust_lib.js
CHANGED
|
@@ -149,6 +149,17 @@ class Mat4 {
|
|
|
149
149
|
const ret = wasm.mat4_translate_in_place(ptr, tx, ty, tz);
|
|
150
150
|
return Mat4.__wrap(ret);
|
|
151
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* @param {Vec3} position
|
|
154
|
+
* @param {Quat} rotation
|
|
155
|
+
* @returns {Mat4}
|
|
156
|
+
*/
|
|
157
|
+
static from_position_rotation(position, rotation) {
|
|
158
|
+
_assertClass(position, Vec3);
|
|
159
|
+
_assertClass(rotation, Quat);
|
|
160
|
+
const ret = wasm.mat4_from_position_rotation(position.__wbg_ptr, rotation.__wbg_ptr);
|
|
161
|
+
return Mat4.__wrap(ret);
|
|
162
|
+
}
|
|
152
163
|
/**
|
|
153
164
|
* @param {Vec3} scale
|
|
154
165
|
* @returns {Mat4}
|
|
@@ -159,6 +170,17 @@ class Mat4 {
|
|
|
159
170
|
const ret = wasm.mat4_scale_in_place_by_vec3(this.__wbg_ptr, ptr0);
|
|
160
171
|
return Mat4.__wrap(ret);
|
|
161
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* @param {Vec3} position
|
|
175
|
+
* @param {Quat} rotation
|
|
176
|
+
* @param {Mat4} result
|
|
177
|
+
*/
|
|
178
|
+
static from_position_rotation_to_ref(position, rotation, result) {
|
|
179
|
+
_assertClass(position, Vec3);
|
|
180
|
+
_assertClass(rotation, Quat);
|
|
181
|
+
_assertClass(result, Mat4);
|
|
182
|
+
wasm.mat4_from_position_rotation_to_ref(position.__wbg_ptr, rotation.__wbg_ptr, result.__wbg_ptr);
|
|
183
|
+
}
|
|
162
184
|
/**
|
|
163
185
|
* @param {Float32Array} val
|
|
164
186
|
*/
|
package/math_rust_lib_bg.wasm
CHANGED
|
Binary file
|