roavatar-renderer
    Preparing search index...

    Class RBXRenderer

    A singleton, intialized by calling RBXRenderer.fullSetup()

    Index

    Constructors

    Properties

    backgroundColor: ColorRepresentation = 0x2b2d33
    backgroundTransparent: boolean = false
    canvasContainer: HTMLDivElement
    createLoadingIcon: boolean = true
    error?: unknown
    failedToCreate: boolean = false
    loadingIcon?: HTMLSpanElement
    loadingIconStyle?: HTMLStyleElement
    orbitControlsTarget: Vec3 = ...
    renderer?: WebGLRenderer
    resolution: [number, number] = ...
    scenes: RBXRendererScene[] = ...

    Accessors

    • get ambientLight(): AmbientLight | undefined

      Returns AmbientLight | undefined

      This can only get the first renderScene's ambientLight

    • get backgroundColorHex(): number

      Returns number

      Use backgroundColor instead

    • set backgroundColorHex(val: number): void

      Parameters

      • val: number

      Returns void

      Use backgroundColor instead

    • get camera(): PerspectiveCamera

      Returns PerspectiveCamera

      This can only get the first renderScene's camera

    • get controls(): OrbitControls<Camera> | undefined

      Returns OrbitControls<Camera> | undefined

      This can only get the first renderScene's controls

    • get directionalLight(): DirectionalLight | undefined

      Returns DirectionalLight | undefined

      This can only get the first renderScene's directionalLight

    • get directionalLight2(): DirectionalLight | undefined

      Returns DirectionalLight | undefined

      This can only get the first renderScene's directionalLight2

    • get plane(): | Mesh<
          BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
          Material<MaterialEventMap> | Material<MaterialEventMap>[],
          Object3DEventMap,
      >
      | undefined

      Returns
          | Mesh<
              BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
              Material<MaterialEventMap> | Material<MaterialEventMap>[],
              Object3DEventMap,
          >
          | undefined

      This can only get the first renderScene's plane

    • get scene(): Scene<Object3DEventMap>

      Returns Scene<Object3DEventMap>

      This can only get the first renderScene's scene

    • get shadowPlane(): | Mesh<
          BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
          Material<MaterialEventMap> | Material<MaterialEventMap>[],
          Object3DEventMap,
      >
      | undefined

      Returns
          | Mesh<
              BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
              Material<MaterialEventMap> | Material<MaterialEventMap>[],
              Object3DEventMap,
          >
          | undefined

      This can only get the first renderScene's shadowPlane

    • get wellLitDirectionalLightIntensity(): number

      Returns number

      This can only gey the first renderScene's wellLitDirectionalLightIntensity

    • set wellLitDirectionalLightIntensity(v: number): void

      Parameters

      • v: number

      Returns void

      This can only set the first renderScene's wellLitDirectionalLightIntensity

    Methods

    • Parameters

      • shouldRequestAnimationFrame: boolean = true

      Returns void

      Makes the renderer render a new frame on every animationFrame

    • Parameters

      • shouldRequestAnimationFrame: boolean = true

      Returns void

    • Sets up the THREE.js renderer

      Parameters

      • Optionalcanvas: HTMLCanvasElement

      Returns void

    • Parameters

      Returns void

      Superseded by RBXRendererScene.exportGLTF() This function is unstable and can throw errors, but might work

    • Fully sets up renderer with scene, camera and frame rendering

      Parameters

      • includeSceneAppearance: boolean = true
      • includeControls: boolean = true
      • includeAnimate: boolean = true

      Returns Promise<boolean>

      success

    • Returns WebGLRenderer | undefined

      ThreeJS renderer

    • Returns PerspectiveCamera

      This can only get the first renderScene's camera

    • Returns OrbitControls<Camera> | undefined

      This can only get the first renderScene's controls

    • Returns HTMLCanvasElement | undefined

      The element for the renderer canvas

      Use getRendererElement instead which includes the loading icon

    • Returns HTMLDivElement

      An element containing the renderer canvas

    • Returns Scene<Object3DEventMap>

      This can only get the first renderScene's scene

    • Parameters

      • color: ColorRepresentation

        example: 0x2b2d33 which is the default

      Returns void

    • Sets the background and ground's visibility, but not the shadowPlane

      Parameters

      • transparent: boolean

        If the background and ground should be transparent

      Returns void

    • Parameters

      • width: number
      • height: number

      Returns void

    • Sets up a basic scene with lighting

      Parameters

      • lightingType: "WellLit" | "Thumbnail" = "WellLit"

        "WellLit" is the default lighting for RoAvatar, "Thumbnail" tries to match the Roblox thumbnail lighting

      • backgroundColorVal: ColorRepresentation = RBXRenderer.backgroundColor
      • renderScene: RBXRendererScene = RBXRenderer.firstScene

      Returns void