Fudge Core
    Preparing search index...

    Class XRViewport

    XRViewport (webXR)-extension of Viewport, to displaying its branch on Head Mounted and AR (not implemted yet) Devices

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    adjustingCamera: boolean = true
    adjustingFrames: boolean = true
    camera: ComponentCamera = null
    componentsPick: RecycableArray<ComponentPick> = ...
    frameCanvasToDestination: FramingComplex = ...
    frameClientToCanvas: FramingScaled = ...
    frameDestinationToSource: FramingScaled = ...
    frameSourceToRender: FramingScaled = ...
    gizmosEnabled: boolean = false
    gizmosFilter: { [_gizmo: string]: boolean } = ...
    gizmosSelected: Node[]
    name: string = "Viewport"
    physicsDebugMode: PHYSICS_DEBUGMODE = PHYSICS_DEBUGMODE.NONE
    rectDestination: Rectangle
    rectSource: Rectangle
    referenceSpace: XRReferenceSpace = null
    session: XRSession = null
    vrDevice: ComponentVRDevice = null

    Accessors

    • get context(): CanvasRenderingContext2D

      Retrieve the 2D-context attached to the destination canvas

      Returns CanvasRenderingContext2D

    • get hasFocus(): boolean

      Returns true if this viewport currently has focus and thus receives keyboard events

      Returns boolean

    • get rectCanvas(): Rectangle

      The rectangle of the canvas area in CSS pixels. Use this to access the canvas width and height, but without incuring browser internal garbage collection.

      Adjusted internally by adjustFrames, do not modify.

      Returns Rectangle

    • get rectClient(): Rectangle

      The rectangle of the canvas area as displayed (considering css). Use this to access canvas clientWidth and clientHeight, but without incuring browser internal garbage collection.

      Adjusted automatically on canvas resize, do not modify.

      Returns Rectangle

    Methods

    • Performs a pick on all ComponentPicks in the branch of this viewport using a ray from its camera through the client coordinates given in the event. Dispatches the event to all nodes hit.
      If PICK.CAMERA was chosen as the method to pick, a pick property gets added to the event, which holds the detailed information, but is overwritten for each node.

      Parameters

      • _event: PointerEvent

      Returns void

    • Draw the xr viewport displaying its branch. By default, the transforms in the branch are recalculated first. Pass false if calculation was already done for this frame Called from loop method Loop again with the xrFrame parameter handover, as soon as FRAME_REQUEST_XR is called from creator.

      Parameters

      • _prepareBranch: boolean = true
      • _xrFrame: XRFrame = null

      Returns void

    • The VR Session is initialized here, also VR - Controller are initialized, if boolean is true. Creator has to call FrameRequestXR after this Method to run the viewport in virtual reality.

      Parameters

      • _vrSessionMode: IMMERSIVE_VR = XR_SESSION_MODE.IMMERSIVE_VR
      • _vrReferenceSpaceType: XR_REFERENCE_SPACE = XR_REFERENCE_SPACE.LOCAL
      • _vrController: boolean = false

      Returns Promise<void>

    • Adjusts all frames and the camera to fit the current size of the canvas. Prepares the branch for rendering.

      Parameters

      • _prepareBranch: boolean = true

      Returns void

    • Prepares all nodes in the branch for rendering by updating their world transforms and supplying the gpu renderbuffers with the neccessary node and component data to draw a frame.

      Returns void