pixi.js
    Preparing search index...

    Class RopeGeometryAdvanced

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

    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);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    attributes: Record<string, Attribute>

    A record of the attributes of the geometry.

    batchMode: BatchMode = 'auto'
    buffers: Buffer[]

    The buffers that the attributes use

    indexBuffer: Buffer

    The index buffer of the geometry

    instanceCount: number = 1

    the instance count of the geometry to draw

    points: PointData[]

    An array of points that determine the rope.

    textureScale: number

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

    topology: Topology

    The topology of the geometry.

    uid: number = ...

    The unique id of the geometry.

    Default options for RopeGeometry constructor.

    Accessors

    • get bounds(): Bounds

      Returns the bounds of the geometry.

      Returns Bounds

    • get positions(): Float32Array

      The positions of the mesh.

      Returns Float32Array

    • set positions(value: Float32Array): void

      Set the positions of the mesh. When setting the positions, its important that the uvs array is at least as long as the positions array. otherwise the geometry will not be valid.

      Parameters

      Returns void

    • get uvs(): Float32Array

      The UVs of the mesh.

      Returns Float32Array

    • set uvs(value: Float32Array): void

      Set the UVs of the mesh. Its important that the uvs array you set is at least as long as the positions array. otherwise the geometry will not be valid.

      Parameters

      Returns void

    • get width(): number

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

      Returns number

    Methods

    • Adds an attribute to the geometry.

      Parameters

      • name: string

        The name of the attribute to add.

      • attributeOption: AttributeOption

        The attribute option to add.

      Returns void

    • Adds an index buffer to the geometry.

      Parameters

      • indexBuffer: number[] | TypedArray | Buffer

        The index buffer to add. Can be a Buffer, TypedArray, or an array of numbers.

      Returns void

    • destroys the geometry.

      Parameters

      • destroyBuffers: boolean = false

        destroy the buffers associated with this geometry

      Returns void

    • Returns the requested buffer.

      Parameters

      • id: string

        The name of the buffer required.

      Returns Buffer

      • The buffer requested.
    • Used to figure out how many vertices there are in this geometry

      Returns number

      the number of vertices in the geometry

    • Refreshes Rope indices and uvs

      Returns void

    • refreshes vertices of Rope mesh

      Returns void