Ran mddoc, new procs
This commit is contained in:
parent
9602785efe
commit
a394c4170c
1 changed files with 45 additions and 31 deletions
76
README.md
76
README.md
|
@ -18,6 +18,14 @@ Clamps n to min, else returns max if n is higher.
|
||||||
proc clamp(n, min, max: float32): float32
|
proc clamp(n, min, max: float32): float32
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## **proc** between
|
||||||
|
|
||||||
|
Returns true if value is between min and max or equal to them.
|
||||||
|
|
||||||
|
```nim
|
||||||
|
proc between(value, min, max: float32): bool
|
||||||
|
```
|
||||||
|
|
||||||
## **proc** sign
|
## **proc** sign
|
||||||
|
|
||||||
Returns the sign of a number, -1 or 1.
|
Returns the sign of a number, -1 or 1.
|
||||||
|
@ -41,8 +49,6 @@ Interpolates value between a and b.
|
||||||
* 1 -> b
|
* 1 -> b
|
||||||
* 0.5 -> between a and b
|
* 0.5 -> between a and b
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
proc lerp(a: float32; b: float32; v: float32): float32
|
proc lerp(a: float32; b: float32; v: float32): float32
|
||||||
```
|
```
|
||||||
|
@ -53,9 +59,8 @@ proc lerp(a: float32; b: float32; v: float32): float32
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
Vec2 = object
|
Vec2 = object
|
||||||
x*: float32
|
x*: float32
|
||||||
y*: float32
|
y*: float32
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## **proc** vec2
|
## **proc** vec2
|
||||||
|
@ -308,10 +313,9 @@ proc turnAngle(a, b, speed: float32): float32
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
Vec3 = object
|
Vec3 = object
|
||||||
x*: float32
|
x*: float32
|
||||||
y*: float32
|
y*: float32
|
||||||
z*: float32
|
z*: float32
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## **proc** vec3
|
## **proc** vec3
|
||||||
|
@ -608,11 +612,10 @@ proc `$`(a: Vec3): string
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
Vec4 = object
|
Vec4 = object
|
||||||
x*: float32
|
x*: float32
|
||||||
y*: float32
|
y*: float32
|
||||||
z*: float32
|
z*: float32
|
||||||
w*: float32
|
w*: float32
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## **proc** vec4
|
## **proc** vec4
|
||||||
|
@ -1056,11 +1059,10 @@ proc `$`(a: Mat4): string
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
Quat = object
|
Quat = object
|
||||||
x*: float32
|
x*: float32
|
||||||
y*: float32
|
y*: float32
|
||||||
z*: float32
|
z*: float32
|
||||||
w*: float32
|
w*: float32
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## **proc** quat
|
## **proc** quat
|
||||||
|
@ -1239,11 +1241,10 @@ proc scaleMat(scale: float32): Mat4
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
Rect = object
|
Rect = object
|
||||||
x*: float32
|
x*: float32
|
||||||
y*: float32
|
y*: float32
|
||||||
w*: float32
|
w*: float32
|
||||||
h*: float32
|
h*: float32
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## **proc** rect
|
## **proc** rect
|
||||||
|
@ -1294,10 +1295,7 @@ proc wh=(rect: var Rect; v: Vec2)
|
||||||
|
|
||||||
## **proc** `*`
|
## **proc** `*`
|
||||||
|
|
||||||
|
* all elements of a Rect.
|
||||||
* all elements of a Rect.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
proc `*`(r: Rect; v: float): Rect
|
proc `*`(r: Rect; v: float): Rect
|
||||||
|
@ -1311,12 +1309,12 @@ proc `*`(r: Rect; v: float): Rect
|
||||||
proc `/`(r: Rect; v: float): Rect
|
proc `/`(r: Rect; v: float): Rect
|
||||||
```
|
```
|
||||||
|
|
||||||
## **proc** intersects
|
## **proc** `+`
|
||||||
|
|
||||||
Checks if pos is inside rect.
|
Add two boxes together.
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
proc intersects(rect: Rect; pos: Vec2): bool
|
proc `+`(a, b: Rect): Rect
|
||||||
```
|
```
|
||||||
|
|
||||||
## **proc** `$`
|
## **proc** `$`
|
||||||
|
@ -1325,3 +1323,19 @@ proc intersects(rect: Rect; pos: Vec2): bool
|
||||||
```nim
|
```nim
|
||||||
proc `$`(a: Rect): string
|
proc `$`(a: Rect): string
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## **proc** inside
|
||||||
|
|
||||||
|
Checks if pos is inside rect.
|
||||||
|
|
||||||
|
```nim
|
||||||
|
proc inside(pos: Vec2; rect: Rect): bool
|
||||||
|
```
|
||||||
|
|
||||||
|
## **proc** overlap
|
||||||
|
|
||||||
|
Returns true if box a overlaps box b.
|
||||||
|
|
||||||
|
```nim
|
||||||
|
proc overlap(a, b: Rect): bool
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue