Skip to main content

SimpleRenderer

A basic renderer capable of rendering Objec3Ds.

Extends

Constructors

new SimpleRenderer()

new SimpleRenderer(components, container, parameters?): SimpleRenderer

Constructor for the SimpleRenderer class.

Parameters

ParameterTypeDescription
componentsComponentsThe components instance.
containerHTMLElementThe HTML container where the THREE.js canvas will be rendered.
parameters?Partial<WebGLRendererParameters>Optional parameters for the THREE.js WebGLRenderer.

Returns

SimpleRenderer

Overrides

BaseRenderer.constructor

Properties

clippingPlanes

clippingPlanes: Plane[] = []

The list of clipping planes used by this instance of the renderer.

Inherited from

BaseRenderer . clippingPlanes


container

container: HTMLElement

The HTML container of the THREE.js canvas where the scene is rendered.


currentWorld

currentWorld: null | World = null

The current world this item is associated with. It can be null if no world is currently active.

Inherited from

BaseRenderer . currentWorld


enabled

enabled: boolean = true

Indicates whether the renderer is enabled. If it's not, it won't be updated. Default is true.


onAfterUpdate

onAfterUpdate: Event<unknown>

Updateable.onBeforeUpdate

Inherited from

BaseRenderer . onAfterUpdate


onBeforeUpdate

onBeforeUpdate: Event<unknown>

Updateable.onAfterUpdate

Inherited from

BaseRenderer . onBeforeUpdate


onClippingPlanesUpdated

readonly onClippingPlanesUpdated: Event<unknown>

Event that fires when there has been a change to the list of clipping planes used by the active renderer.

Inherited from

BaseRenderer . onClippingPlanesUpdated


onDisposed

readonly onDisposed: Event<undefined>

Disposable.onDisposed

Inherited from

BaseRenderer . onDisposed


onResize

readonly onResize: Event<Vector2>

Resizeable.onResize

Inherited from

BaseRenderer . onResize


onWorldChanged

readonly onWorldChanged: Event<object>

Event that is triggered when a world is added or removed from the worlds map. The event payload contains the world instance and the action ("added" or "removed").

Type declaration

action

action: "added" | "removed"

world

world: World

Inherited from

BaseRenderer . onWorldChanged


three

three: WebGLRenderer

The THREE.js WebGLRenderer instance.

Overrides

BaseRenderer . three

Methods

dispose()

dispose(): void

Disposable.dispose

Returns

void

Overrides

BaseRenderer . dispose


getSize()

getSize(): Vector2

Resizeable.getSize.

Returns

Vector2

Overrides

BaseRenderer . getSize


isConfigurable()

isConfigurable(): this is Configurable<any, any>

Whether is component is Configurable.

Returns

this is Configurable<any, any>

Inherited from

BaseRenderer . isConfigurable


isDisposeable()

isDisposeable(): this is Disposable

Whether is component is Disposable.

Returns

this is Disposable

Inherited from

BaseRenderer . isDisposeable


isHideable()

isHideable(): this is Hideable

Whether is component is Hideable.

Returns

this is Hideable

Inherited from

BaseRenderer . isHideable


isResizeable()

isResizeable(): this is Resizeable

Whether is component is Resizeable.

Returns

this is Resizeable

Inherited from

BaseRenderer . isResizeable


isUpdateable()

isUpdateable(): this is Updateable

Whether is component is Updateable.

Returns

this is Updateable

Inherited from

BaseRenderer . isUpdateable


resize()

resize(size?): void

Resizeable.resize

Parameters

ParameterType
size?Vector2

Returns

void

Overrides

BaseRenderer . resize


setPlane()

setPlane(active, plane, isLocal?): void

Sets or removes a clipping plane from the renderer.

Parameters

ParameterTypeDescription
activebooleanA boolean indicating whether the clipping plane should be active or not.
planePlaneThe clipping plane to be added or removed.
isLocal?booleanAn optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to false.

Returns

void

Inherited from

BaseRenderer . setPlane

Remarks

This method adds or removes a clipping plane from the clippingPlanes array. If active is true and the plane is not already in the array, it is added. If active is false and the plane is in the array, it is removed. The three.clippingPlanes property is then updated to reflect the current state of the clippingPlanes array, excluding any planes marked as local.


setupEvents()

setupEvents(active): void

Sets up and manages the event listeners for the renderer.

Parameters

ParameterTypeDescription
activebooleanA boolean indicating whether to activate or deactivate the event listeners.

Returns

void

Throws

Will throw an error if the renderer does not have an HTML container.


update()

update(): void

Updateable.update

Returns

void

Overrides

BaseRenderer . update


updateClippingPlanes()

updateClippingPlanes(): void

Updates the clipping planes and triggers the onClippingPlanesUpdated event.

Returns

void

Inherited from

BaseRenderer . updateClippingPlanes

Remarks

This method is typically called when there is a change to the list of clipping planes used by the active renderer.