Revision Difference
debugoverlay.Axis#567664
<function name="Axis" parent="debugoverlay" type="libraryfunc">
<description>
Displays an axis indicator at the specified position.
Displays an axis indicator at the specified position, with 3 lines pointing in the positive direction (i.e. direction in which the values increase) of each axis.
<note>This function will silently fail if the `developer` <page>ConVar</page> is set to `0`.
It is not networked to clients, except for the <page text="listen server host">Player:IsListenServerHost</page>.
It will not work when the game is paused.</note>
</description>
<realm>Shared</realm>
<args>
<arg name="origin" type="Vector">Position origin.</arg>
<arg name="ang" type="Angle">Angle of the axis.</arg>
<arg name="size" type="number">Size of the axis.</arg>
<arg name="lifetime" type="number" default="1">Number of seconds to appear.</arg>
<arg name="ignoreZ" type="boolean" default="false">If true, will draw on top of everything; ignoring the Z buffer.</arg>
</args>
</function>
<example>
<description>
Render the axis at the map origin, unrotated (`Angle(0, 0, 0)`).
⤶
The colored crosses shows the direction the axis lines are pointing too.
Note that the green line is pointing in the opposite direction than it should be.⤶
⤶
Note that the green line is pointing to the left, despite there not being an **Angle:Left** function, as per the left hand rule.
The colors represent the direction it is pointing to:
* **Red:** Points to `ang:Forward()`
* **Green:** Points to `-ang:Right()`, "left" or "negative right"
* **Blue:** Points to `ang:Up()`
</description>
<code>
local pos = Vector(0, 0, 0)
local ang = Angle(0, 0, 0)
local len = 30
local lifetime = 5
local size = 10
debugoverlay.Axis(pos, ang, size, lifetime, true)
debugoverlay.Cross(pos + ang:Forward() * len, size, lifetime, Color(255, 0, 0), true) -- Red
debugoverlay.Cross(pos + ang:Right() * len, size, lifetime, Color(0, 255, 0), true) -- Green
debugoverlay.Cross(pos - ang:Right() * len, size, lifetime, Color(0, 255, 0), true) -- Green
debugoverlay.Cross(pos + ang:Up() * len, size, lifetime, Color(0, 0, 255), true) -- Blue
</code>
<output>
<upload src="1b0c8/8de8c197fb76949.png" size="580497" name="debugoverlay_axis_colors.png" />
<upload src="70c/8de8e92ed4a599f.png" size="391835" name="image.png" />
</output>
</example>
Garry's Mod
Rust
Steamworks
Wiki Help