Merge pull request #4 from guzba/master

Ran mddoc, new procs
This commit is contained in:
treeform 2020-03-08 20:20:37 -07:00 committed by GitHub
commit b9f9e6dc40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,14 @@ Clamps n to min, else returns max if n is higher.
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
Returns the sign of a number, -1 or 1.
@ -41,8 +49,6 @@ Interpolates value between a and b.
* 1 -> b
* 0.5 -> between a and b
```nim
proc lerp(a: float32; b: float32; v: float32): float32
```
@ -55,7 +61,6 @@ proc lerp(a: float32; b: float32; v: float32): float32
Vec2 = object
x*: float32
y*: float32
```
## **proc** vec2
@ -311,7 +316,6 @@ Vec3 = object
x*: float32
y*: float32
z*: float32
```
## **proc** vec3
@ -612,7 +616,6 @@ Vec4 = object
y*: float32
z*: float32
w*: float32
```
## **proc** vec4
@ -1060,7 +1063,6 @@ Quat = object
y*: float32
z*: float32
w*: float32
```
## **proc** quat
@ -1243,7 +1245,6 @@ Rect = object
y*: float32
w*: float32
h*: float32
```
## **proc** rect
@ -1294,10 +1295,7 @@ proc wh=(rect: var Rect; v: Vec2)
## **proc** `*`
* all elements of a Rect.
* all elements of a Rect.
```nim
proc `*`(r: Rect; v: float): Rect
@ -1311,12 +1309,12 @@ 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
proc intersects(rect: Rect; pos: Vec2): bool
proc `+`(a, b: Rect): Rect
```
## **proc** `$`
@ -1325,3 +1323,19 @@ proc intersects(rect: Rect; pos: Vec2): bool
```nim
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
```