Skip to content

Commit c8d74f8

Browse files
committed
Ok, now the Constructors sections should work
1 parent a619f16 commit c8d74f8

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

datapack/data/advanced_math/modules/pid.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ local metatable = {
227227
__tostring = pid.tostring
228228
}
229229

230+
--- Constructors
231+
--
232+
-- @section Constructors
233+
230234
--- Constructs a new PID controller for either a scalar, vector, or quaternion target.
231235
--
232236
-- @tparam number|vector|quaternion target The setpoint to reach
@@ -236,7 +240,6 @@ local metatable = {
236240
-- @tparam boolean discrete Whether to treat the PID as discrete or continuous
237241
-- @treturn The PID initialized with the given arguments
238242
-- @usage pid = pid.new(target)
239-
-- @section Constructors
240243
-- @export
241244
-- @see quaternion
242245
function new(target, p, i, d, discrete)

datapack/data/advanced_math/rom/apis/matrix.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,10 @@ local metatable = {
603603
__eq = matrix.equals
604604
}
605605

606+
--- Constructors
607+
--
608+
-- @section Constructors
609+
606610
--- Constructs a new matrix of rows by columns, filling it using the provided function or scalar.
607611
--
608612
-- @tparam number rows The number of rows in the matrix
@@ -612,7 +616,6 @@ local metatable = {
612616
-- @usage m = matrix.new(3, 3, function(r, c) return r + c end)
613617
-- @usage m = matrix.new(2, 4, 5) -- fills all elements with 5
614618
-- @usage m = matrix.new(2, 2) -- fills all elements with 1
615-
-- @section Constructors
616619
-- @export
617620
function new(rows, columns, func)
618621
expect(1, rows, "number", "nil")
@@ -642,7 +645,6 @@ end
642645
-- @tparam table arr A 2D array representing the matrix data
643646
-- @treturn Matrix A new matrix
644647
-- @usage m = matrix.from2DArray({{1, 2}, {3, 4}})
645-
-- @section Constructors
646648
-- @export
647649
function from2DArray(arr)
648650
expect(1, arr, "table")
@@ -660,7 +662,6 @@ end
660662
-- @treturn Matrix A new matrix representing the vector
661663
-- @usage m = matrix.fromVector(vector.new(1, 2, 3), true) -- row matrix
662664
-- @usage m = matrix.fromVector(vector.new(1, 2, 3), false) -- column matrix
663-
-- @section Constructors
664665
-- @export
665666
function fromVector(v, row)
666667
expect(1, v, "Vector")
@@ -683,7 +684,6 @@ end
683684
-- @tparam table q The quaternion to convert
684685
-- @treturn Matrix A new 3x3 rotation matrix
685686
-- @usage m = matrix.fromQuaternion(quaternion.new(1, vector.new(0, 0, 0)))
686-
-- @section Constructors
687687
-- @export
688688
-- @see quaternion
689689
function fromQuaternion(q)
@@ -712,7 +712,6 @@ end
712712
-- @tparam number columns The number of columns
713713
-- @treturn Matrix A new identity matrix
714714
-- @usage m = matrix.identity(3, 3)
715-
-- @section Constructors
716715
-- @export
717716
function identity(rows, columns)
718717
return new(rows, columns)

datapack/data/advanced_math/rom/apis/quaternion.lua

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,16 @@ local vmetatable = {
363363
__eq = quaternion.equals,
364364
}
365365

366+
--- Constructors
367+
--
368+
-- @section Constructors
369+
366370
--- Constructs a new quaternion from a vector and a w parameter. Similarly to fromComponents, this method will not produce a normalized quaternion.
367371
--
368372
-- @tparam Vector vec imaginary component of the vector, stored in a vector
369373
-- @tparam number w Real component of the quaternion
370374
-- @treturn The quaternion made from the given arguments
371375
-- @usage q = quaternion.new(vec, w)
372-
-- @section Constructors
373376
-- @export
374377
function new(vec, w)
375378
expect(1, vec, "Vector", "nil")
@@ -390,7 +393,6 @@ end
390393
-- @tparam number angle Angle in radians of the rotation
391394
-- @treturn The quaternion representing the rotation described by the axis angle parameters
392395
-- @usage q = quaternion.fromAxisAngle(axis, angle)
393-
-- @section Constructors
394396
-- @export
395397
function fromAxisAngle(axis, angle)
396398
expect(1, axis, "Vector", "nil")
@@ -413,7 +415,6 @@ end
413415
-- @tparam number roll Roll in radians
414416
-- @treturn the quaternion made from the provided euler angles
415417
-- @usage q = quaternion.fromEuler(pitch, yaw, roll)
416-
-- @section Constructors
417418
-- @export
418419
function fromEuler(pitch, yaw, roll)
419420
expect(1, pitch, "number", "nil")
@@ -434,7 +435,6 @@ end
434435
-- @tparam number w
435436
-- @treturn the quaternion made from the provided components
436437
-- @usage q = quaternion.fromComponents(x, y, z, w)
437-
-- @section Constructors
438438
-- @export
439439
function fromComponents(x, y, z, w)
440440
expect(1, x, "number", "nil")
@@ -455,7 +455,6 @@ end
455455
-- @treturn Quaternion The quaternion representing the same rotation
456456
-- Note: For 4x4 matrices, only the upper-left 3x3 rotation portion is used
457457
-- @usage q = quaternion.fromMatrix(m)
458-
-- @section Constructors
459458
-- @export
460459
-- @see matrix
461460
function fromMatrix(m)
@@ -513,7 +512,6 @@ end
513512
--
514513
-- @treturn an empty identity quaternion
515514
-- @usage q = quaternion.identity()
516-
-- @section Constructors
517515
-- @export
518516
function identity()
519517
return new()

0 commit comments

Comments
 (0)