Class: ScreenLines
Class: ScreenLines
Represents one or more line segments that can have different color, width, screen scaling. Has high rendering performance.
Extends
LineSegments2
Constructors
Constructor
new ScreenLines(
maxCount
?,material
?):ScreenLines
Parameters
maxCount?
number
Maximum line segments count. Can`t be changed after creation.
material?
Line Material. If not specified, the default material will be used.
Returns
ScreenLines
Overrides
LineSegments2.constructor
Properties
maxCount
readonly
maxCount:number
Maximum line segments count. Set when creating an instance of the class.
type
type:
string
Default Value
Mesh
Overrides
LineSegments2.type
Methods
fill()
fill(
color
?):this
Fills the memory array for the line segments declared at creation with the default parameters (color).
Parameters
color?
ColorRepresentation
Default line segment points color.
Returns
this
fromEdgesGeometry()
fromEdgesGeometry(
geometry
):this
Writes edges data to a lines memory array from wireframe geometry.
Parameters
geometry
EdgesGeometry
Geometry object.
Returns
this
fromLineSegments()
fromLineSegments(
lineSegments
):this
Writes line segments data to a lines memory array from line segments object.
Parameters
lineSegments
LineSegments
Line segments object.
Returns
this
fromMesh()
fromMesh(
mesh
):this
Writes mesh data to a lines memory array from wireframe geometry.
Parameters
mesh
Mesh
Mesh object.
Returns
this
fromWireframeGeometry()
fromWireframeGeometry(
geometry
):this
Writes wireframe data to a lines memory array from wireframe geometry.
Parameters
geometry
WireframeGeometry
Geometry object.
Returns
this
getLinesCount()
getLinesCount():
number
Get visible line segments count.
Returns
number
push()
push(
startPosition
,endPosition
,startColor
?,endColor
?):this
Writes the new line segments data to the lines memory array.
Parameters
startPosition
Line start coordinates.
number
[] | Vector3
endPosition
Line start coordinates.
number
[] | Vector3
startColor?
ColorRepresentation
Line start color.
endColor?
ColorRepresentation
Line start color.
Returns
this
setColorAtIndex()
setColorAtIndex(
index
,startColor
,endColor
):this
Set Line segment colors at index.
Parameters
index
number
Line index.
startColor
ColorRepresentation
Start line color.
endColor
ColorRepresentation
Start line color.
Returns
this
setColors()
setColors(
array
):this
Bach set line segments colors.
Parameters
array
Line colors array by start and end color components [startR,startG,startB,endR,endG,endB].
ArrayLike
<number
> | Float32Array
<ArrayBufferLike
>
Returns
this
setLinesCount()
setLinesCount(
count
):void
Set visible line segments count.
Parameters
count
number
Lines count.
Returns
void
setPositionAtIndex()
setPositionAtIndex(
index
,startPosition
,endPosition
):this
Set Line segment positions at index.
Parameters
index
number
Line index.
startPosition
Start line position.
number
[] | Vector3
endPosition
Start line position.
number
[] | Vector3
Returns
this
setPositions()
setPositions(
array
):this
Bach set lines positions.
Parameters
array
Line positions array by start and end coordinate components [startX,startY,startZ,endX,endY,endZ].
ArrayLike
<number
> | Float32Array
<ArrayBufferLike
>
Returns
this