gfx3d
The library with powerful set of functions that let you control how the world and its contents are rendered.
It can also be used to draw some 3D client-side effects such as beams, boxes and spheres.
Classes & types
Fields
| Name | Type | Description |
|---|---|---|
PixelShaders1 | boolean | true if the current settings and the system allow the usage of pixel shaders 1.4, false otherwise. |
PixelShaders2 | boolean | true if the current settings and the system allow the usage of pixel shaders 2.0, false otherwise. |
VertexShaders | boolean | true if the current settings and the system allow the usage of vertex shaders 1.1, false otherwise. |
DirectX | number | The supported DirectX level, 8 for DX8, 9 for DX9, 10 for DX10, 11 for DX11. |
HDR | boolean | true if the current settings and the system allow the usage of HDR, false otherwise. |
Functions
gfx3d.drawBeam | Draws a straight beam. |
gfx3d.drawBox | Draws a box, solid or wireframe. |
gfx3d.drawComplexBeam | Draws a beam made of multiple segments. |
gfx3d.drawLine | Draws a line between two points. |
gfx3d.drawSphere | Draws a sphere, solid or wireframe. |
gfx3d.drawSprite | Draws a sprite in 3D space. |
gfx3d.start | |
gfx3d.start2d |
#gfx3d.drawBeam
function gfx3d.drawBeam(start_position: Vector3, end_position: Vector3, width: number, texture_start: number, texture_end: number, color?: Color, alpha?: integer)
Draws a straight beam.
Parameters
| Name | Type | Description |
|---|---|---|
start_position | Vector3 | The start of the beam. |
end_position | Vector3 | The end of the beam. |
width | number | The width of the beam. |
texture_start | number | The texture coordinate at the start of the beam. |
texture_end | number | The texture coordinate at the end of the beam. |
coloroptional | Color | The color of the beam, white by default. |
alphaoptional | integer | The alpha of the beam, 255 by default. |
#gfx3d.drawBox
function gfx3d.drawBox(origin: Vector3, angles: Angle3, mins: Vector3, maxs: Vector3, color?: Color, alpha?: integer, wireframe?: boolean, write_z?: boolean)
Draws a box, solid or wireframe.
Parameters
| Name | Type | Description |
|---|---|---|
origin | Vector3 | The origin of the box. |
angles | Angle3 | The orientation of the box. |
mins | Vector3 | The local minimum bounds. |
maxs | Vector3 | The local maximum bounds. |
coloroptional | Color | The color of the box, white by default. |
alphaoptional | integer | The alpha of the box, 255 by default. |
wireframeoptional | boolean | If true, draws only the edges of the box. |
write_zoptional | boolean | If true, the wireframe writes to the depth buffer (wireframe only). |
#gfx3d.drawComplexBeam
function gfx3d.drawComplexBeam(segments: gfx3d.ComplexBeamSegment[], segment_count?: integer)
Draws a beam made of multiple segments.
Parameters
| Name | Type | Description |
|---|---|---|
segments | gfx3d.ComplexBeamSegment[] | The beam segments. |
segment_countoptional | integer | The number of segments to draw, defaults to the length of segments. |
#gfx3d.drawLine
function gfx3d.drawLine(start_position: Vector3, end_position: Vector3, color?: Color, alpha?: integer, write_z?: boolean)
Draws a line between two points.
Parameters
#gfx3d.drawSphere
function gfx3d.drawSphere(origin: Vector3, radius: number, longitude_steps: integer, latitude_steps: integer, color?: Color, alpha?: integer, wireframe?: boolean, write_z?: boolean)
Draws a sphere, solid or wireframe.
Parameters
| Name | Type | Description |
|---|---|---|
origin | Vector3 | The center of the sphere. |
radius | number | The radius of the sphere. |
longitude_steps | integer | The number of longitude steps. |
latitude_steps | integer | The number of latitude steps. |
coloroptional | Color | The color of the sphere, white by default. |
alphaoptional | integer | The alpha of the sphere, 255 by default. |
wireframeoptional | boolean | If true, draws only the edges of the sphere. |
write_zoptional | boolean | If true, the wireframe writes to the depth buffer (wireframe only). |
#gfx3d.drawSprite
function gfx3d.drawSprite(origin: Vector3, width: number, height: number, color?: Color, alpha?: integer)
Draws a sprite in 3D space.
Parameters
#gfx3d.start
function gfx3d.start(view: gfx3d.RenderView)
Parameters
| Name | Type | Description |
|---|---|---|
view | gfx3d.RenderView |
#gfx3d.start2d
function gfx3d.start2d(origin: Vector3, angles: Angle3, scale: number)
Parameters