From 5ebeee64060cf6396b93c8c4e5401b78331fdfcc Mon Sep 17 00:00:00 2001 From: thinknathan Date: Tue, 23 Jan 2024 20:28:26 -0800 Subject: [PATCH 1/2] Correct script_api --- xmath/api/xMath.script_api | 55 ++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/xmath/api/xMath.script_api b/xmath/api/xMath.script_api index 976cb5f..c4e03fb 100644 --- a/xmath/api/xMath.script_api +++ b/xmath/api/xMath.script_api @@ -82,11 +82,11 @@ desc: "Rotate a vector by a quaternion." parameters: - name: v_in_place - type: [vector3, vector4] + type: vector3 - name: q type: quaternion - name: v1 - type: [vector3, vector4] + type: vector3 - name: vector type: function @@ -256,16 +256,61 @@ - name: m1 type: matrix4 - - name: matrix_mul + - name: matrix_look_at + type: function + desc: "Set the value of a matrix from supplied look-at parameters." + parameters: + - name: m_in_place + type: matrix4 + - name: eye + type: vector3 + - name: look_at + type: vector3 + - name: up + type: vector3 + + - name: matrix4_orthographic type: function - desc: "Multiply two matrices." + desc: "Set the value of an orthographic projection matrix." + parameters: + - name: m_in_place + type: matrix4 + - name: left + type: number + - name: right + type: number + - name: bottom + type: number + - name: top + type: number + - name: near + type: number + - name: far + type: number + + - name: matrix_ortho_inv + type: function + desc: "The resulting matrix is the inverse of the supplied matrix." parameters: - name: m_in_place type: matrix4 - name: m1 type: matrix4 - - name: m2 + + - name: matrix4_perspective + type: function + desc: "Set the value of a perspective projection matrix." + parameters: + - name: m_in_place type: matrix4 + - name: fov + type: number + - name: aspect + type: number + - name: near + type: number + - name: far + type: number - name: matrix_rotate_x type: function From 18b94937ffd24983d598b2e499d0ab137c5357ec Mon Sep 17 00:00:00 2001 From: thinknathan Date: Tue, 23 Jan 2024 20:36:12 -0800 Subject: [PATCH 2/2] Fix rotation names in script_api --- xmath/api/xMath.script_api | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmath/api/xMath.script_api b/xmath/api/xMath.script_api index c4e03fb..bb88954 100644 --- a/xmath/api/xMath.script_api +++ b/xmath/api/xMath.script_api @@ -312,7 +312,7 @@ - name: far type: number - - name: matrix_rotate_x + - name: matrix_rotation_x type: function desc: "Set the value of a matrix for rotation around the x-axis." parameters: @@ -321,7 +321,7 @@ - name: angle type: number - - name: matrix_rotate_y + - name: matrix_rotation_y type: function desc: "Set the value of a matrix for rotation around the y-axis." parameters: @@ -330,7 +330,7 @@ - name: angle type: number - - name: matrix_rotate_z + - name: matrix_rotation_z type: function desc: "Set the value of a matrix for rotation around the z-axis." parameters: