@pixi/3d
    Preparing search index...

    Interface PointLike3D

    A PointData3D you can also set, copy and compare

    Vector3, ObservableVector3 and a node's angle all implement it, so a function that takes one accepts any of them.

    function dropToGround(point: PointLike3D): void {
    point.set(point.x, 0, point.z);
    }

    dropToGround(crate.position);
    dropToGround(new Vector3(3, 5, 1));
    interface PointLike3D {
        copyFrom: (p: PointData3D) => this;
        copyTo: <T extends PointLike3D>(p: T) => T;
        equals: (p: PointData3D) => boolean;
        set: (x?: number, y?: number, z?: number) => this;
        z: number;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    copyFrom: (p: PointData3D) => this

    Copies x, y and z from p

    Type Declaration

    pickup.position.copyFrom({ x: 0, y: 1, z: -4 });
    
    copyTo: <T extends PointLike3D>(p: T) => T

    Writes this point's x, y, z into p

    Type Declaration

      • <T extends PointLike3D>(p: T): T
      • Type Parameters

        Parameters

        • p: T

          The point to copy into

        Returns T

        The given point with values updated

    player.position.copyTo(lastCheckpoint);
    
    equals: (p: PointData3D) => boolean

    Checks whether x, y and z all match p exactly, with no tolerance

    Type Declaration

    if (!player.position.equals(lastSentPosition)) sendPosition(player.position);
    
    set: (x?: number, y?: number, z?: number) => this

    Sets the x, y and z components

    Type Declaration

      • (x?: number, y?: number, z?: number): this
      • Parameters

        • Optionalx: number

          The x component

        • Optionaly: number

          The y component, defaults to x

        • Optionalz: number

          The z component, defaults to x

        Returns this

    node.position.set(0, 2, 0);
    node.scale.set(2);
    z: number

    Position on the z axis

    waypoints.sort((a: PointData3D, b: PointData3D) => a.z - b.z);