PointCloud

Source: PointCloud.ts:53

PointCloud object.

Example

Creates point cloud with two ten pixel size points

CODE
new og.Entity({
    pointCloud: {
        pointSize: 10,
        points: [
            [0, 0, 0, 255, 255, 255, 255, { 'name': 'White point' }],
            [100, 100, 0, 255, 0, 0, 255, { 'name': 'Red point' }]
        ]
    }
});

Constructor

new PointCloud(options?: *): PointCloud

Parameters

  • options (*, optional) — Point cloud options:
    • options.points (Array.<Array.<number>>, optional) — Points cartesian coordinates array, where first three is cartesian coordinates, next fourth is an RGBA color, and last is a point properties.
    • options.pointSize (number, optional) — Point screen size in pixels.
    • options.pickingScale (number, optional) — Point border picking size in screen pixels.
    • options.visibility (boolean, optional) — Point cloud visibility.

Instance Methods

clear()

Clears point cloud data

setVisibility(visibility: boolean)

Sets cloud visibility.

Parameters

  • visibility (boolean) — Visibility flag.

setOpacity(opacity: number)

Sets opacity for all points in the cloud.

Parameters

  • opacity (number) — Opacity value in range [0..1].

getVisibility(): boolean

Returns

  • boolean — Point cloud visibility.

bindScene(scene: Scene)

Assign rendering scene node.

Parameters

  • scene (Scene) — Assigned render node.

remove()

Removes from entity.

setPoints(points: Array.<Poi>)

Adds points to render.

Parameters

  • points (Array.<Poi>) — Point cloud array.

Example

CODE
var points = [[0, 0, 0, 255, 255, 255, 255, { 'name': 'White point' }], [100, 100, 0, 255, 0, 0, 255, { 'name': 'Red point' }]];

getPoint(index: number): IPoint

Returns specific point by index.

Parameters

  • index (number) — Point index.

Returns

  • IPoint — Point at the given index.

_update()

Update gl buffers.

_deleteBuffers()

Delete buffers

Instance Fields

visibility: boolean

Cloud visibility.

pointSize: number

Point screen size in pixels.

pickingScale: number

Point picking border size in pixels.