PixiThree - v0.0.16
    Preparing search index...

    Interface PixiViewContextValue

    Context value for Pixi view coordinate mapping. Works in PixiTexture (inside ThreeScene) and CanvasView.

    interface PixiViewContextValue {
        height: number;
        mapClientToPixi: (
            client: Point | { clientX: number; clientY: number },
            out?: Point,
        ) => Point | null;
        mapPixiToClient: (localPoint: Point, out?: Point) => Point[];
        mapPixiToUv: (point: Point, out?: Vector2) => Vector2;
        mapPixiToViewport: (localPoint: Point, out?: Point) => Point[];
        mapUvToPixi: (uv: Vector2, out?: Point) => Point;
        mapViewportToPixi: (viewport: Point, out?: Point) => Point | null;
        parentThree?: PixiViewParentThreeContextValue;
        width: number;
    }
    Index

    Properties

    height: number

    Height of the Pixi container

    mapClientToPixi: (
        client: Point | { clientX: number; clientY: number },
        out?: Point,
    ) => Point | null

    Maps DOM client coordinates to local Pixi coordinates.

    Type Declaration

      • (
            client: Point | { clientX: number; clientY: number },
            out?: Point,
        ): Point | null
      • Parameters

        • client: Point | { clientX: number; clientY: number }

          DOM client coordinates

        • Optionalout: Point

          Optional Point to store the result

        Returns Point | null

        The point if hit, null otherwise

    mapPixiToClient: (localPoint: Point, out?: Point) => Point[]

    Maps local Pixi coordinates to DOM client coordinates. When inside PixiTexture, returns array of Points (UV can map to multiple positions). When inside CanvasView directly, returns single-element array (direct mapping).

    Type Declaration

      • (localPoint: Point, out?: Point): Point[]
      • Parameters

        • localPoint: Point

          Pixi Point in local coordinates

        • Optionalout: Point

          Optional Point to store the first result

        Returns Point[]

        Array of Points in client coords

    mapPixiToUv: (point: Point, out?: Vector2) => Vector2

    Maps Pixi coordinates to Three.js UV coordinates (0-1).

    Type Declaration

      • (point: Point, out?: Vector2): Vector2
      • Parameters

        • point: Point

          Pixi Point in local coordinates

        • Optionalout: Vector2

          Optional Three.js UV Vector2 to store the result

        Returns Vector2

        The UV Vector2

    mapPixiToViewport: (localPoint: Point, out?: Point) => Point[]

    Maps local Pixi coordinates to CanvasView viewport coordinates. When inside PixiTexture, returns array of Points (UV can map to multiple positions). When inside CanvasView directly, returns single-element array (direct mapping).

    Type Declaration

      • (localPoint: Point, out?: Point): Point[]
      • Parameters

        • localPoint: Point

          Pixi Point in local coordinates

        • Optionalout: Point

          Optional Point to store the first result

        Returns Point[]

        Array of Points in viewport coords

    mapUvToPixi: (uv: Vector2, out?: Point) => Point

    Maps Three.js UV coordinates (0-1) to Pixi coordinates.

    Type Declaration

      • (uv: Vector2, out?: Point): Point
      • Parameters

        • uv: Vector2

          Three.js UV Vector2 (0-1 range)

        • Optionalout: Point

          Optional Pixi Point to store the result

        Returns Point

        The Pixi Point

    mapViewportToPixi: (viewport: Point, out?: Point) => Point | null

    Maps viewport coordinates to local Pixi coordinates.

    Type Declaration

      • (viewport: Point, out?: Point): Point | null
      • Parameters

        • viewport: Point

          Viewport Point coordinates

        • Optionalout: Point

          Optional Point to store the result

        Returns Point | null

        The point if hit, null otherwise

    Parent Three coordinate mapping functions. Only available inside a PixiTexture context.

    Type Declaration

    Parent Three context for coordinate mapping from PixiTexture to parent Three scene. Only available inside a PixiTexture context.

    • mapPixiToParentPixi: (point: Point, out?: Point) => Point[]

      Maps Pixi texture coordinates to global Pixi parent coordinates. Returns array of Points since UV can map to multiple mesh positions.

    • tracePixiToParentThree: (point: Point) => UvTrace[]

      Maps Pixi texture coordinates to world coordinates in the parent Three scene.

    • tracePixiToParentThreeLocal: (point: Point) => UvTrace[]

      Maps Pixi texture coordinates to local coordinates on the parent Three mesh surface.

    width: number

    Width of the Pixi container