SimpleRenderer
A basic renderer capable of rendering Objec3Ds.
Extends
Constructors
new SimpleRenderer()
new SimpleRenderer(
components
,container
,parameters
?):SimpleRenderer
Constructor for the SimpleRenderer class.
Parameters
Parameter | Type | Description |
---|---|---|
components | Components | The components instance. |
container | HTMLElement | The HTML container where the THREE.js canvas will be rendered. |
parameters ? | Partial <WebGLRendererParameters > | Optional parameters for the THREE.js WebGLRenderer. |
Returns
Overrides
BaseRenderer.constructor
Properties
clippingPlanes
clippingPlanes:
Plane
[] =[]
The list of clipping planes used by this instance of the renderer.
Inherited from
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
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
>
Inherited from
onBeforeUpdate
onBeforeUpdate:
Event
<unknown
>
Inherited from
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
>
Inherited from
onResize
readonly
onResize:Event
<Vector2
>
Inherited from
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
three
three:
WebGLRenderer
The THREE.js WebGLRenderer instance.
Overrides
Methods
dispose()
dispose():
void
Returns
void
Overrides
getSize()
getSize():
Vector2
Returns
Vector2
Overrides
isConfigurable()
isConfigurable():
this is Configurable<any, any>
Whether is component is Configurable.
Returns
this is Configurable<any, any>
Inherited from
isDisposeable()
isDisposeable():
this is Disposable
Whether is component is Disposable.
Returns
this is Disposable
Inherited from
isHideable()
isHideable():
this is Hideable
Whether is component is Hideable.
Returns
this is Hideable
Inherited from
isResizeable()
isResizeable():
this is Resizeable
Whether is component is Resizeable.
Returns
this is Resizeable
Inherited from
isUpdateable()
isUpdateable():
this is Updateable
Whether is component is Updateable.
Returns
this is Updateable
Inherited from
resize()
resize(
size
?):void
Parameters
Parameter | Type |
---|---|
size ? | Vector2 |
Returns
void
Overrides
setPlane()
setPlane(
active
,plane
,isLocal
?):void
Sets or removes a clipping plane from the renderer.
Parameters
Parameter | Type | Description |
---|---|---|
active | boolean | A boolean indicating whether the clipping plane should be active or not. |
plane | Plane | The clipping plane to be added or removed. |
isLocal ? | boolean | An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to false . |
Returns
void
Inherited from
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
Parameter | Type | Description |
---|---|---|
active | boolean | A 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
Returns
void
Overrides
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.