Class: ScreenLines
Class: ScreenLines
Represents one or more line segments that can have different color, width, screen scaling. Has high rendering performance.
Hierarchy
LineSegments2
↳
ScreenLines
Constructors
constructor
• new ScreenLines(maxCount?
, material?
): ScreenLines
Parameters
Name | Type | Description |
---|---|---|
maxCount? | number | Maximum line segments count. Can`t be changed after creation. |
material? | ScreenLinesMaterial | Line Material. If not specified, the default material will be used. |
Returns
Overrides
LineSegments2.constructor
Properties
maxCount
• Readonly
maxCount: number
Maximum line segments count. Set when creating an instance of the class.
Methods
fill
▸ fill(color?
): this
Fills the memory array for the line segments declared at creation with the default parameters (color).
Parameters
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
geometry | EdgesGeometry <BufferGeometry <NormalBufferAttributes >> | Geometry object. |
Returns
this
fromLineSegments
▸ fromLineSegments(lineSegments
): this
Writes line segments data to a lines memory array from line segments object.
Parameters
Name | Type | Description |
---|---|---|
lineSegments | LineSegments <BufferGeometry <NormalBufferAttributes >, Material | Material [], Object3DEventMap > | Line segments object. |
Returns
this
fromMesh
▸ fromMesh(mesh
): this
Writes mesh data to a lines memory array from wireframe geometry.
Parameters
Name | Type | Description |
---|---|---|
mesh | Mesh <BufferGeometry <NormalBufferAttributes >, Material | Material [], Object3DEventMap > | Mesh object. |
Returns
this
fromWireframeGeometry
▸ fromWireframeGeometry(geometry
): this
Writes wireframe data to a lines memory array from wireframe geometry.
Parameters
Name | Type | Description |
---|---|---|
geometry | WireframeGeometry <BufferGeometry <NormalBufferAttributes >> | 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
Name | Type | Description |
---|---|---|
startPosition | number [] | Vector3 | Line start coordinates. |
endPosition | number [] | Vector3 | Line start coordinates. |
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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
array | Float32Array | ArrayLike <number > | Line colors array by start and end color components [startR,startG,startB,endR,endG,endB]. |
Returns
this
setLinesCount
▸ setLinesCount(count
): void
Set visible line segments count.
Parameters
Name | Type | Description |
---|---|---|
count | number | Lines count. |
Returns
void
setPositionAtIndex
▸ setPositionAtIndex(index
, startPosition
, endPosition
): this
Set Line segment positions at index.
Parameters
Name | Type | Description |
---|---|---|
index | number | Line index. |
startPosition | number [] | Vector3 | Start line position. |
endPosition | number [] | Vector3 | Start line position. |
Returns
this
setPositions
▸ setPositions(array
): this
Bach set lines positions.
Parameters
Name | Type | Description |
---|---|---|
array | Float32Array | ArrayLike <number > | Line positions array by start and end coordinate components [startX,startY,startZ,endX,endY,endZ]. |
Returns
this