@ts-defold/types 1.2.51 → 1.2.53

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.
Files changed (2) hide show
  1. package/index.d.ts +62 -8
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  /// <reference types="lua-types/5.1" />
3
3
  /// <reference types="@typescript-to-lua/language-extensions" />
4
4
 
5
- // DEFOLD. stable version 1.9.3 (e4aaff11f49c941fde1dd93883cf69c6b8abebe4)
5
+ // DEFOLD. stable version 1.9.4 (a9277779d1c23b0712a5959314b9508d2e802efb)
6
6
  // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= //
7
7
 
8
8
 
@@ -3921,7 +3921,7 @@ Set to `true` to return all ray cast hits. If `false`, it will only return the c
3921
3921
  * @param from the world position of the start of the ray
3922
3922
  * @param to the world position of the end of the ray
3923
3923
  * @param groups a lua table containing the hashed groups for which to test collisions against
3924
- * @param request_id a number between [0,-255]. It will be sent back in the response for identification, 0 by default
3924
+ * @param request_id a number in range [0,255]. It will be sent back in the response for identification, 0 by default
3925
3925
  */
3926
3926
  export function raycast_async(from: vmath.vector3, to: vmath.vector3, groups: any, request_id?: number): void
3927
3927
 
@@ -6707,7 +6707,7 @@ declare namespace timer {
6707
6707
  * If you want a timer that triggers on each frame, set delay to 0.0f and repeat to true.
6708
6708
  * Timers created within a script will automatically die when the script is deleted.
6709
6709
  * @param delay time interval in seconds
6710
- * @param repeat true = repeat timer until cancel, false = one-shot timer
6710
+ * @param repeating true = repeat timer until cancel, false = one-shot timer
6711
6711
  * @param callback timer callback function
6712
6712
 
6713
6713
  `self`
@@ -6719,7 +6719,7 @@ The elapsed time - on first trigger it is time since timer.delay call, otherwise
6719
6719
 
6720
6720
  * @return handle identifier for the create timer, returns timer.INVALID_TIMER_HANDLE if the timer can not be created
6721
6721
  */
6722
- export function delay(delay: number, repeat: boolean, callback: any): any
6722
+ export function delay(delay: number, repeating: boolean, callback: any): any
6723
6723
 
6724
6724
  /**
6725
6725
  * Get information about timer.
@@ -6749,6 +6749,19 @@ true = repeat timer until cancel, false = one-shot timer.
6749
6749
 
6750
6750
  declare namespace vmath {
6751
6751
 
6752
+ /**
6753
+ * Clamp input value to be in range of [min, max]. In case if input value has vector3|vector4 type
6754
+ * return new vector3|vector4 with clamped value at every vector's element.
6755
+ * Min/max arguments can be vector3|vector4. In that case clamp excuted per every vector's element
6756
+ * @param value Input value or vector of values
6757
+ * @param min Min value(s) border
6758
+ * @param max Max value(s) border
6759
+ * @return clamped_value Clamped value or vector
6760
+ */
6761
+ export function clamp(value: number, min: number, max: number): number
6762
+ export function clamp(value: vmath.vector3, min: vmath.vector3, max: vmath.vector3): vmath.vector3
6763
+ export function clamp(value: vmath.vector4, min: vmath.vector4, max: vmath.vector4): vmath.vector4
6764
+
6752
6765
  /**
6753
6766
  * Calculates the conjugate of a quaternion. The result is a
6754
6767
  * quaternion with the same magnitudes but with the sign of
@@ -6878,11 +6891,14 @@ declare namespace vmath {
6878
6891
  export function matrix4_axis_angle(v: vmath.vector3, angle: number): vmath.matrix4
6879
6892
 
6880
6893
  /**
6881
- * The resulting matrix describes the same rotation as the quaternion, but does not have any translation (also like the quaternion).
6882
- * @param q quaternion to create matrix from
6883
- * @return m matrix represented by quaternion
6894
+ * Creates a new matrix constructed from separate
6895
+ * translation vector, roation quaternion and scale vector
6896
+ * @param translation translation
6897
+ * @param rotation rotation
6898
+ * @param scale scale
6899
+ * @return matrix new matrix4
6884
6900
  */
6885
- export function matrix4_from_quat(q: vmath.quaternion): vmath.matrix4
6901
+ export function matrix4_compose(translation: any, rotation: vmath.quaternion, scale: vmath.vector3): vmath.matrix4
6886
6902
 
6887
6903
  /**
6888
6904
  * Constructs a frustum matrix from the given values. The left, right,
@@ -6934,6 +6950,13 @@ declare namespace vmath {
6934
6950
  */
6935
6951
  export function matrix4_perspective(fov: number, aspect: number, near: number, far: number): vmath.matrix4
6936
6952
 
6953
+ /**
6954
+ * The resulting matrix describes the same rotation as the quaternion, but does not have any translation (also like the quaternion).
6955
+ * @param q quaternion to create matrix from
6956
+ * @return m matrix represented by quaternion
6957
+ */
6958
+ export function matrix4_quat(q: vmath.quaternion): vmath.matrix4
6959
+
6937
6960
  /**
6938
6961
  * The resulting matrix describes a rotation around the x-axis
6939
6962
  * by the specified angle.
@@ -6958,6 +6981,29 @@ declare namespace vmath {
6958
6981
  */
6959
6982
  export function matrix4_rotation_z(angle: number): vmath.matrix4
6960
6983
 
6984
+ /**
6985
+ * Creates a new matrix constructed from scale vector
6986
+ * @param scale scale
6987
+ * @return matrix new matrix4
6988
+ */
6989
+ export function matrix4_scale(scale: vmath.vector3): vmath.matrix4
6990
+
6991
+ /**
6992
+ * creates a new matrix4 from uniform scale
6993
+ * @param scale scale
6994
+ * @return matrix new matrix4
6995
+ */
6996
+ export function matrix4_scale(scale: number): vmath.matrix4
6997
+
6998
+ /**
6999
+ * Creates a new matrix4 from three scale components
7000
+ * @param scale_x scale along X axis
7001
+ * @param scale_y sclae along Y axis
7002
+ * @param scale_z scale along Z asis
7003
+ * @return matrix new matrix4
7004
+ */
7005
+ export function matrix4_scale(scale_x: number, scale_y: number, scale_z: number): vmath.matrix4
7006
+
6961
7007
  /**
6962
7008
  * The resulting matrix describes a translation of a point
6963
7009
  * in euclidean space.
@@ -7071,6 +7117,14 @@ declare namespace vmath {
7071
7117
  */
7072
7118
  export function quat_from_to(v1: vmath.vector3, v2: vmath.vector3): vmath.quaternion
7073
7119
 
7120
+ /**
7121
+ * Creates a new quaternion with the components set
7122
+ * according to the supplied parameter values.
7123
+ * @param matrix source matrix4
7124
+ * @return q new quaternion
7125
+ */
7126
+ export function quat_matrix4(matrix: vmath.matrix4): vmath.quaternion
7127
+
7074
7128
  /**
7075
7129
  * The resulting quaternion describes a rotation of `angle`
7076
7130
  * radians around the x-axis.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-defold/types",
3
- "version": "1.2.51",
3
+ "version": "1.2.53",
4
4
  "description": "TypeScript definitions for Defold",
5
5
  "repository": "github:ts-defold/types",
6
6
  "keywords": [