@tlua/gmod 1.0.1
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/README.md +28 -0
- package/__metadata.json +4 -0
- package/_globals.d.tlua +178 -0
- package/_gmod-std.d.tlua +35 -0
- package/achievementicon.d.tlua +12 -0
- package/achievements.d.tlua +162 -0
- package/ai.d.tlua +65 -0
- package/ai_schedule.d.tlua +17 -0
- package/ai_task.d.tlua +17 -0
- package/angle.d.tlua +197 -0
- package/avatarimage.d.tlua +10 -0
- package/awesomium.d.tlua +14 -0
- package/baseclass.d.tlua +42 -0
- package/bf_read.d.tlua +110 -0
- package/bit.d.tlua +121 -0
- package/button.d.tlua +13 -0
- package/cam.d.tlua +220 -0
- package/ceffectdata.d.tlua +337 -0
- package/chat.d.tlua +62 -0
- package/checkbutton.d.tlua +14 -0
- package/cleanup.d.tlua +88 -0
- package/cluaemitter.d.tlua +119 -0
- package/clualocomotion.d.tlua +383 -0
- package/cluaparticle.d.tlua +426 -0
- package/cmovedata.d.tlua +476 -0
- package/cnavarea.d.tlua +845 -0
- package/cnavladder.d.tlua +209 -0
- package/cnewparticleeffect.d.tlua +259 -0
- package/color.d.tlua +339 -0
- package/concommand.d.tlua +69 -0
- package/constraint.d.tlua +311 -0
- package/construct.d.tlua +26 -0
- package/contentheader.d.tlua +32 -0
- package/contenticon.d.tlua +86 -0
- package/contentsidebar.d.tlua +45 -0
- package/contentsidebartoolbox.d.tlua +13 -0
- package/contextbase.d.tlua +37 -0
- package/controlpanel.d.tlua +140 -0
- package/controlpresets.d.tlua +118 -0
- package/convar.d.tlua +162 -0
- package/cookie.d.tlua +60 -0
- package/coroutine.d.tlua +90 -0
- package/crecipientfilter.d.tlua +152 -0
- package/csent.d.tlua +10 -0
- package/csoundpatch.d.tlua +150 -0
- package/ctakedamageinfo.d.tlua +366 -0
- package/ctrllistbox.d.tlua +12 -0
- package/ctrlnumpad.d.tlua +73 -0
- package/cusercmd.d.tlua +320 -0
- package/custom_classes.d.tlua +65 -0
- package/custom_entity_fields.d.tlua +96 -0
- package/cvars.d.tlua +80 -0
- package/dadjustablemodelpanel.d.tlua +81 -0
- package/dalphabar.d.tlua +27 -0
- package/dbinder.d.tlua +37 -0
- package/dbubblecontainer.d.tlua +18 -0
- package/dbutton.d.tlua +88 -0
- package/dcategoryheader.d.tlua +13 -0
- package/dcategorylist.d.tlua +11 -0
- package/dcheckbox.d.tlua +46 -0
- package/dcheckboxlabel.d.tlua +90 -0
- package/dcollapsiblecategory.d.tlua +240 -0
- package/dcolorbutton.d.tlua +73 -0
- package/dcolorcombo.d.tlua +54 -0
- package/dcolorcube.d.tlua +137 -0
- package/dcolormixer.d.tlua +303 -0
- package/dcolorpalette.d.tlua +294 -0
- package/dcolumnsheet.d.tlua +49 -0
- package/dcombobox.d.tlua +161 -0
- package/ddragbase.d.tlua +151 -0
- package/ddrawer.d.tlua +72 -0
- package/debug.d.tlua +236 -0
- package/debugoverlay.d.tlua +193 -0
- package/dentityproperties.d.tlua +63 -0
- package/derma.d.tlua +119 -0
- package/dexpandbutton.d.tlua +30 -0
- package/dfilebrowser.d.tlua +228 -0
- package/dform.d.tlua +176 -0
- package/dframe.d.tlua +261 -0
- package/dgrid.d.tlua +113 -0
- package/dhorizontaldivider.d.tlua +196 -0
- package/dhorizontalscroller.d.tlua +104 -0
- package/dhscrollbar.d.tlua +109 -0
- package/dhtml.d.tlua +91 -0
- package/dhtmlcontrols.d.tlua +62 -0
- package/diconbrowser.d.tlua +113 -0
- package/diconlayout.d.tlua +190 -0
- package/dimage.d.tlua +221 -0
- package/dimagebutton.d.tlua +103 -0
- package/dkillicon.d.tlua +9 -0
- package/dlabel.d.tlua +385 -0
- package/dlabeleditable.d.tlua +51 -0
- package/dlabelurl.d.tlua +100 -0
- package/dlistbox.d.tlua +82 -0
- package/dlistboxitem.d.tlua +42 -0
- package/dlistlayout.d.tlua +14 -0
- package/dlistview.d.tlua +360 -0
- package/dlistview_column.d.tlua +135 -0
- package/dlistview_columnplain.d.tlua +11 -0
- package/dlistview_draggerbar.d.tlua +11 -0
- package/dlistview_line.d.tlua +140 -0
- package/dlistviewheaderlabel.d.tlua +11 -0
- package/dlistviewlabel.d.tlua +11 -0
- package/dlistviewline.d.tlua +11 -0
- package/dmenu.d.tlua +266 -0
- package/dmenubar.d.tlua +42 -0
- package/dmenuoption.d.tlua +135 -0
- package/dmenuoptioncvar.d.tlua +64 -0
- package/dmodelpanel.d.tlua +207 -0
- package/dmodelselect.d.tlua +20 -0
- package/dmodelselectmulti.d.tlua +19 -0
- package/dnotify.d.tlua +93 -0
- package/dnumberscratch.d.tlua +284 -0
- package/dnumberwang.d.tlua +147 -0
- package/dnumpad.d.tlua +11 -0
- package/dnumslider.d.tlua +182 -0
- package/dpanel.d.tlua +152 -0
- package/dpanellist.d.tlua +109 -0
- package/dpaneloverlay.d.tlua +65 -0
- package/dpanelselect.d.tlua +13 -0
- package/dpanpanel.d.tlua +64 -0
- package/dprogress.d.tlua +27 -0
- package/dproperties.d.tlua +52 -0
- package/dproperty_boolean.d.tlua +12 -0
- package/dproperty_combo.d.tlua +31 -0
- package/dproperty_entity.d.tlua +12 -0
- package/dproperty_float.d.tlua +12 -0
- package/dproperty_generic.d.tlua +50 -0
- package/dproperty_int.d.tlua +12 -0
- package/dproperty_vectorcolor.d.tlua +14 -0
- package/dpropertysheet.d.tlua +167 -0
- package/dragndrop.d.tlua +123 -0
- package/draw.d.tlua +162 -0
- package/drgbpicker.d.tlua +49 -0
- package/drive.d.tlua +159 -0
- package/dscrollbargrip.d.tlua +13 -0
- package/dscrollpanel.d.tlua +110 -0
- package/dshape.d.tlua +72 -0
- package/dsizetocontents.d.tlua +46 -0
- package/dslider.d.tlua +302 -0
- package/dsprite.d.tlua +84 -0
- package/dtab.d.tlua +81 -0
- package/dtextentry.d.tlua +442 -0
- package/dtilelayout.d.tlua +218 -0
- package/dtooltip.d.tlua +76 -0
- package/dtree.d.tlua +185 -0
- package/dtree_node.d.tlua +793 -0
- package/dtree_node_button.d.tlua +13 -0
- package/duplicator.d.tlua +338 -0
- package/dverticaldivider.d.tlua +223 -0
- package/dvscrollbar.d.tlua +109 -0
- package/editablepanel.d.tlua +10 -0
- package/effect.d.tlua +121 -0
- package/effects.d.tlua +77 -0
- package/engine.d.tlua +248 -0
- package/entity.d.tlua +8295 -0
- package/ents.d.tlua +267 -0
- package/enums.d.tlua +7082 -0
- package/file.d.tlua +419 -0
- package/file_class.d.tlua +7 -0
- package/fingerposer.d.tlua +12 -0
- package/fingervar.d.tlua +13 -0
- package/frame.d.tlua +11 -0
- package/frame_blend.d.tlua +105 -0
- package/game.d.tlua +482 -0
- package/gameevent.d.tlua +968 -0
- package/gamemode.d.tlua +48 -0
- package/global.d.tlua +3156 -0
- package/gm.d.tlua +3218 -0
- package/gmod.d.tlua +20 -0
- package/gmsave.d.tlua +53 -0
- package/gui.d.tlua +232 -0
- package/gwen.d.tlua +55 -0
- package/halo.d.tlua +42 -0
- package/hammer.d.tlua +17 -0
- package/hook.d.tlua +64 -0
- package/html.d.tlua +22 -0
- package/http.d.tlua +72 -0
- package/iconeditor.d.tlua +130 -0
- package/igmodaudiochannel.d.tlua +419 -0
- package/imagecheckbox.d.tlua +48 -0
- package/imaterial.d.tlua +288 -0
- package/imesh.d.tlua +70 -0
- package/index.d.tlua +277 -0
- package/input.d.tlua +252 -0
- package/invalidateinternalentitycache.d.tlua +13 -0
- package/irestore.d.tlua +94 -0
- package/isave.d.tlua +94 -0
- package/itexture.d.tlua +108 -0
- package/ivideowriter.d.tlua +53 -0
- package/jit.d.tlua +243 -0
- package/killicon.d.tlua +84 -0
- package/label.d.tlua +20 -0
- package/language.d.tlua +26 -0
- package/list.d.tlua +112 -0
- package/makeballoon.d.tlua +15 -0
- package/markup.d.tlua +38 -0
- package/markupobject.d.tlua +53 -0
- package/material.d.tlua +9 -0
- package/math.d.tlua +899 -0
- package/matproxy.d.tlua +60 -0
- package/matselect.d.tlua +106 -0
- package/menu.d.tlua +20 -0
- package/menubar.d.tlua +39 -0
- package/mesh.d.tlua +183 -0
- package/modelimage.d.tlua +12 -0
- package/motionsensor.d.tlua +115 -0
- package/navmesh.d.tlua +274 -0
- package/net.d.tlua +639 -0
- package/nextbot.d.tlua +380 -0
- package/notification.d.tlua +35 -0
- package/npc.d.tlua +1787 -0
- package/numpad.d.tlua +89 -0
- package/os.d.tlua +56 -0
- package/package.d.tlua +15 -0
- package/package.json +18 -0
- package/panel.d.tlua +3650 -0
- package/panellist.d.tlua +13 -0
- package/pathfollower.d.tlua +301 -0
- package/permissions.d.tlua +77 -0
- package/physcollide.d.tlua +40 -0
- package/physenv.d.tlua +136 -0
- package/physobj.d.tlua +799 -0
- package/pixelvis_handle_t.d.tlua +9 -0
- package/player.d.tlua +3320 -0
- package/player_manager.d.tlua +147 -0
- package/preseteditor.d.tlua +13 -0
- package/presets.d.tlua +79 -0
- package/projectedtexture.d.tlua +553 -0
- package/properties.d.tlua +65 -0
- package/propselect.d.tlua +50 -0
- package/radiobutton.d.tlua +13 -0
- package/render.d.tlua +1700 -0
- package/resource.d.tlua +73 -0
- package/richtext.d.tlua +17 -0
- package/sandbox.d.tlua +576 -0
- package/saverestore.d.tlua +148 -0
- package/schedule.d.tlua +69 -0
- package/scripted_ents.d.tlua +124 -0
- package/search.d.tlua +26 -0
- package/serverlist.d.tlua +85 -0
- package/slidebar.d.tlua +12 -0
- package/slider.d.tlua +11 -0
- package/sound.d.tlua +140 -0
- package/spawnicon.d.tlua +95 -0
- package/spawnmenu.d.tlua +286 -0
- package/spawnmenucontentpanel.d.tlua +52 -0
- package/sql.d.tlua +154 -0
- package/stack.d.tlua +57 -0
- package/steamworks.d.tlua +208 -0
- package/string.d.tlua +535 -0
- package/structures.d.tlua +4442 -0
- package/surface.d.tlua +463 -0
- package/surfaceinfo.d.tlua +70 -0
- package/system.d.tlua +134 -0
- package/table.d.tlua +533 -0
- package/task.d.tlua +92 -0
- package/team.d.tlua +195 -0
- package/textentry.d.tlua +12 -0
- package/tgaimage.d.tlua +11 -0
- package/timer.d.tlua +198 -0
- package/tool.d.tlua +466 -0
- package/ugcpublishwindow.d.tlua +83 -0
- package/umsg.d.tlua +147 -0
- package/undo.d.tlua +122 -0
- package/urllabel.d.tlua +13 -0
- package/usermessage.d.tlua +48 -0
- package/utf8.d.tlua +89 -0
- package/util.d.tlua +1087 -0
- package/vector.d.tlua +413 -0
- package/vehicle.d.tlua +472 -0
- package/vgui.d.tlua +201 -0
- package/video.d.tlua +17 -0
- package/vmatrix.d.tlua +392 -0
- package/weapon.d.tlua +913 -0
- package/weapons.d.tlua +90 -0
- package/widgets.d.tlua +29 -0
- package/workshopfilebase.d.tlua +68 -0
package/math.d.tlua
ADDED
|
@@ -0,0 +1,899 @@
|
|
|
1
|
+
// AUTO-GENERATED tlua declarations. Do not edit by hand.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An easing library that allows you to interpolate with various kinds of smoothing [functions](https://easings.net/). To use with [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp), input what you would to the fraction argument in one of these easing functions and then the output of that into the [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) fraction argument.
|
|
5
|
+
*
|
|
6
|
+
* Example usage with Lerp and [math.ease.InSine](https://wiki.facepunch.com/gmod/math.ease.InSine)
|
|
7
|
+
*
|
|
8
|
+
* -- Define a wrapper function to make it easier to work with
|
|
9
|
+
* local function easedLerp(fraction, from, to)
|
|
10
|
+
* return Lerp(math.ease.InSine(fraction), from, to)
|
|
11
|
+
* end
|
|
12
|
+
*
|
|
13
|
+
* -- Compare with the non-eased version of Lerp
|
|
14
|
+
* print(easedLerp(0.25, 0, 1))
|
|
15
|
+
* print(Lerp(0.25, 0, 1))
|
|
16
|
+
*
|
|
17
|
+
* print(easedLerp(0.25, 0, 5))
|
|
18
|
+
* print(Lerp(0.25, 0, 5))
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
* ```
|
|
22
|
+
* 0.076120467488713
|
|
23
|
+
* 0.25
|
|
24
|
+
*
|
|
25
|
+
* 0.38060233744357
|
|
26
|
+
* 1.25
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
*
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
*
|
|
34
|
+
* A brief visual example of different easing methods
|
|
35
|
+
*
|
|
36
|
+
*
|
|
37
|
+
*
|
|
38
|
+
*
|
|
39
|
+
* @source https://wiki.facepunch.com/gmod/math.ease
|
|
40
|
+
*/
|
|
41
|
+
interface MathLib {
|
|
42
|
+
ease: MatheaseLib;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The math library is a standard Lua library that provides functions for manipulating numbers. In Garry's Mod several additional math functions have been added.
|
|
47
|
+
* @source https://wiki.facepunch.com/gmod/math
|
|
48
|
+
*/
|
|
49
|
+
interface MathLib {
|
|
50
|
+
/**
|
|
51
|
+
* Calculates the difference between two angles.
|
|
52
|
+
* @realm shared and menu
|
|
53
|
+
* @source https://wiki.facepunch.com/gmod/math.AngleDifference
|
|
54
|
+
*/
|
|
55
|
+
AngleDifference(a: number, b: number): number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface MathLib {
|
|
59
|
+
/**
|
|
60
|
+
* Gradually approaches the target value by the specified amount.
|
|
61
|
+
* @realm shared and menu
|
|
62
|
+
* @source https://wiki.facepunch.com/gmod/math.Approach
|
|
63
|
+
*/
|
|
64
|
+
Approach(current: number, target: number, change: number): number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface MathLib {
|
|
68
|
+
/**
|
|
69
|
+
* Increments an angle towards another by specified rate.
|
|
70
|
+
*
|
|
71
|
+
* **NOTE**: This function is for numbers representing angles (0-360), NOT [Angle](https://wiki.facepunch.com/gmod/Angle) objects!
|
|
72
|
+
*
|
|
73
|
+
*
|
|
74
|
+
* @realm shared and menu
|
|
75
|
+
* @source https://wiki.facepunch.com/gmod/math.ApproachAngle
|
|
76
|
+
*/
|
|
77
|
+
ApproachAngle(currentAngle: number, targetAngle: number, rate: number): number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
interface MathLib {
|
|
81
|
+
/**
|
|
82
|
+
* Basic code for Bézier-Spline algorithm.
|
|
83
|
+
* @realm shared and menu
|
|
84
|
+
* @source https://wiki.facepunch.com/gmod/math.BSplinePoint
|
|
85
|
+
*/
|
|
86
|
+
BSplinePoint(fraction: number, points: table, fractionMax: number): Vector;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface MathLib {
|
|
90
|
+
/**
|
|
91
|
+
* Converts a binary string into a number.
|
|
92
|
+
* @realm shared and menu
|
|
93
|
+
* @source https://wiki.facepunch.com/gmod/math.BinToInt
|
|
94
|
+
*/
|
|
95
|
+
BinToInt(string: string): number;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface MathLib {
|
|
99
|
+
/**
|
|
100
|
+
* Cubic Hermite spline algorithm.
|
|
101
|
+
* @realm shared and menu
|
|
102
|
+
* @source https://wiki.facepunch.com/gmod/math.CHSpline
|
|
103
|
+
*/
|
|
104
|
+
CHSpline(frac: number, point0: Vector, tan0: Vector, point1: Vector, tan1: Vector): Vector;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
interface MathLib {
|
|
108
|
+
/**
|
|
109
|
+
* Clamps a number between a minimum and maximum value.
|
|
110
|
+
* @realm shared and menu
|
|
111
|
+
* @source https://wiki.facepunch.com/gmod/math.Clamp
|
|
112
|
+
*/
|
|
113
|
+
Clamp(input: number, min: number, max: number): number;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
interface MathLib {
|
|
117
|
+
/**
|
|
118
|
+
* Lerp point between 4 control points with cubic bezier.
|
|
119
|
+
*
|
|
120
|
+
* See [math.QuadraticBezier](https://wiki.facepunch.com/gmod/math.QuadraticBezier) for a similar function which works with 3 control points.
|
|
121
|
+
*
|
|
122
|
+
* @realm shared and menu
|
|
123
|
+
* @source https://wiki.facepunch.com/gmod/math.CubicBezier
|
|
124
|
+
*/
|
|
125
|
+
CubicBezier(frac: number, p0: Vector, p1: Vector, p2: Vector, p3: Vector): Vector;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface MathLib {
|
|
129
|
+
/**
|
|
130
|
+
* Returns the difference between two points in 2D space. Alias of [math.Distance](https://wiki.facepunch.com/gmod/math.Distance).
|
|
131
|
+
*
|
|
132
|
+
* @realm shared and menu
|
|
133
|
+
* @source https://wiki.facepunch.com/gmod/math.Dist
|
|
134
|
+
* @deprecated You should use math.Distance instead
|
|
135
|
+
*/
|
|
136
|
+
Dist(x1: number, y1: number, x2: number, y2: number): number;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface MathLib {
|
|
140
|
+
/**
|
|
141
|
+
* Returns the difference between two points in 2D space.
|
|
142
|
+
* @realm shared and menu
|
|
143
|
+
* @source https://wiki.facepunch.com/gmod/math.Distance
|
|
144
|
+
*/
|
|
145
|
+
Distance(x1: number, y1: number, x2: number, y2: number): number;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
interface MathLib {
|
|
149
|
+
/**
|
|
150
|
+
* Returns the squared difference between two points in 2D space. This is computationally faster than [math.Distance](https://wiki.facepunch.com/gmod/math.Distance).
|
|
151
|
+
*
|
|
152
|
+
* @realm shared and menu
|
|
153
|
+
* @source https://wiki.facepunch.com/gmod/math.DistanceSqr
|
|
154
|
+
*/
|
|
155
|
+
DistanceSqr(x1: number, y1: number, x2: number, y2: number): number;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface MathLib {
|
|
159
|
+
/**
|
|
160
|
+
* Calculates the progress of a value fraction, taking in to account given easing fractions
|
|
161
|
+
* @realm shared and menu
|
|
162
|
+
* @source https://wiki.facepunch.com/gmod/math.EaseInOut
|
|
163
|
+
*/
|
|
164
|
+
EaseInOut(progress: number, easeIn?: number, easeOut?: number): number;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
interface MathLib {
|
|
168
|
+
/**
|
|
169
|
+
* Simple function that calculates [factorial](https://en.wikipedia.org/wiki/Factorial) of a whole number.
|
|
170
|
+
* @realm shared and menu
|
|
171
|
+
* @source https://wiki.facepunch.com/gmod/math.Factorial
|
|
172
|
+
*/
|
|
173
|
+
Factorial(val_in: number): number;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
interface MathLib {
|
|
177
|
+
/**
|
|
178
|
+
* Converts an integer to a binary (base-2) string.
|
|
179
|
+
* @realm shared and menu
|
|
180
|
+
* @source https://wiki.facepunch.com/gmod/math.IntToBin
|
|
181
|
+
*/
|
|
182
|
+
IntToBin(int: number): string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
interface MathLib {
|
|
186
|
+
/**
|
|
187
|
+
* Checks if two floating point numbers are nearly equal.
|
|
188
|
+
*
|
|
189
|
+
* This is useful to mitigate [accuracy issues in floating point numbers](https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems). See examples below.
|
|
190
|
+
*
|
|
191
|
+
*
|
|
192
|
+
* @realm shared and menu
|
|
193
|
+
* @source https://wiki.facepunch.com/gmod/math.IsNearlyEqual
|
|
194
|
+
*/
|
|
195
|
+
IsNearlyEqual(a: number, b: number, tolerance?: number): boolean;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
interface MathLib {
|
|
199
|
+
/**
|
|
200
|
+
* Normalizes angle, so it returns value between -180 and 180.
|
|
201
|
+
* @realm shared and menu
|
|
202
|
+
* @source https://wiki.facepunch.com/gmod/math.NormalizeAngle
|
|
203
|
+
*/
|
|
204
|
+
NormalizeAngle(angle: number): number;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
interface MathLib {
|
|
208
|
+
/**
|
|
209
|
+
* Lerp point between 3 control points with quadratic bezier.
|
|
210
|
+
*
|
|
211
|
+
* See [math.CubicBezier](https://wiki.facepunch.com/gmod/math.CubicBezier) for a function which works with 4 control points.
|
|
212
|
+
*
|
|
213
|
+
* @realm shared and menu
|
|
214
|
+
* @source https://wiki.facepunch.com/gmod/math.QuadraticBezier
|
|
215
|
+
*/
|
|
216
|
+
QuadraticBezier(frac: number, p0: Vector, p1: Vector, p2: Vector): Vector;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
interface MathLib {
|
|
220
|
+
/**
|
|
221
|
+
* Returns a random float between min and max.
|
|
222
|
+
*
|
|
223
|
+
* See also [math.random](https://wiki.facepunch.com/gmod/math.random)
|
|
224
|
+
*
|
|
225
|
+
* @realm shared and menu
|
|
226
|
+
* @source https://wiki.facepunch.com/gmod/math.Rand
|
|
227
|
+
*/
|
|
228
|
+
Rand(min: number, max: number): number;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
interface MathLib {
|
|
232
|
+
/**
|
|
233
|
+
* Remaps the value from one range to another
|
|
234
|
+
* @realm shared and menu
|
|
235
|
+
* @source https://wiki.facepunch.com/gmod/math.Remap
|
|
236
|
+
*/
|
|
237
|
+
Remap(value: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
interface MathLib {
|
|
241
|
+
/**
|
|
242
|
+
* Rounds the given value to the nearest whole number or to the given decimal places.
|
|
243
|
+
* @realm shared and menu
|
|
244
|
+
* @source https://wiki.facepunch.com/gmod/math.Round
|
|
245
|
+
*/
|
|
246
|
+
Round(value: number, decimals?: number): number;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
interface MathLib {
|
|
250
|
+
/**
|
|
251
|
+
* Returns the mathematical negative/positive sign of the input number.
|
|
252
|
+
*
|
|
253
|
+
* @realm shared and menu
|
|
254
|
+
* @source https://wiki.facepunch.com/gmod/math.Sign
|
|
255
|
+
*/
|
|
256
|
+
Sign(value: number): number;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
interface MathLib {
|
|
260
|
+
/**
|
|
261
|
+
* Snaps a number to the closest multiplicative of given number. See also [Angle:SnapTo](https://wiki.facepunch.com/gmod/Angle:SnapTo).
|
|
262
|
+
* @realm shared and menu
|
|
263
|
+
* @source https://wiki.facepunch.com/gmod/math.SnapTo
|
|
264
|
+
*/
|
|
265
|
+
SnapTo(input: number, snapTo: number): number;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
interface MathLib {
|
|
269
|
+
/**
|
|
270
|
+
* Returns the fraction of where the current time is relative to the start and end times
|
|
271
|
+
* @realm shared and menu
|
|
272
|
+
* @source https://wiki.facepunch.com/gmod/math.TimeFraction
|
|
273
|
+
*/
|
|
274
|
+
TimeFraction(start: number, _end: number, current: number): number;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
interface MathLib {
|
|
278
|
+
/**
|
|
279
|
+
* Trim unwanted decimal places.
|
|
280
|
+
* @realm shared and menu
|
|
281
|
+
* @source https://wiki.facepunch.com/gmod/math.Truncate
|
|
282
|
+
*/
|
|
283
|
+
Truncate(num: number, digits?: number): number;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
interface MathLib {
|
|
287
|
+
/**
|
|
288
|
+
* Calculates the absolute value of a number (effectively removes any negative sign).
|
|
289
|
+
* @realm shared and menu
|
|
290
|
+
* @source https://wiki.facepunch.com/gmod/math.abs
|
|
291
|
+
*/
|
|
292
|
+
abs(x: number): number;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
interface MathLib {
|
|
296
|
+
/**
|
|
297
|
+
* Returns the [arccosine](https://en.wikipedia.org/wiki/Arccosine) of the given number.
|
|
298
|
+
* @realm shared and menu
|
|
299
|
+
* @source https://wiki.facepunch.com/gmod/math.acos
|
|
300
|
+
*/
|
|
301
|
+
acos(cos: number): number;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
interface MathLib {
|
|
305
|
+
/**
|
|
306
|
+
* Returns the [arcsine](https://en.wikipedia.org/wiki/Inverse_trigonometric_functions) of the given number.
|
|
307
|
+
* @realm shared and menu
|
|
308
|
+
* @source https://wiki.facepunch.com/gmod/math.asin
|
|
309
|
+
*/
|
|
310
|
+
asin(normal: number): number;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
interface MathLib {
|
|
314
|
+
/**
|
|
315
|
+
* Returns the [arctangent](https://en.wikipedia.org/wiki/Inverse_trigonometric_functions) of the given number.
|
|
316
|
+
* @realm shared and menu
|
|
317
|
+
* @source https://wiki.facepunch.com/gmod/math.atan
|
|
318
|
+
*/
|
|
319
|
+
atan(normal: number): number;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
interface MathLib {
|
|
323
|
+
/**
|
|
324
|
+
* functions like [math.atan](https://wiki.facepunch.com/gmod/math.atan)(y / x), except it also takes into account the quadrant of the angle and so doesn't have a limited range of output.
|
|
325
|
+
*
|
|
326
|
+
* **NOTE**: The Y argument comes first!
|
|
327
|
+
*
|
|
328
|
+
*
|
|
329
|
+
* @realm shared and menu
|
|
330
|
+
* @source https://wiki.facepunch.com/gmod/math.atan2
|
|
331
|
+
*/
|
|
332
|
+
atan2(y: number, x: number): number;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
interface MathLib {
|
|
336
|
+
/**
|
|
337
|
+
* **INTERNAL**: Use [math.BSplinePoint](https://wiki.facepunch.com/gmod/math.BSplinePoint) instead.
|
|
338
|
+
*
|
|
339
|
+
*
|
|
340
|
+
* Basic code for Bezier-Spline algorithm, helper function for [math.BSplinePoint](https://wiki.facepunch.com/gmod/math.BSplinePoint).
|
|
341
|
+
*
|
|
342
|
+
* @realm shared and menu
|
|
343
|
+
* @source https://wiki.facepunch.com/gmod/math.calcBSplineN
|
|
344
|
+
*/
|
|
345
|
+
calcBSplineN(i: number, k: number, t: number, tinc: number): number;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
interface MathLib {
|
|
349
|
+
/**
|
|
350
|
+
* Ceils or rounds a number up.
|
|
351
|
+
*
|
|
352
|
+
* See [math.floor](https://wiki.facepunch.com/gmod/math.floor) for the inverse of this function.
|
|
353
|
+
* @realm shared and menu
|
|
354
|
+
* @source https://wiki.facepunch.com/gmod/math.ceil
|
|
355
|
+
*/
|
|
356
|
+
ceil(number: number): number;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
interface MathLib {
|
|
360
|
+
/**
|
|
361
|
+
* Returns the [cosine](https://en.wikipedia.org/wiki/Trigonometric_functions#cos) of given angle.
|
|
362
|
+
* @realm shared and menu
|
|
363
|
+
* @source https://wiki.facepunch.com/gmod/math.cos
|
|
364
|
+
*/
|
|
365
|
+
cos(number: number): number;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
interface MathLib {
|
|
369
|
+
/**
|
|
370
|
+
* Returns the [hyperbolic cosine](https://en.wikipedia.org/wiki/Cosh_(mathematical_function)) of the given angle.
|
|
371
|
+
* @realm shared and menu
|
|
372
|
+
* @source https://wiki.facepunch.com/gmod/math.cosh
|
|
373
|
+
*/
|
|
374
|
+
cosh(number: number): number;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
interface MathLib {
|
|
378
|
+
/**
|
|
379
|
+
* Converts radians to degrees.
|
|
380
|
+
* @realm shared and menu
|
|
381
|
+
* @source https://wiki.facepunch.com/gmod/math.deg
|
|
382
|
+
*/
|
|
383
|
+
deg(radians: number): number;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
interface MatheaseLib {
|
|
387
|
+
/**
|
|
388
|
+
* Eases in by reversing the direction of the ease slightly before returning.
|
|
389
|
+
* **NOTE**: This doesn't work properly when used with [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) as it clamps the fraction between 0 and 1. Using your own version of [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) that is unclamped would be necessary instead.
|
|
390
|
+
*
|
|
391
|
+
*
|
|
392
|
+
* @realm shared and menu
|
|
393
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InBack
|
|
394
|
+
*/
|
|
395
|
+
InBack(fraction: number): number;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
interface MatheaseLib {
|
|
399
|
+
/**
|
|
400
|
+
* Eases in like a bouncy ball.
|
|
401
|
+
* **NOTE**: This doesn't work properly when used with [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) as it clamps the fraction between 0 and 1. Using your own version of [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) that is unclamped would be necessary instead.
|
|
402
|
+
*
|
|
403
|
+
*
|
|
404
|
+
* @realm shared and menu
|
|
405
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InBounce
|
|
406
|
+
*/
|
|
407
|
+
InBounce(fraction: number): number;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
interface MatheaseLib {
|
|
411
|
+
/**
|
|
412
|
+
* Eases in using a circular function.
|
|
413
|
+
* @realm shared and menu
|
|
414
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InCirc
|
|
415
|
+
*/
|
|
416
|
+
InCirc(fraction: number): number;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
interface MatheaseLib {
|
|
420
|
+
/**
|
|
421
|
+
* Eases in by cubing the fraction.
|
|
422
|
+
* @realm shared and menu
|
|
423
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InCubic
|
|
424
|
+
*/
|
|
425
|
+
InCubic(fraction: number): number;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
interface MatheaseLib {
|
|
429
|
+
/**
|
|
430
|
+
* Eases in like a rubber band.
|
|
431
|
+
* **NOTE**: This doesn't work properly when used with [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) as it clamps the fraction between 0 and 1. Using your own version of [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) that is unclamped would be necessary instead.
|
|
432
|
+
*
|
|
433
|
+
*
|
|
434
|
+
* @realm shared and menu
|
|
435
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InElastic
|
|
436
|
+
*/
|
|
437
|
+
InElastic(fraction: number): number;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
interface MatheaseLib {
|
|
441
|
+
/**
|
|
442
|
+
* Eases in using an exponential equation with a base of 2 and where the fraction is used in the exponent.
|
|
443
|
+
* @realm shared and menu
|
|
444
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InExpo
|
|
445
|
+
*/
|
|
446
|
+
InExpo(fraction: number): number;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
interface MatheaseLib {
|
|
450
|
+
/**
|
|
451
|
+
* Eases in and out by reversing the direction of the ease slightly before returning on both ends.
|
|
452
|
+
* **NOTE**: This doesn't work properly when used with [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) as it clamps the fraction between 0 and 1. Using your own version of [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) that is unclamped would be necessary instead.
|
|
453
|
+
*
|
|
454
|
+
*
|
|
455
|
+
* @realm shared and menu
|
|
456
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InOutBack
|
|
457
|
+
*/
|
|
458
|
+
InOutBack(fraction: number): number;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
interface MatheaseLib {
|
|
462
|
+
/**
|
|
463
|
+
* Eases in and out like a bouncy ball.
|
|
464
|
+
* **NOTE**: This doesn't work properly when used with [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) as it clamps the fraction between 0 and 1. Using your own version of [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) that is unclamped would be necessary instead.
|
|
465
|
+
*
|
|
466
|
+
*
|
|
467
|
+
* @realm shared and menu
|
|
468
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InOutBounce
|
|
469
|
+
*/
|
|
470
|
+
InOutBounce(fraction: number): number;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
interface MatheaseLib {
|
|
474
|
+
/**
|
|
475
|
+
* Eases in and out using a circular function.
|
|
476
|
+
* @realm shared and menu
|
|
477
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InOutCirc
|
|
478
|
+
*/
|
|
479
|
+
InOutCirc(fraction: number): number;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
interface MatheaseLib {
|
|
483
|
+
/**
|
|
484
|
+
* Eases in and out by cubing the fraction.
|
|
485
|
+
* @realm shared and menu
|
|
486
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InOutCubic
|
|
487
|
+
*/
|
|
488
|
+
InOutCubic(fraction: number): number;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
interface MatheaseLib {
|
|
492
|
+
/**
|
|
493
|
+
* Eases in and out like a rubber band.
|
|
494
|
+
* **NOTE**: This doesn't work properly when used with [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) as it clamps the fraction between 0 and 1. Using your own version of [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) that is unclamped would be necessary instead.
|
|
495
|
+
*
|
|
496
|
+
*
|
|
497
|
+
* @realm shared and menu
|
|
498
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InOutElastic
|
|
499
|
+
*/
|
|
500
|
+
InOutElastic(fraction: number): number;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
interface MatheaseLib {
|
|
504
|
+
/**
|
|
505
|
+
* Eases in and out using an exponential equation with a base of 2 and where the fraction is used in the exponent.
|
|
506
|
+
* @realm shared and menu
|
|
507
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InOutExpo
|
|
508
|
+
*/
|
|
509
|
+
InOutExpo(fraction: number): number;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
interface MatheaseLib {
|
|
513
|
+
/**
|
|
514
|
+
* Eases in and out by squaring the fraction.
|
|
515
|
+
* @realm shared and menu
|
|
516
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InOutQuad
|
|
517
|
+
*/
|
|
518
|
+
InOutQuad(fraction: number): number;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
interface MatheaseLib {
|
|
522
|
+
/**
|
|
523
|
+
* Eases in and out by raising the fraction to the power of 4.
|
|
524
|
+
* @realm shared and menu
|
|
525
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InOutQuart
|
|
526
|
+
*/
|
|
527
|
+
InOutQuart(fraction: number): number;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
interface MatheaseLib {
|
|
531
|
+
/**
|
|
532
|
+
* Eases in and out by raising the fraction to the power of 5.
|
|
533
|
+
* @realm shared and menu
|
|
534
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InOutQuint
|
|
535
|
+
*/
|
|
536
|
+
InOutQuint(fraction: number): number;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
interface MatheaseLib {
|
|
540
|
+
/**
|
|
541
|
+
* Eases in and out using [math.sin](https://wiki.facepunch.com/gmod/math.sin).
|
|
542
|
+
* @realm shared and menu
|
|
543
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InOutSine
|
|
544
|
+
*/
|
|
545
|
+
InOutSine(fraction: number): number;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
interface MatheaseLib {
|
|
549
|
+
/**
|
|
550
|
+
* Eases in by squaring the fraction.
|
|
551
|
+
* @realm shared and menu
|
|
552
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InQuad
|
|
553
|
+
*/
|
|
554
|
+
InQuad(fraction: number): number;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
interface MatheaseLib {
|
|
558
|
+
/**
|
|
559
|
+
* Eases in by raising the fraction to the power of 4.
|
|
560
|
+
* @realm shared and menu
|
|
561
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InQuart
|
|
562
|
+
*/
|
|
563
|
+
InQuart(fraction: number): number;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
interface MatheaseLib {
|
|
567
|
+
/**
|
|
568
|
+
* Eases in by raising the fraction to the power of 5.
|
|
569
|
+
* @realm shared and menu
|
|
570
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InQuint
|
|
571
|
+
*/
|
|
572
|
+
InQuint(fraction: number): number;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
interface MatheaseLib {
|
|
576
|
+
/**
|
|
577
|
+
* Eases in using [math.sin](https://wiki.facepunch.com/gmod/math.sin).
|
|
578
|
+
* @realm shared and menu
|
|
579
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.InSine
|
|
580
|
+
*/
|
|
581
|
+
InSine(fraction: number): number;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
interface MatheaseLib {
|
|
585
|
+
/**
|
|
586
|
+
* Eases out by reversing the direction of the ease slightly before finishing.
|
|
587
|
+
* **NOTE**: This doesn't work properly when used with [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) as it clamps the fraction between 0 and 1. Using your own version of [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) that is unclamped would be necessary instead.
|
|
588
|
+
*
|
|
589
|
+
*
|
|
590
|
+
* @realm shared and menu
|
|
591
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.OutBack
|
|
592
|
+
*/
|
|
593
|
+
OutBack(fraction: number): number;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
interface MatheaseLib {
|
|
597
|
+
/**
|
|
598
|
+
* Eases out like a bouncy ball.
|
|
599
|
+
* **NOTE**: This doesn't work properly when used with [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) as it clamps the fraction between 0 and 1. Using your own version of [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) that is unclamped would be necessary instead.
|
|
600
|
+
*
|
|
601
|
+
*
|
|
602
|
+
* @realm shared and menu
|
|
603
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.OutBounce
|
|
604
|
+
*/
|
|
605
|
+
OutBounce(fraction: number): number;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
interface MatheaseLib {
|
|
609
|
+
/**
|
|
610
|
+
* Eases out using a circular function.
|
|
611
|
+
* @realm shared and menu
|
|
612
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.OutCirc
|
|
613
|
+
*/
|
|
614
|
+
OutCirc(fraction: number): number;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
interface MatheaseLib {
|
|
618
|
+
/**
|
|
619
|
+
* Eases out by cubing the fraction.
|
|
620
|
+
* @realm shared and menu
|
|
621
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.OutCubic
|
|
622
|
+
*/
|
|
623
|
+
OutCubic(fraction: number): number;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
interface MatheaseLib {
|
|
627
|
+
/**
|
|
628
|
+
* Eases out like a rubber band.
|
|
629
|
+
* **NOTE**: This doesn't work properly when used with [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) as it clamps the fraction between 0 and 1. Using your own version of [Global.Lerp](https://wiki.facepunch.com/gmod/Global.Lerp) that is unclamped would be necessary instead.
|
|
630
|
+
*
|
|
631
|
+
*
|
|
632
|
+
* @realm shared and menu
|
|
633
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.OutElastic
|
|
634
|
+
*/
|
|
635
|
+
OutElastic(fraction: number): number;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
interface MatheaseLib {
|
|
639
|
+
/**
|
|
640
|
+
* Eases out using an exponential equation with a base of 2 and where the fraction is used in the exponent.
|
|
641
|
+
* @realm shared and menu
|
|
642
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.OutExpo
|
|
643
|
+
*/
|
|
644
|
+
OutExpo(fraction: number): number;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
interface MatheaseLib {
|
|
648
|
+
/**
|
|
649
|
+
* Eases out by squaring the fraction.
|
|
650
|
+
* @realm shared and menu
|
|
651
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.OutQuad
|
|
652
|
+
*/
|
|
653
|
+
OutQuad(fraction: number): number;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
interface MatheaseLib {
|
|
657
|
+
/**
|
|
658
|
+
* Eases out by raising the fraction to the power of 4.
|
|
659
|
+
* @realm shared and menu
|
|
660
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.OutQuart
|
|
661
|
+
*/
|
|
662
|
+
OutQuart(fraction: number): number;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
interface MatheaseLib {
|
|
666
|
+
/**
|
|
667
|
+
* Eases out by raising the fraction to the power of 5.
|
|
668
|
+
* @realm shared and menu
|
|
669
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.OutQuint
|
|
670
|
+
*/
|
|
671
|
+
OutQuint(fraction: number): number;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
interface MatheaseLib {
|
|
675
|
+
/**
|
|
676
|
+
* Eases out using [math.sin](https://wiki.facepunch.com/gmod/math.sin).
|
|
677
|
+
* @realm shared and menu
|
|
678
|
+
* @source https://wiki.facepunch.com/gmod/math.ease.OutSine
|
|
679
|
+
*/
|
|
680
|
+
OutSine(fraction: number): number;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
interface MathLib {
|
|
684
|
+
/**
|
|
685
|
+
* Returns e to the power of the input.
|
|
686
|
+
* @realm shared and menu
|
|
687
|
+
* @source https://wiki.facepunch.com/gmod/math.exp
|
|
688
|
+
*/
|
|
689
|
+
exp(exponent: number): number;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
interface MathLib {
|
|
693
|
+
/**
|
|
694
|
+
* Floors or rounds a number down.
|
|
695
|
+
*
|
|
696
|
+
* See [math.ceil](https://wiki.facepunch.com/gmod/math.ceil) for the inverse of this function.
|
|
697
|
+
* @realm shared and menu
|
|
698
|
+
* @source https://wiki.facepunch.com/gmod/math.floor
|
|
699
|
+
*/
|
|
700
|
+
floor(number: number): number;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
interface MathLib {
|
|
704
|
+
/**
|
|
705
|
+
* Returns the modulus of the specified values.
|
|
706
|
+
*
|
|
707
|
+
* While this is similar to the `%` operator, **it will return a negative value if the first argument is negative**, whereas the % operator will return a **positive** value **even if the first operand is negative**.
|
|
708
|
+
*
|
|
709
|
+
* This function is also slower than the `%` operator.
|
|
710
|
+
*
|
|
711
|
+
* @realm shared and menu
|
|
712
|
+
* @source https://wiki.facepunch.com/gmod/math.fmod
|
|
713
|
+
*/
|
|
714
|
+
fmod(base: number, modulator: number): number;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
interface MathLib {
|
|
718
|
+
/**
|
|
719
|
+
* **Lua reference description**: Returns `m` and `e` such that `x = m2e`, `e` is an integer and the absolute value of `m` is in the range ((0.5, 1) (or zero when x is zero).
|
|
720
|
+
*
|
|
721
|
+
* Used to split the number value into a normalized fraction and an exponent. Two values are returned: the first is a multiplier in the range `1/2` (**inclusive**) to `1` (**exclusive**) and the second is an integer exponent.
|
|
722
|
+
*
|
|
723
|
+
* The result is such that `x = m*2^e`.
|
|
724
|
+
*
|
|
725
|
+
* @realm shared and menu
|
|
726
|
+
* @source https://wiki.facepunch.com/gmod/math.frexp
|
|
727
|
+
*/
|
|
728
|
+
frexp(x: number): (number, number);
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
interface MathLib {
|
|
732
|
+
/**
|
|
733
|
+
* Takes a normalised number and returns the floating point representation.
|
|
734
|
+
*
|
|
735
|
+
* Effectively it returns the result of `normalizedFraction * 2.0 ^ exponent`. [math.frexp](https://wiki.facepunch.com/gmod/math.frexp) is the opposite function.
|
|
736
|
+
*
|
|
737
|
+
* @realm shared and menu
|
|
738
|
+
* @source https://wiki.facepunch.com/gmod/math.ldexp
|
|
739
|
+
*/
|
|
740
|
+
ldexp(normalizedFraction: number, exponent: number): number;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
interface MathLib {
|
|
744
|
+
/**
|
|
745
|
+
* With one argument, return the natural logarithm of x (to base e).
|
|
746
|
+
*
|
|
747
|
+
* With two arguments, return the logarithm of x to the given base, calculated as log(x)/log(base).
|
|
748
|
+
*
|
|
749
|
+
* @realm shared and menu
|
|
750
|
+
* @source https://wiki.facepunch.com/gmod/math.log
|
|
751
|
+
*/
|
|
752
|
+
log(x: number, base?: number): number;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
interface MathLib {
|
|
756
|
+
/**
|
|
757
|
+
* Returns the base-10 logarithm of x. This is usually more accurate than math.log(x, 10).
|
|
758
|
+
* @realm shared and menu
|
|
759
|
+
* @source https://wiki.facepunch.com/gmod/math.log10
|
|
760
|
+
*/
|
|
761
|
+
log10(x: number): number;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
interface MathLib {
|
|
765
|
+
/**
|
|
766
|
+
* Returns the largest value of all arguments.
|
|
767
|
+
* @realm shared and menu
|
|
768
|
+
* @source https://wiki.facepunch.com/gmod/math.max
|
|
769
|
+
*/
|
|
770
|
+
max(...: any): number;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
interface MathLib {
|
|
774
|
+
/**
|
|
775
|
+
* Returns the smallest value of all arguments.
|
|
776
|
+
* @realm shared and menu
|
|
777
|
+
* @source https://wiki.facepunch.com/gmod/math.min
|
|
778
|
+
*/
|
|
779
|
+
min(...: any): number;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
interface MathLib {
|
|
783
|
+
/**
|
|
784
|
+
* Returns the modulus of the specified values. Same as [math.fmod](https://wiki.facepunch.com/gmod/math.fmod).
|
|
785
|
+
*
|
|
786
|
+
* @realm shared and menu
|
|
787
|
+
* @source https://wiki.facepunch.com/gmod/math.mod
|
|
788
|
+
* @deprecated This is removed in Lua versions later than what GMod is currently using. You should use the % operator or math.fmod instead.
|
|
789
|
+
*/
|
|
790
|
+
mod(base: number, modulator: number): number;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
interface MathLib {
|
|
794
|
+
/**
|
|
795
|
+
* Returns the integral and fractional component of the modulo operation.
|
|
796
|
+
* @realm shared and menu
|
|
797
|
+
* @source https://wiki.facepunch.com/gmod/math.modf
|
|
798
|
+
*/
|
|
799
|
+
modf(base: number): (number, number);
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
interface MathLib {
|
|
803
|
+
/**
|
|
804
|
+
* Returns x raised to the power y.
|
|
805
|
+
* In particular, math.pow(1.0, x) and math.pow(x, 0.0) always return 1.0, even when x is a zero or a [nan](https://wiki.facepunch.com/gmod/nan). If both x and y are finite, x is negative, and y is not an integer then math.pow(x, y) is undefined.
|
|
806
|
+
*
|
|
807
|
+
* @realm shared and menu
|
|
808
|
+
* @source https://wiki.facepunch.com/gmod/math.pow
|
|
809
|
+
*/
|
|
810
|
+
pow(x: number, y: number): number;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
interface MathLib {
|
|
814
|
+
/**
|
|
815
|
+
* Converts an angle in degrees to it's equivalent in radians.
|
|
816
|
+
* @realm shared and menu
|
|
817
|
+
* @source https://wiki.facepunch.com/gmod/math.rad
|
|
818
|
+
*/
|
|
819
|
+
rad(degrees: number): number;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
interface MathLib {
|
|
823
|
+
/**
|
|
824
|
+
* When called without arguments, returns a uniform pseudo-random real number in the range 0 to 1 which includes 0 but excludes 1.
|
|
825
|
+
*
|
|
826
|
+
* When called with an integer number m, returns a uniform pseudo-random integer in the range 1 to m inclusive.
|
|
827
|
+
*
|
|
828
|
+
* When called with two integer numbers m and n, returns a uniform pseudo-random integer in the range m to n inclusive.
|
|
829
|
+
*
|
|
830
|
+
* See also [math.Rand](https://wiki.facepunch.com/gmod/math.Rand)
|
|
831
|
+
*
|
|
832
|
+
* @realm shared and menu
|
|
833
|
+
* @source https://wiki.facepunch.com/gmod/math.random
|
|
834
|
+
*/
|
|
835
|
+
random(m?: number, n?: number): number;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
interface MathLib {
|
|
839
|
+
/**
|
|
840
|
+
* Seeds the random number generator. The same seed will guarantee the same sequence of numbers each time with [math.random](https://wiki.facepunch.com/gmod/math.random).
|
|
841
|
+
*
|
|
842
|
+
* For shared random values across predicted realms, use [util.SharedRandom](https://wiki.facepunch.com/gmod/util.SharedRandom).
|
|
843
|
+
*
|
|
844
|
+
* **WARNING**: Usage of this function affects **ALL** random numbers in the game. This means that improper use (such as setting the seed to a static value that doesn't change with time) can negatively affect other addons or the base game.
|
|
845
|
+
*
|
|
846
|
+
* It is a good idea to set the seed back to at least something like [Global.SysTime](https://wiki.facepunch.com/gmod/Global.SysTime) in those cases.
|
|
847
|
+
*
|
|
848
|
+
*
|
|
849
|
+
* @realm shared and menu
|
|
850
|
+
* @source https://wiki.facepunch.com/gmod/math.randomseed
|
|
851
|
+
*/
|
|
852
|
+
randomseed(seed: number): void;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
interface MathLib {
|
|
856
|
+
/**
|
|
857
|
+
* Returns the [sine](https://en.wikipedia.org/wiki/Trigonometric_functions) of given angle.
|
|
858
|
+
* @realm shared and menu
|
|
859
|
+
* @source https://wiki.facepunch.com/gmod/math.sin
|
|
860
|
+
*/
|
|
861
|
+
sin(number: number): number;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
interface MathLib {
|
|
865
|
+
/**
|
|
866
|
+
* Returns the [hyperbolic sine](https://en.wikipedia.org/wiki/Hyperbolic_functions) of the given angle.
|
|
867
|
+
* @realm shared and menu
|
|
868
|
+
* @source https://wiki.facepunch.com/gmod/math.sinh
|
|
869
|
+
*/
|
|
870
|
+
sinh(number: number): number;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
interface MathLib {
|
|
874
|
+
/**
|
|
875
|
+
* Returns the square root of the number.
|
|
876
|
+
* @realm shared and menu
|
|
877
|
+
* @source https://wiki.facepunch.com/gmod/math.sqrt
|
|
878
|
+
*/
|
|
879
|
+
sqrt(value: number): number;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
interface MathLib {
|
|
883
|
+
/**
|
|
884
|
+
* Returns the tangent of the given angle.
|
|
885
|
+
* @realm shared and menu
|
|
886
|
+
* @source https://wiki.facepunch.com/gmod/math.tan
|
|
887
|
+
*/
|
|
888
|
+
tan(value: number): number;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
interface MathLib {
|
|
892
|
+
/**
|
|
893
|
+
* Returns the [hyperbolic tangent](https://en.wikipedia.org/wiki/Hyperbolic_functions) of the given number.
|
|
894
|
+
* @realm shared and menu
|
|
895
|
+
* @source https://wiki.facepunch.com/gmod/math.tanh
|
|
896
|
+
*/
|
|
897
|
+
tanh(number: number): number;
|
|
898
|
+
}
|
|
899
|
+
|