draw3d
World shapes that walls hide, like real geometry. Only works inside on_draw_3d.
Functions
draw3d.line
draw3d.line(a, b, color [, width])| Name | Type | Description |
|---|---|---|
| a | Vector | |
| b | Vector | |
| color | integer | table | draw.color() or {r,g,b,a}. |
| widthoptional | number | Default 1. |
Line between two points.
draw3d.box
draw3d.box(min, max, color [, filled])| Name | Type | Description |
|---|---|---|
| min | Vector | |
| max | Vector | |
| color | integer | table | |
| filledoptional | boolean | Default false. |
World-aligned box.
draw3d.obb
draw3d.obb(min, max, matrix, color [, filled])| Name | Type | Description |
|---|---|---|
| min | Vector | |
| max | Vector | |
| matrix | Matrix3x4 | Like ent:hitbox_matrix(i). |
| color | integer | table | |
| filledoptional | boolean | Default false. |
Box in a matrix's space, for hitboxes.
draw3d.triangle
draw3d.triangle(a, b, c, color)| Name | Type |
|---|---|
| a | Vector |
| b | Vector |
| c | Vector |
| color | integer | table |
Filled triangle.
draw3d.sphere
draw3d.sphere(center, radius, color [, segments])| Name | Type | Description |
|---|---|---|
| center | Vector | |
| radius | number | |
| color | integer | table | |
| segmentsoptional | integer | 6 to 48. Default 16. |
Wire sphere.
draw3d.set_depth
draw3d.set_depth(on)| Name | Type | Description |
|---|---|---|
| on | boolean | false draws through walls. |
Depth test for the rest of this handler.
Depth turns back on at the start of each handler. Shapes never hide each other.