Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
Fixed types in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kraifpatrik committed Apr 23, 2021
1 parent efba65c commit 3060f60
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 188 deletions.
58 changes: 29 additions & 29 deletions scripts/ce_matrix/ce_matrix.gml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// @param {real} _m10.._m13 The second row of the matrix.
/// @param {real} _m20.._m23 The third row of the matrix.
/// @param {real} _m30.._m33 The fourth row of the matrix.
/// @return {array} The created matrix.
/// @return {real[16]} The created matrix.
function ce_matrix_create(
_m00, _m01, _m02, _m03,
_m10, _m11, _m12, _m13,
Expand All @@ -22,8 +22,8 @@ function ce_matrix_create(

/// @func ce_matrix_add_componentwise(_m1, _m2)
/// @desc Adds matrices `_m1`, `_m2` componentwise and stores the result to `_m1`.
/// @param {array} _m1 The first matrix.
/// @param {array} _m2 The second matrix.
/// @param {real[16]} _m1 The first matrix.
/// @param {real[16]} _m2 The second matrix.
function ce_matrix_add_componentwise(_m1, _m2)
{
gml_pragma("forceinline");
Expand All @@ -47,10 +47,10 @@ function ce_matrix_add_componentwise(_m1, _m2)

/// @func ce_matrix_build_lookat(_from, _to, _up)
/// @desc Builds a look-at matrix from given vec3.
/// @param {array} _from Camera's position vector.
/// @param {array} _to Camera's target position.
/// @param {array} _up Camera's up vector.
/// @return {array} The created matrix.
/// @param {real[3]} _from Camera's position vector.
/// @param {real[3]} _to Camera's target position.
/// @param {real[3]} _up Camera's up vector.
/// @return {real[16]} The created matrix.
function ce_matrix_build_lookat(_from, _to, _up)
{
gml_pragma("forceinline");
Expand All @@ -73,8 +73,8 @@ function ce_matrix_copy(_source, _target)

/// @func ce_matrix_clone(_m)
/// @desc Creates a clone of the matrix.
/// @param {array} _m The matrix to create a clone of.
/// @return {array} The created matrix.
/// @param {real[16]} _m The matrix to create a clone of.
/// @return {real[16]} The created matrix.
function ce_matrix_clone(_m)
{
gml_pragma("forceinline");
Expand All @@ -85,11 +85,11 @@ function ce_matrix_clone(_m)

/// @func ce_matrix_create_from_columns(_c0, _c1, _c2, _c3)
/// @desc Creates a matrix with specified columns.
/// @param {array} _c0 The first column of the matrix.
/// @param {array} _c1 The second column of the matrix.
/// @param {array} _c2 The third column of the matrix.
/// @param {array} _c3 The fourth column of the matrix.
/// @return {array} The created matrix.
/// @param {real[4]} _c0 The first column of the matrix.
/// @param {real[4]} _c1 The second column of the matrix.
/// @param {real[4]} _c2 The third column of the matrix.
/// @param {real[4]} _c3 The fourth column of the matrix.
/// @return {real[16]} The created matrix.
function ce_matrix_create_from_columns(_c0, _c1, _c2, _c3)
{
gml_pragma("forceinline");
Expand All @@ -103,11 +103,11 @@ function ce_matrix_create_from_columns(_c0, _c1, _c2, _c3)

/// @func ce_matrix_create_from_rows(_r0, _r1, _r2, _r3)
/// @desc Creates a matrix with specified rows.
/// @param {array} _r0 The first row of the matrix.
/// @param {array} _r1 The second row of the matrix.
/// @param {array} _r2 The third row of the matrix.
/// @param {array} _r3 The fourth row of the matrix.
/// @return {array} The created matrix.
/// @param {real[4]} _r0 The first row of the matrix.
/// @param {real[4]} _r1 The second row of the matrix.
/// @param {real[4]} _r2 The third row of the matrix.
/// @param {real[4]} _r3 The fourth row of the matrix.
/// @return {real[16]} The created matrix.
function ce_matrix_create_from_rows(_r0, _r1, _r2, _r3)
{
gml_pragma("forceinline");
Expand All @@ -121,7 +121,7 @@ function ce_matrix_create_from_rows(_r0, _r1, _r2, _r3)

/// @func ce_matrix_determinant(_m)
/// @desc Gets the determinant of the matrix.
/// @param {array} _m The matrix.
/// @param {real[16]} _m The matrix.
/// @return {real} The determinant of the matrix.
function ce_matrix_determinant(_m)
{
Expand Down Expand Up @@ -153,7 +153,7 @@ function ce_matrix_determinant(_m)

/// @func ce_matrix_inverse(_m)
/// @desc Inverts the matrix.
/// @param {array} _m The matrix.
/// @param {real[16]} _m The matrix.
function ce_matrix_inverse(_m)
{
gml_pragma("forceinline");
Expand Down Expand Up @@ -227,8 +227,8 @@ function ce_matrix_multiply(_matrix)
/// @func ce_matrix_multiply_componentwise(_m1, _m2)
/// @desc Multiplies matrices `_m1`, `_m2` componentwise and stores the result to
/// `_m1`.
/// @param {array} _m1 The first matrix.
/// @param {array} _m2 The second matrix.
/// @param {real[16]} _m1 The first matrix.
/// @param {real[16]} _m2 The second matrix.
function ce_matrix_multiply_componentwise(_m1, _m2)
{
gml_pragma("forceinline");
Expand All @@ -252,7 +252,7 @@ function ce_matrix_multiply_componentwise(_m1, _m2)

/// @func ce_matrix_scale_componentwise(_m, _s)
/// @desc Scales each component of a matrix by a value.
/// @param {array} _m The matrix to scale.
/// @param {real[16]} _m The matrix to scale.
/// @param {real} _s The value to scale the matrix by.
function ce_matrix_scale_componentwise(_m, _s)
{
Expand All @@ -278,8 +278,8 @@ function ce_matrix_scale_componentwise(_m, _s)
/// @func ce_matrix_subtract_componentwise(_m1, _m2)
/// @desc Subtracts matrices `_m1`, `_m2` componentwise and stores the result to
/// `_m1`.
/// @param {array} _m1 The first matrix.
/// @param {array} _m2 The second matrix.
/// @param {real[16]} _m1 The first matrix.
/// @param {real[16]} _m2 The second matrix.
function ce_matrix_subtract_componentwise(_m1, _m2)
{
gml_pragma("forceinline");
Expand All @@ -303,8 +303,8 @@ function ce_matrix_subtract_componentwise(_m1, _m2)

/// @func ce_matrix_to_euler(_m)
/// @desc Gets euler angles from the YXZ rotation matrix.
/// @param {array} _m The YXZ rotation matrix.
/// @return {array} An array containing the euler angles `[rot_x, rot_y, rot_z]`.
/// @param {real[16]} _m The YXZ rotation matrix.
/// @return {real[16]} An array containing the euler angles `[rot_x, rot_y, rot_z]`.
/// @source https://www.geometrictools.com/Documentation/EulerAngles.pdf
function ce_matrix_to_euler(_m)
{
Expand Down Expand Up @@ -343,7 +343,7 @@ function ce_matrix_to_euler(_m)

/// @func ce_matrix_transpose(_m)
/// @desc Transposes the matrix.
/// @param {array} _m The matrix to be transposed.
/// @param {real[16]} _m The matrix to be transposed.
function ce_matrix_transpose(_m)
{
gml_pragma("forceinline");
Expand Down
70 changes: 35 additions & 35 deletions scripts/ce_quaternion/ce_quaternion.gml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// @param {real} _y The y component of the quaternion.
/// @param {real} _z The z component of the quaternion.
/// @param {real} _w The w component of the quaternion.
/// @return {array} The created quaternion.
/// @return {real[4]} The created quaternion.
function ce_quaternion_create(_x, _y, _z, _w)
{
gml_pragma("forceinline");
Expand All @@ -13,8 +13,8 @@ function ce_quaternion_create(_x, _y, _z, _w)

/// @func ce_quaternion_add(_q1, _q2)
/// @desc Adds the quaternions `_q1`, `_q2` and stores the result to `_q1`.
/// @param {array} _q1 The first quaternion.
/// @param {array} _q2 The second quaternion.
/// @param {real[4]} _q1 The first quaternion.
/// @param {real[4]} _q2 The second quaternion.
function ce_quaternion_add(_q1, _q2)
{
_q1[@ 0] += _q2[0];
Expand All @@ -25,8 +25,8 @@ function ce_quaternion_add(_q1, _q2)

/// @func ce_quaternion_clone(_q)
/// @desc Creates a clone of the quaternion.
/// @param {array} _q The quaternion.
/// @return {array} The created quaternion.
/// @param {real[4]} _q The quaternion.
/// @return {real[4]} The created quaternion.
function ce_quaternion_clone(_q)
{
gml_pragma("forceinline");
Expand All @@ -37,7 +37,7 @@ function ce_quaternion_clone(_q)

/// @func ce_quaternion_conjugate(_q)
/// @desc Conjugates the quaternion.
/// @param {array} _q The quaternion.
/// @param {real[4]} _q The quaternion.
function ce_quaternion_conjugate(_q)
{
_q[@ 0] = -_q[0];
Expand All @@ -47,9 +47,9 @@ function ce_quaternion_conjugate(_q)

/// @func ce_quaternion_create_from_axisangle(_axis, _angle)
/// @desc Creates a quaternion form the axis an the angle.
/// @param {array} _axis A 3D vector representing the axis.
/// @param {real[3]} _axis A 3D vector representing the axis.
/// @param {real} _angle The angle in degrees.
/// @return {array} The created quaternion.
/// @return {real[4]} The created quaternion.
function ce_quaternion_create_from_axisangle(_axis, _angle)
{
var _sin_half_angle = -dsin(_angle * 0.5);
Expand All @@ -64,9 +64,9 @@ function ce_quaternion_create_from_axisangle(_axis, _angle)
/// @func ce_quaternion_create_fromto_rotation(_from, _to)
/// @desc Creates a quaternion that represents rotation from one vector to
/// another.
/// @param {array} _from The 3D "from" vector.
/// @param {array} _to The 3D "to" vector.
/// @return {array} The created quaternion.
/// @param {real[3]} _from The 3D "from" vector.
/// @param {real[3]} _to The 3D "to" vector.
/// @return {real[4]} The created quaternion.
function ce_quaternion_create_fromto_rotation(_from, _to)
{
var _dot = ce_vec3_dot(_from, _to);
Expand Down Expand Up @@ -96,7 +96,7 @@ function ce_quaternion_create_fromto_rotation(_from, _to)

/// @func ce_quaternion_create_identity()
/// @desc Creates an identity quaternion.
/// @return {array} The created identity quaternion.
/// @return {real[4]} The created identity quaternion.
function ce_quaternion_create_identity()
{
gml_pragma("forceinline");
Expand All @@ -107,9 +107,9 @@ function ce_quaternion_create_identity()
/// @desc Creates a quaternion with the specified forward and up vectors. These
/// vectors must not be parallel! If they are, then an identity quaternion
/// will be returned.
/// @param {array} _forward The 3D forward unit vector.
/// @param {array} _up The 3D up unit vector.
/// @return {array} An array representing the quaternion.
/// @param {real[3]} _forward The 3D forward unit vector.
/// @param {real[3]} _up The 3D up unit vector.
/// @return {real[4]} An array representing the quaternion.
/// @source https://www.gamedev.net/forums/topic/613595-quaternion-lookrotationlookat-up/4876913/
function ce_quaternion_create_look_rotation(_forward, _up)
{
Expand Down Expand Up @@ -141,8 +141,8 @@ function ce_quaternion_create_look_rotation(_forward, _up)

/// @func ce_quaternion_dot(_q1, _q2)
/// @desc Gets the dot product of the two quaternions.
/// @param {array} _q1 The first quaternion.
/// @param {array} _q2 The second quaternion.
/// @param {real[4]} _q1 The first quaternion.
/// @param {real[4]} _q2 The second quaternion.
/// @return {real} The dot product of the two quaternions.
function ce_quaternion_dot(_q1, _q2)
{
Expand All @@ -155,7 +155,7 @@ function ce_quaternion_dot(_q1, _q2)

/// @func ce_quaternion_inverse(_q)
/// @desc Inverts the quaternion.
/// @param {array} _q The quaternion.
/// @param {real[4]} _q The quaternion.
function ce_quaternion_inverse(_q)
{
ce_quaternion_conjugate(_q);
Expand All @@ -165,7 +165,7 @@ function ce_quaternion_inverse(_q)

/// @func ce_quaternion_length(_q)
/// @desc Gets the length of the quaternion.
/// @param {array} _q The quaternion.
/// @param {real[4]} _q The quaternion.
/// @return {real} The length of the quaternion.
function ce_quaternion_length(_q)
{
Expand All @@ -182,7 +182,7 @@ function ce_quaternion_length(_q)

/// @func ce_quaternion_lengthsqr(_q)
/// @desc Gets the squared length of the quaternion.
/// @param {array} _q An array representing the quaternion.
/// @param {real[4]} _q An array representing the quaternion.
/// @return {real} The squared length of the quaternion.
function ce_quaternion_lengthsqr(_q) {
gml_pragma("forceinline");
Expand All @@ -199,8 +199,8 @@ function ce_quaternion_lengthsqr(_q) {
/// @func ce_quaternion_lerp(_q1, _q2, _s)
/// @desc Performs a linear interpolation between the quaternions `_q1`, `_q2`
/// and stores the result to `_q1`.
/// @param {array} _q1 The first quaternion.
/// @param {array} _q2 The second quaternion.
/// @param {real[4]} _q1 The first quaternion.
/// @param {real[4]} _q2 The second quaternion.
/// @param {real} _s The lerping factor.
function ce_quaternion_lerp(_q1, _q2, _s)
{
Expand All @@ -212,8 +212,8 @@ function ce_quaternion_lerp(_q1, _q2, _s)

/// @func ce_quaternion_multiply(_q1, _q2)
/// @desc Multiplies the quaternions `_q1`, `_q2` and stores the result to `_q1`.
/// @param {array} _q1 The first quaternion.
/// @param {array} _q2 The second quaternion.
/// @param {real[4]} _q1 The first quaternion.
/// @param {real[4]} _q2 The second quaternion.
function ce_quaternion_multiply(_q1, _q2)
{
var _q10 = _q1[0];
Expand All @@ -237,7 +237,7 @@ function ce_quaternion_multiply(_q1, _q2)

/// @func ce_quaternion_normalize(_q)
/// @desc Normalizes the quaternion.
/// @param {array} _q The quaternion.
/// @param {real[4]} _q The quaternion.
function ce_quaternion_normalize(_q)
{
var _length_sqr = ce_quaternion_lengthsqr(_q);
Expand All @@ -254,8 +254,8 @@ function ce_quaternion_normalize(_q)

/// @func ce_quaternion_rotate(_q, _v)
/// @desc Rotates the 3D vector by the quaternion.
/// @param {array} _q The quaternion.
/// @param {array} _v The 3D vector.
/// @param {real[4]} _q The quaternion.
/// @param {real[4]} _v The 3D vector.
function ce_quaternion_rotate(_q, _v)
{
var _clone = ce_quaternion_clone(_q);
Expand All @@ -273,7 +273,7 @@ function ce_quaternion_rotate(_q, _v)

/// @func ce_quaternion_scale(_q, _s)
/// @desc Scales a quaternion by the value.
/// @param {array} _q The quaternion.
/// @param {real[4]} _q The quaternion.
/// @param {real} _s The value to scale the quaternion by.
function ce_quaternion_scale(_q, _s)
{
Expand All @@ -286,8 +286,8 @@ function ce_quaternion_scale(_q, _s)
/// @func ce_quaternion_slerp(_q1, _q2, _s)
/// @desc Performs a spherical linear interpolation between the quaternions
/// `_q1`, `_q2` and stores the result to `_q1`.
/// @param {array} _q1 The first quaternion.
/// @param {array} _q2 The second quaternion.
/// @param {real[4]} _q1 The first quaternion.
/// @param {real[4]} _q2 The second quaternion.
/// @param {real} _s The slerping factor.
/// @source https://en.wikipedia.org/wiki/Slerp#Source_code
function ce_quaternion_slerp(_q1, _q2, _s)
Expand Down Expand Up @@ -363,8 +363,8 @@ function ce_quaternion_slerp(_q1, _q2, _s)

/// @func ce_quaternion_subtract(q1, _q2)
/// @desc Subtracts quaternion `_q2` from `_q1` and stores the result into `_q1`.
/// @param {array} _q1 The quaternion to subtract from.
/// @param {array} _q2 The quaternion to subtract.
/// @param {real[4]} _q1 The quaternion to subtract from.
/// @param {real[4]} _q2 The quaternion to subtract.
function ce_quaternion_subtract(_q1, _q2)
{
_q1[@ 0] -= _q2[0];
Expand All @@ -375,7 +375,7 @@ function ce_quaternion_subtract(_q1, _q2)

/// @func ce_quaternion_to_angle(_q)
/// @desc Gets quaternion angle in degrees.
/// @param {array} _q The quaternion.
/// @param {real[4]} _q The quaternion.
/// @return {real} The quaternion angle in degrees.
function ce_quaternion_to_angle(_q)
{
Expand All @@ -385,8 +385,8 @@ function ce_quaternion_to_angle(_q)

/// @func ce_quaternion_to_axis(_q)
/// @desc Creates 3D axis from the quaternion.
/// @param {array} _q The quaternion.
/// @return {array} The created axis as `[x, y, z]`.
/// @param {real[4]} _q The quaternion.
/// @return {real[4]} The created axis as `[x, y, z]`.
function ce_quaternion_to_axis(_q)
{
var _sin_theta_inv = 1 / sin(arccos(_q[3]));
Expand Down
Loading

0 comments on commit 3060f60

Please sign in to comment.