Class: RopeGeometry

RopeGeometry

RopeGeometry allows you to draw a geometry across several points and then manipulate these points.

new RopeGeometry (options) overrides

Name Type Description
options RopeGeometryOptions

Options to be applied to rope geometry

Example

 import { Point, RopeGeometry } from 'pixi.js';

 for (let i = 0; i < 20; i++) {
     points.push(new Point(i * 50, 0));
 };
 const rope = new RopeGeometry(100, points);

Extends

Members

defaultOptions RopeGeometryOptions & MeshGeometryOptions static

Default options for RopeGeometry constructor.

Properties:
Name Type Default Description
points

An array of points that determine the rope.

textureScale number 0

Rope texture scale, if zero then the rope texture is stretched.

width number 200

The width (i.e., thickness) of the rope.

_width number readonly

The width (i.e., thickness) of the rope.

points PointData[]

An array of points that determine the rope.

textureScale number readonly

Rope texture scale, if zero then the rope texture is stretched.

width number readonly

The width (i.e., thickness) of the rope.

Methods

update () void

Refreshes Rope indices and uvs

updateVertices () void

refreshes vertices of Rope mesh

Inherited Properties

From class MeshGeometry

indices Uint32Array inherited

The indices of the mesh.

positions Float32Array inherited

The positions of the mesh.

uvs Float32Array inherited

The UVs of the mesh.

From class Geometry

attributes Record<string, Attribute> readonly inherited

A record of the attributes of the geometry.

bounds Bounds inherited

Returns the bounds of the geometry.

buffers Buffer[] readonly inherited

The buffers that the attributes use

indexBuffer Buffer readonly inherited

The index buffer of the geometry

instanceCount number inherited

the instance count of the geometry to draw

Default Value:
  • 1

topology Topology inherited

The topology of the geometry.

uid number readonly inherited

The unique id of the geometry.

Inherited Methods

From class Geometry

destroy (destroyBuffers) void inherited

destroys the geometry.

Name Type Default Description
destroyBuffers boolean false

destroy the buffers associated with this geometry

getAttribute (id) Attribute inherited

Returns the requested attribute.

Name Type Description
id string

The name of the attribute required

Returns:
Type Description
Attribute
  • The attribute requested.

getBuffer (id) Buffer inherited

Returns the requested buffer.

Name Type Description
id string

The name of the buffer required.

Returns:
Type Description
Buffer
  • The buffer requested.

getIndex () Buffer inherited

Returns the index buffer

Returns:
Type Description
Buffer
  • The index buffer.

getSize () number inherited

Used to figure out how many vertices there are in this geometry

Returns:
Type Description
number the number of vertices in the geometry