A helper to create lines for a mesh.
Supports updating efficiently on the GPU.
Lines don't support UV mapping, instead, the data represents values as follows:
- U is set to the line lerp points, it will interpolate between 0 and 1 from
the line start point to the line end point
- V is set to the length of the line in local space
However, lines can still use vertex colors, just make sure your material supports it.
Constructor
Variables
Methods
addLine(from:Vector3D, to:Vector3D, startColor:FlxColor = 0xFFFFFFFF, endColor:FlxColor = 0xFFFFFFFF):Void
Adds a line to the mesh. Call build() when you're done
Note: This method will allocate memory each time,
to update lines efficiently in real time, check updateLine()
Parameters:
from | The position where the line will start |
|---|---|
end | The position where the line will end |
color | Optional: The line color |
flushUpdates():Void
Pushes all updated lines to the GPU.
Call this after updating lines with updateLine()