web component. See NeedleEngineAttributes attributes for supported attributes
The needle engine web component creates and manages a needle engine context which is responsible for rendering a 3D scene using threejs.
The needle engine context is created when the src attribute is set and disposed when the needle engine is removed from the document (you can prevent this by setting the keep-alive attribute to true).
The needle engine context is accessible via the context property on the needle engine element (e.g. document.querySelector("needle-engine").context).

Link

https://engine.needle.tools/docs/reference/needle-engine-attributes

Example

<needle-engine src="https://example.com/scene.glb"></needle-engine>

Example

<needle-engine src="https://example.com/scene.glb" camera-controls="false"></needle-engine>

Hierarchy

Implements

  • INeedleEngineComponent

Constructors

Accessors

  • get cameraControls(): boolean
  • If set to false the camera controls are disabled. Default is true.

    Returns boolean

    if the attribute is not set it returns null

    Memberof

    NeedleEngineAttributes

    Example

    <needle-engine camera-controls="false"></needle-engine>
    

    Example

    <needle-engine camera-controls="true"></needle-engine>
    

    Example

    <needle-engine camera-controls></needle-engine>
    

    Example

    <needle-engine></needle-engine>
    
  • get context(): Context
  • Get the context that is created when the src attribute is set and the loading has finished.

    Returns Context

  • get loadingFinished(): boolean
  • Returns boolean

  • get loadingProgress01(): number
  • Returns number

  • get observedAttributes(): string[]
  • Returns string[]

Methods

  • Get the current context for this web component instance. The context is created when the src attribute is set and the loading has finished.
    The context is disposed when the needle engine is removed from the document (you can prevent this by setting the keep-alive attribute to true).

    Returns Promise<Context>

    a promise that resolves to the context when the loading has finished

Generated using TypeDoc