Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Rope

Class to manage invisible ropes between entities.

Hierarchy

  • Rope

Index

Constructors

constructor

  • new Rope(handle: number): Rope
  • Create a rope object based on an existing rope in the world.

    Parameters

    • handle: number

      entity Id of rope.

    Returns Rope

Accessors

Length

  • get Length(): number
  • set Length(length: number): void
  • Get the length of the rope.

    Returns number

    The rope length.

  • Sets the length of the rope.

    Parameters

    • length: number

      Desired new length of rope.

    Returns void

    The rope length.

VertexCount

  • get VertexCount(): number
  • Get the number of vertices on the rope.

    Returns number

    Returns the number of vertices.

Methods

activatePhysics

  • activatePhysics(): void
  • Activates world physics on the rope object.

    Returns void

attachEntities

  • Attach the rope between two entities at given locations on the entities.

    Parameters

    • entityOne: Entity

      The first entity to attach to.

    • positionOne: Vector3

      Where on the first entity to attach the rope to.

    • entityTwo: Entity

      The second entity to attach to.

    • positionTwo: Vector3

      Where on the second entity to attach the rope to.

    • length: number

      The desired length of the rope between the two entities.

    Returns void

attachEntity

  • Attach the rope to an entity.

    Parameters

    • entity: Entity

      Entity to attach the rope to.

    • position: Vector3

      Location where the rope is to be attached.

    Returns void

delete

  • delete(): void
  • Delete the rope from the world. This does not delete the rope object.

    Returns void

detachEntity

  • detachEntity(entity: Entity): void
  • Detach the rope from an entity.

    Parameters

    • entity: Entity

      Entity to detach the rope from.

    Returns void

exists

  • exists(): boolean
  • Check if the rope still exists in the world based on it's handle.

    Returns boolean

    Whether the rope exists or not.

getVertexCoord

  • getVertexCoord(vertex: number): Vector3
  • Return the world location of a specified vertex on the rope.

    Parameters

    • vertex: number

      Vertex to get location from.

    Returns Vector3

    The vector location of the vertex.

pinVertex

  • pinVertex(vertex: number, position: Vector3): void
  • Pin a vertex of the rope to a certain location.

    Parameters

    • vertex: number

      Vertex to pin.

    • position: Vector3

      Location to pin the vertex to.

    Returns void

resetLength

  • resetLength(reset: boolean): void
  • Resets the length of the rope to it's length upon object creation or a length of 1.

    Parameters

    • reset: boolean

      Whether to reset the length to it's original length or 1.

    Returns void

unpinVertex

  • unpinVertex(vertex: number): void
  • Unpin a specified vertex from it's current pinned location (if any).

    Parameters

    • vertex: number

      Vertex to unpin.

    Returns void

Generated using TypeDoc