BlochSphereScene

@qbead/bloch-sphere


@qbead/bloch-sphere / BlochSphereScene

Class: BlochSphereScene

Defined in: src/bloch-sphere-scene.ts:16arrow-up-right

A scene for the Bloch sphere which extends the THREE.Scene class

Extends

  • Scene

Constructors

Constructor

new BlochSphereScene(options?): BlochSphereScene

Defined in: src/bloch-sphere-scene.ts:23arrow-up-right

Parameters

Parameter
Type

options?

Partial<{ backgroundColor: Color; gridColor: Color; gridDivisions: number; sphereSkinColor: Color; sphereSkinOpacity: number; }>

Returns

BlochSphereScene

Overrides

THREE.Scene.constructor

Properties

Property
Modifier
Type
Default value
Description
Inherited from
Defined in

animations

public

AnimationClip[]

[]

Array with object's animation clips.

THREE.Scene.animations

node_modules/@types/three/src/core/Object3D.d.ts:266

background

public

null | Color | Texture | CubeTexture

null

Defines the background of the scene. Remarks Valid inputs are: - A THREE.Color | Color for defining a uniform colored background. - A THREE.Texture | Texture for defining a (flat) textured background. - Texture cubes (THREE.CubeTexture | CubeTexture) or equirectangular textures for defining a skybox.

THREE.Scene.background

node_modules/@types/three/src/scenes/Scene.d.ts:86

backgroundBlurriness

public

number

0

Sets the blurriness of the background. Only influences environment maps assigned to THREE.Scene.background | Scene.background. Remarks Expects a Float between 0 and 1.

THREE.Scene.backgroundBlurriness

node_modules/@types/three/src/scenes/Scene.d.ts:63

backgroundIntensity

public

number

1

Attenuates the color of the background. Only applies to background textures. Remarks Expects a Float

THREE.Scene.backgroundIntensity

node_modules/@types/three/src/scenes/Scene.d.ts:70

backgroundNode?

public

null | ShaderNodeObject<Node>

undefined

-

THREE.Scene.backgroundNode

node_modules/@types/three/src/renderers/common/nodes/Nodes.d.ts:49

backgroundRotation

public

Euler

undefined

The rotation of the background in radians. Only influences environment maps assigned to .background. Default is (0,0,0).

THREE.Scene.backgroundRotation

node_modules/@types/three/src/scenes/Scene.d.ts:92

castShadow

public

boolean

false

Whether the object gets rendered into shadow map.

THREE.Scene.castShadow

node_modules/@types/three/src/core/Object3D.d.ts:238

children

public

Object3D<Object3DEventMap>[]

[]

Array with object's children. See THREE.Object3DGroup | Group for info on manually grouping objects.

THREE.Scene.children

node_modules/@types/three/src/core/Object3D.d.ts:145

count?

public

number

undefined

-

THREE.Scene.count

node_modules/@types/three/src/renderers/common/Backend.d.ts:7

customDepthMaterial?

public

Material

undefined

Custom depth material to be used when rendering to the depth map. Remarks Can only be used in context of meshes. When shadow-casting with a THREE.DirectionalLight | DirectionalLight or THREE.SpotLight | SpotLight, if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows.

THREE.Scene.customDepthMaterial

node_modules/@types/three/src/core/Object3D.d.ts:282

customDistanceMaterial?

public

Material

undefined

Same as customDepthMaterial, but used with THREE.Object3DPointLight | PointLight.

THREE.Scene.customDistanceMaterial

node_modules/@types/three/src/core/Object3D.d.ts:288

environment

public

null | Texture

null

Sets the environment map for all physical materials in the scene. However, it's not possible to overwrite an existing texture assigned to THREE.MeshStandardMaterial.envMap | MeshStandardMaterial.envMap.

THREE.Scene.environment

node_modules/@types/three/src/scenes/Scene.d.ts:99

environmentIntensity

public

number

undefined

Attenuates the color of the environment. Only influences environment maps assigned to Scene.environment. Default 1

THREE.Scene.environmentIntensity

node_modules/@types/three/src/scenes/Scene.d.ts:105

environmentNode?

public

null | ShaderNodeObject<Node>

undefined

-

THREE.Scene.environmentNode

node_modules/@types/three/src/renderers/common/nodes/Nodes.d.ts:48

environmentRotation

public

Euler

undefined

The rotation of the environment map in radians. Only influences physical materials in the scene when .environment is used. Default is (0,0,0).

THREE.Scene.environmentRotation

node_modules/@types/three/src/scenes/Scene.d.ts:111

fog

public

null | Fog | FogExp2

null

A Fog | fog instance defining the type of fog that affects everything rendered in the scene.

THREE.Scene.fog

node_modules/@types/three/src/scenes/Scene.d.ts:56

fogNode?

public

null | ShaderNodeObject<Node>

undefined

-

THREE.Scene.fogNode

node_modules/@types/three/src/renderers/common/nodes/Nodes.d.ts:50

frustumCulled

public

boolean

true

When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to false the object gets rendered every frame even if it is not in the frustum of the camera.

THREE.Scene.frustumCulled

node_modules/@types/three/src/core/Object3D.d.ts:251

id

readonly

number

undefined

Unique number for this Object3D instance. Remarks Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object. Expects a Integer

THREE.Scene.id

node_modules/@types/three/src/core/Object3D.d.ts:109

isObject3D

readonly

true

true

Flag to check if a given object is of type Object3D. Remarks This is a constant value

THREE.Scene.isObject3D

node_modules/@types/three/src/core/Object3D.d.ts:102

isScene

readonly

true

true

Read-only flag to check if a given object is of type Scene. Remarks This is a constant value

THREE.Scene.isScene

node_modules/@types/three/src/scenes/Scene.d.ts:45

labels

public

Record<string, Label>

{}

-

-

layers

public

Layers

new THREE.Layers()

The layer membership of the object. Remarks The object is only visible if it has at least one layer in common with the THREE.Object3DCamera | Camera in use. This property can also be used to filter out unwanted objects in ray-intersection tests when using THREE.Raycaster | Raycaster.

THREE.Scene.layers

node_modules/@types/three/src/core/Object3D.d.ts:226

matrix

public

Matrix4

new THREE.Matrix4()

The local transform matrix.

THREE.Scene.matrix

node_modules/@types/three/src/core/Object3D.d.ts:191

matrixAutoUpdate

public

boolean

DEFAULT_MATRIX_AUTO_UPDATE - that is (true).

When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property.

THREE.Scene.matrixAutoUpdate

node_modules/@types/three/src/core/Object3D.d.ts:205

matrixWorld

public

Matrix4

new THREE.Matrix4()

The global transform of the object. Remarks If the Object3D has no parent, then it's identical to the local transform THREE.Object3D.matrix | .matrix.

THREE.Scene.matrixWorld

node_modules/@types/three/src/core/Object3D.d.ts:198

matrixWorldAutoUpdate

public

boolean

DEFAULT_MATRIX_WORLD_AUTO_UPDATE - that is (true).

If set, then the renderer checks every frame if the object and its children need matrix updates. When it isn't, then you have to maintain all matrices in the object and its children yourself.

THREE.Scene.matrixWorldAutoUpdate

node_modules/@types/three/src/core/Object3D.d.ts:212

matrixWorldNeedsUpdate

public

boolean

false

When this is set, it calculates the matrixWorld in that frame and resets this property to false.

THREE.Scene.matrixWorldNeedsUpdate

node_modules/@types/three/src/core/Object3D.d.ts:218

modelViewMatrix

readonly

Matrix4

new THREE.Matrix4()

-

THREE.Scene.modelViewMatrix

node_modules/@types/three/src/core/Object3D.d.ts:180

name

public

string

""

Optional name of the object Remarks (doesn't need to be unique).

THREE.Scene.name

node_modules/@types/three/src/core/Object3D.d.ts:122

normalMatrix

readonly

Matrix3

new THREE.Matrix3()

-

THREE.Scene.normalMatrix

node_modules/@types/three/src/core/Object3D.d.ts:185

occlusionTest?

public

boolean

undefined

-

THREE.Scene.occlusionTest

node_modules/@types/three/src/renderers/common/Backend.d.ts:9

overrideMaterial

public

null | Material

null

Forces everything in the Scene to be rendered with the defined material.

THREE.Scene.overrideMaterial

node_modules/@types/three/src/scenes/Scene.d.ts:76

parent

public

null | Object3D<Object3DEventMap>

null

Object's parent in the scene grapharrow-up-right. Remarks An object can have at most one parent.

THREE.Scene.parent

node_modules/@types/three/src/core/Object3D.d.ts:137

plotStage

public

Group

undefined

-

-

position

readonly

Vector3

new THREE.Vector3() - that is (0, 0, 0).

Object's local position.

THREE.Scene.position

node_modules/@types/three/src/core/Object3D.d.ts:157

quaternion

readonly

Quaternion

new THREE.Quaternion() - that is (0, 0, 0, 1).

Object's local rotation as a THREE.Quaternion | Quaternion.

THREE.Scene.quaternion

node_modules/@types/three/src/core/Object3D.d.ts:169

receiveShadow

public

boolean

false

Whether the material receives shadows.

THREE.Scene.receiveShadow

node_modules/@types/three/src/core/Object3D.d.ts:244

renderOrder

public

number

0

This value allows the default rendering order of scene grapharrow-up-right objects to be overridden although opaque and transparent objects remain sorted independently. Remarks When this property is set for an instance of Group | Group, all descendants objects will be sorted and rendered together. Sorting is from lowest to highest renderOrder.

THREE.Scene.renderOrder

node_modules/@types/three/src/core/Object3D.d.ts:260

rotation

readonly

Euler

new THREE.Euler() - that is (0, 0, 0, Euler.DEFAULT_ORDER).

Object's local rotation (Euler anglesarrow-up-right), in radians.

THREE.Scene.rotation

node_modules/@types/three/src/core/Object3D.d.ts:163

scale

readonly

Vector3

new THREE.Vector3( 1, 1, 1 )

The object's local scale.

THREE.Scene.scale

node_modules/@types/three/src/core/Object3D.d.ts:175

sphere

public

Group

undefined

-

-

static?

public

boolean

undefined

-

THREE.Scene.static

node_modules/@types/three/src/renderers/common/Backend.d.ts:11

type

public

"Scene"

Scene

-

THREE.Scene.type

node_modules/@types/three/src/scenes/Scene.d.ts:50

up

public

Vector3

Object3D.DEFAULT_UP - that is (0, 1, 0).

This is used by the lookAt method, for example, to determine the orientation of the result.

THREE.Scene.up

node_modules/@types/three/src/core/Object3D.d.ts:151

userData

public

Record<string, any>

undefined

An object that can be used to store custom data about the Object3D. Remarks It should not hold references to functions as these will not be cloned. Default {}

THREE.Scene.userData

node_modules/@types/three/src/core/Object3D.d.ts:273

uuid

public

string

undefined

UUIDarrow-up-right of this object instance. Remarks This gets automatically assigned and shouldn't be edited.

THREE.Scene.uuid

node_modules/@types/three/src/core/Object3D.d.ts:115

visible

public

boolean

true

Object gets rendered if true.

THREE.Scene.visible

node_modules/@types/three/src/core/Object3D.d.ts:232

DEFAULT_MATRIX_AUTO_UPDATE

static

boolean

true

The default setting for matrixAutoUpdate for newly created Object3Ds.

THREE.Scene.DEFAULT_MATRIX_AUTO_UPDATE

node_modules/@types/three/src/core/Object3D.d.ts:373

DEFAULT_MATRIX_WORLD_AUTO_UPDATE

static

boolean

true

The default setting for matrixWorldAutoUpdate for newly created Object3Ds.

THREE.Scene.DEFAULT_MATRIX_WORLD_AUTO_UPDATE

node_modules/@types/three/src/core/Object3D.d.ts:379

DEFAULT_UP

static

Vector3

new THREE.Vector3( 0, 1, 0)

The default up direction for objects, also used as the default position for THREE.DirectionalLight | DirectionalLight, THREE.HemisphereLight | HemisphereLight and THREE.Spotlight | Spotlight (which creates lights shining from the top down).

THREE.Scene.DEFAULT_UP

node_modules/@types/three/src/core/Object3D.d.ts:367

Accessors

backgroundColor

Get Signature

get backgroundColor(): Color

Defined in: src/bloch-sphere-scene.ts:136arrow-up-right

Returns

Color

Set Signature

set backgroundColor(color): void

Defined in: src/bloch-sphere-scene.ts:140arrow-up-right

Parameters

Parameter
Type

color

ColorRepresentation

Returns

void

Methods

add()

add(...object): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:515

Adds another Object3D as child of this Object3D.

Parameters

Parameter
Type
Description

...object

Object3D<Object3DEventMap>[]

Returns

this

Remarks

An arbitrary number of objects may be added Any current parent on an object passed in here will be removed, since an Object3D can have at most one parent.

See

  • THREE.Group | Group for info on manually grouping objects.

Inherited from

THREE.Scene.add


addEventListener()

addEventListener<T>(type, listener): void

Defined in: node_modules/@types/three/src/core/EventDispatcher.d.ts:52

Adds a listener to an event type.

Type Parameters

Type Parameter

T extends keyof Object3DEventMap

Parameters

Parameter
Type
Description

type

T

The type of event to listen to.

listener

EventListener<Object3DEventMap[T], T, BlochSphereScene>

The function that gets called when the event is fired.

Returns

void

Inherited from

THREE.Scene.addEventListener


applyMatrix4()

applyMatrix4(matrix): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:385

Applies the matrix transform to the object and updates the object's position, rotation and scale.

Parameters

Parameter
Type
Description

matrix

Matrix4

Returns

void

Inherited from

THREE.Scene.applyMatrix4


applyQuaternion()

applyQuaternion(quaternion): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:391

Applies the rotation represented by the quaternion to the object.

Parameters

Parameter
Type
Description

quaternion

Quaternion

Returns

this

Inherited from

THREE.Scene.applyQuaternion


attach()

attach(object): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:541

Adds a Object3D as a child of this, while maintaining the object's world transform.

Parameters

Parameter
Type
Description

object

Object3D

Returns

this

Remarks

Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).

See

add

Inherited from

THREE.Scene.attach


clear()

clear(): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:533

Removes all child objects.

Returns

this

Inherited from

THREE.Scene.clear


clearPlot()

clearPlot(): void

Defined in: src/bloch-sphere-scene.ts:207arrow-up-right

Returns

void


clone()

clone(recursive?): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:664

Returns a clone of this object and optionally all descendants.

Parameters

Parameter
Type
Description

recursive?

boolean

If true, descendants of the object are also cloned. Default true

Returns

this

Inherited from

THREE.Scene.clone


copy()

copy(object, recursive?): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:673

Copies the given object into this object.

Parameters

Parameter
Type
Description

object

Object3D

recursive?

boolean

If set to true, descendants of the object are copied next to the existing ones. If set to false, descendants are left unchanged. Default is true.

Returns

this

Remarks

Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.

Inherited from

THREE.Scene.copy


dispatchEvent()

dispatchEvent<T>(event): void

Defined in: node_modules/@types/three/src/core/EventDispatcher.d.ts:81

Fire an event type.

Type Parameters

Type Parameter

T extends keyof Object3DEventMap

Parameters

Parameter
Type
Description

event

BaseEvent<T> & Object3DEventMap[T]

The event that gets fired.

Returns

void

Inherited from

THREE.Scene.dispatchEvent


getObjectById()

getObjectById(id): undefined | Object3D<Object3DEventMap>

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:549

Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

Parameters

Parameter
Type
Description

id

number

Unique number of the object instance. Expects a Integer

Returns

undefined | Object3D<Object3DEventMap>

Remarks

Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.

See

id

Inherited from

THREE.Scene.getObjectById


getObjectByName()

getObjectByName(name): undefined | Object3D<Object3DEventMap>

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:557

Searches through an object and its children, starting with the object itself, and returns the first with a matching name.

Parameters

Parameter
Type
Description

name

string

String to match to the children's Object3D.name property.

Returns

undefined | Object3D<Object3DEventMap>

Remarks

Note that for most objects the name is an empty string by default You will have to set it manually to make use of this method.

Inherited from

THREE.Scene.getObjectByName


getObjectByProperty()

getObjectByProperty(name, value): undefined | Object3D<Object3DEventMap>

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:566

Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.

Parameters

Parameter
Type
Description

name

string

the property name to search for.

value

any

value of the given property.

Returns

undefined | Object3D<Object3DEventMap>

Inherited from

THREE.Scene.getObjectByProperty


getObjectsByProperty()

getObjectsByProperty(name, value, optionalTarget?): Object3D<Object3DEventMap>[]

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:576

Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.

Parameters

Parameter
Type
Description

name

string

The property name to search for.

value

any

Value of the given property.

optionalTarget?

Object3D<Object3DEventMap>[]

target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).

Returns

Object3D<Object3DEventMap>[]

Inherited from

THREE.Scene.getObjectsByProperty


getWorldDirection()

getWorldDirection(target): Vector3

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:600

Returns a vector representing the direction of object's positive z-axis in world space.

Parameters

Parameter
Type
Description

target

Vector3

The result will be copied into this Vector3.

Returns

Vector3

Inherited from

THREE.Scene.getWorldDirection


getWorldPosition()

getWorldPosition(target): Vector3

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:582

Returns a vector representing the position of the object in world space.

Parameters

Parameter
Type
Description

target

Vector3

The result will be copied into this Vector3.

Returns

Vector3

Inherited from

THREE.Scene.getWorldPosition


getWorldQuaternion()

getWorldQuaternion(target): Quaternion

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:588

Returns a quaternion representing the rotation of the object in world space.

Parameters

Parameter
Type
Description

target

Quaternion

The result will be copied into this Quaternion.

Returns

Quaternion

Inherited from

THREE.Scene.getWorldQuaternion


getWorldScale()

getWorldScale(target): Vector3

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:594

Returns a vector of the scaling factors applied to the object for each axis in world space.

Parameters

Parameter
Type
Description

target

Vector3

The result will be copied into this Vector3.

Returns

Vector3

Inherited from

THREE.Scene.getWorldScale


hasEventListener()

hasEventListener<T>(type, listener): boolean

Defined in: node_modules/@types/three/src/core/EventDispatcher.d.ts:62

Checks if listener is added to an event type.

Type Parameters

Type Parameter

T extends keyof Object3DEventMap

Parameters

Parameter
Type
Description

type

T

The type of event to listen to.

listener

EventListener<Object3DEventMap[T], T, BlochSphereScene>

The function that gets called when the event is fired.

Returns

boolean

Inherited from

THREE.Scene.hasEventListener


localToWorld()

localToWorld(vector): Vector3

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:484

Converts the vector from this object's local space to world space.

Parameters

Parameter
Type
Description

vector

Vector3

A vector representing a position in this object's local space.

Returns

Vector3

Inherited from

THREE.Scene.localToWorld


lookAt()

Call Signature

lookAt(vector): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:497

Rotates the object to face a point in world space.

Parameters

Parameter
Type
Description

vector

Vector3

A vector representing a position in world space to look at.

Returns

void

Remarks

This method does not support objects having non-uniformly-scaled parent(s).

Inherited from

THREE.Scene.lookAt

Call Signature

lookAt(x, y, z): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:505

Rotates the object to face a point in world space.

Parameters

Parameter
Type
Description

x

number

Expects a Float

y

number

Expects a Float

z

number

Expects a Float

Returns

void

Remarks

This method does not support objects having non-uniformly-scaled parent(s).

Inherited from

THREE.Scene.lookAt


onAfterRender()

onAfterRender(renderer, scene, camera, geometry, material, group): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:353

An optional callback that is executed immediately after a 3D object is rendered.

Parameters

Parameter
Type

renderer

WebGLRenderer

scene

Scene

camera

Camera

geometry

BufferGeometry

material

Material

group

Group

Returns

void

Remarks

This function is called with the following parameters: renderer, scene, camera, geometry, material, group. Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of Mesh, Line, Points or Sprite. Instances of Object3D, Group or Bone are not renderable and thus this callback is not executed for such objects.

Inherited from

THREE.Scene.onAfterRender


onAfterShadow()

onAfterShadow(renderer, scene, camera, shadowCamera, geometry, depthMaterial, group): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:318

An optional callback that is executed immediately after a 3D object is rendered to a shadow map.

Parameters

Parameter
Type

renderer

WebGLRenderer

scene

Scene

camera

Camera

shadowCamera

Camera

geometry

BufferGeometry

depthMaterial

Material

group

Group

Returns

void

Remarks

This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, depthMaterial, group. Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of Mesh, Line, Points or Sprite. Instances of Object3D, Group or Bone are not renderable and thus this callback is not executed for such objects.

Inherited from

THREE.Scene.onAfterShadow


onBeforeRender()

onBeforeRender(renderer, scene, camera, geometry, material, group): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:336

An optional callback that is executed immediately before a 3D object is rendered.

Parameters

Parameter
Type

renderer

WebGLRenderer

scene

Scene

camera

Camera

geometry

BufferGeometry

material

Material

group

Group

Returns

void

Remarks

This function is called with the following parameters: renderer, scene, camera, geometry, material, group. Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of Mesh, Line, Points or Sprite. Instances of Object3D, Group or Bone are not renderable and thus this callback is not executed for such objects.

Inherited from

THREE.Scene.onBeforeRender


onBeforeShadow()

onBeforeShadow(renderer, scene, camera, shadowCamera, geometry, depthMaterial, group): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:299

An optional callback that is executed immediately before a 3D object is rendered to a shadow map.

Parameters

Parameter
Type

renderer

WebGLRenderer

scene

Scene

camera

Camera

shadowCamera

Camera

geometry

BufferGeometry

depthMaterial

Material

group

Group

Returns

void

Remarks

This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry, depthMaterial, group. Please notice that this callback is only executed for renderable 3D objects. Meaning 3D objects which define their visual appearance with geometries and materials like instances of Mesh, Line, Points or Sprite. Instances of Object3D, Group or Bone are not renderable and thus this callback is not executed for such objects.

Inherited from

THREE.Scene.onBeforeShadow


raycast()

raycast(raycaster, intersects): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:610

Abstract (empty) method to get intersections between a casted ray and this object

Parameters

Parameter
Type
Description

raycaster

Raycaster

intersects

Intersection<Object3D<Object3DEventMap>>[]

Returns

void

Remarks

Subclasses such as THREE.Mesh | Mesh, THREE.Line | Line, and THREE.Points | Points implement this method in order to use raycasting.

See

THREE.Raycaster | Raycaster

Default Value

() => {}

Inherited from

THREE.Scene.raycast


remove()

remove(...object): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:523

Removes a Object3D as child of this Object3D.

Parameters

Parameter
Type
Description

...object

Object3D<Object3DEventMap>[]

Returns

this

Remarks

An arbitrary number of objects may be removed.

See

THREE.Group | Group for info on manually grouping objects.

Inherited from

THREE.Scene.remove


removeEventListener()

removeEventListener<T>(type, listener): void

Defined in: node_modules/@types/three/src/core/EventDispatcher.d.ts:72

Removes a listener from an event type.

Type Parameters

Type Parameter

T extends keyof Object3DEventMap

Parameters

Parameter
Type
Description

type

T

The type of the listener that gets removed.

listener

EventListener<Object3DEventMap[T], T, BlochSphereScene>

The listener function that gets removed.

Returns

void

Inherited from

THREE.Scene.removeEventListener


removeFromParent()

removeFromParent(): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:528

Removes this object from its current parent.

Returns

this

Inherited from

THREE.Scene.removeFromParent


rotateOnAxis()

rotateOnAxis(axis, angle): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:425

Rotate an object along an axis in object space.

Parameters

Parameter
Type
Description

axis

Vector3

A normalized vector in object space.

angle

number

The angle in radians. Expects a Float

Returns

this

Remarks

The axis is assumed to be normalized.

Inherited from

THREE.Scene.rotateOnAxis


rotateOnWorldAxis()

rotateOnWorldAxis(axis, angle): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:434

Rotate an object along an axis in world space.

Parameters

Parameter
Type
Description

axis

Vector3

A normalized vector in world space.

angle

number

The angle in radians. Expects a Float

Returns

this

Remarks

The axis is assumed to be normalized Method Assumes no rotated parent.

Inherited from

THREE.Scene.rotateOnWorldAxis


rotateX()

rotateX(angle): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:440

Rotates the object around x axis in local space.

Parameters

Parameter
Type

angle

number

Returns

this

Inherited from

THREE.Scene.rotateX


rotateY()

rotateY(angle): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:446

Rotates the object around y axis in local space.

Parameters

Parameter
Type

angle

number

Returns

this

Inherited from

THREE.Scene.rotateY


rotateZ()

rotateZ(angle): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:452

Rotates the object around z axis in local space.

Parameters

Parameter
Type

angle

number

Returns

this

Inherited from

THREE.Scene.rotateZ


setRotationFromAxisAngle()

setRotationFromAxisAngle(axis, angle): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:398

Calls THREE.Quaternion.setFromAxisAngle | setFromAxisAngle(axis, angle) on the .quaternion.

Parameters

Parameter
Type
Description

axis

Vector3

A normalized vector in object space.

angle

number

Angle in radians. Expects a Float

Returns

void

Inherited from

THREE.Scene.setRotationFromAxisAngle


setRotationFromEuler()

setRotationFromEuler(euler): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:404

Calls THREE.Quaternion.setFromEuler | setFromEuler(euler) on the .quaternion.

Parameters

Parameter
Type
Description

euler

Euler

Euler angle specifying rotation amount.

Returns

void

Inherited from

THREE.Scene.setRotationFromEuler


setRotationFromMatrix()

setRotationFromMatrix(m): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:411

Calls THREE.Quaternion.setFromRotationMatrix | setFromRotationMatrix(m) on the .quaternion.

Parameters

Parameter
Type
Description

m

Matrix4

Rotate the quaternion by the rotation component of the matrix.

Returns

void

Remarks

Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).

Inherited from

THREE.Scene.setRotationFromMatrix


setRotationFromQuaternion()

setRotationFromQuaternion(q): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:417

Copy the given THREE.Quaternion | Quaternion into .quaternion.

Parameters

Parameter
Type
Description

q

Quaternion

Normalized Quaternion.

Returns

void

Inherited from

THREE.Scene.setRotationFromQuaternion


toJSON()

toJSON(meta?): SceneJSON

Defined in: node_modules/@types/three/src/scenes/Scene.d.ts:117

Convert the Scene to three.js JSON Object/Scene formatarrow-up-right.

Parameters

Parameter
Type
Description

meta?

JSONMeta

Object containing metadata such as textures or images for the scene.

Returns

SceneJSON

Inherited from

THREE.Scene.toJSON


translateOnAxis()

translateOnAxis(axis, distance): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:460

Translate an object by distance along an axis in object space

Parameters

Parameter
Type
Description

axis

Vector3

A normalized vector in object space.

distance

number

The distance to translate. Expects a Float

Returns

this

Remarks

The axis is assumed to be normalized.

Inherited from

THREE.Scene.translateOnAxis


translateX()

translateX(distance): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:466

Translates object along x axis in object space by distance units.

Parameters

Parameter
Type
Description

distance

number

Expects a Float

Returns

this

Inherited from

THREE.Scene.translateX


translateY()

translateY(distance): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:472

Translates object along y axis in object space by distance units.

Parameters

Parameter
Type
Description

distance

number

Expects a Float

Returns

this

Inherited from

THREE.Scene.translateY


translateZ()

translateZ(distance): this

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:478

Translates object along z axis in object space by distance units.

Parameters

Parameter
Type
Description

distance

number

Expects a Float

Returns

this

Inherited from

THREE.Scene.translateZ


traverse()

traverse(callback): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:617

Executes the callback on this object and all descendants.

Parameters

Parameter
Type
Description

callback

(object) => any

A function with as first argument an Object3D object.

Returns

void

Remarks

Note: Modifying the scene graph inside the callback is discouraged.

Inherited from

THREE.Scene.traverse


traverseAncestors()

traverseAncestors(callback): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:632

Executes the callback on all ancestors.

Parameters

Parameter
Type
Description

callback

(object) => any

A function with as first argument an Object3D object.

Returns

void

Remarks

Note: Modifying the scene graph inside the callback is discouraged.

Inherited from

THREE.Scene.traverseAncestors


traverseVisible()

traverseVisible(callback): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:625

Like traverse, but the callback will only be executed for visible objects

Parameters

Parameter
Type
Description

callback

(object) => any

A function with as first argument an Object3D object.

Returns

void

Remarks

Descendants of invisible objects are not traversed. Note: Modifying the scene graph inside the callback is discouraged.

Inherited from

THREE.Scene.traverseVisible


updateMatrix()

updateMatrix(): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:637

Updates local transform.

Returns

void

Inherited from

THREE.Scene.updateMatrix


updateMatrixWorld()

updateMatrixWorld(force?): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:645

Updates the global transform of the object. And will update the object descendants if .matrixWorldNeedsUpdate is set to true or if the force parameter is set to true.

Parameters

Parameter
Type
Description

force?

boolean

A boolean that can be used to bypass .matrixWorldAutoUpdate, to recalculate the world matrix of the object and descendants on the current frame. Useful if you cannot wait for the renderer to update it on the next frame, assuming .matrixWorldAutoUpdate set to true.

Returns

void

Inherited from

THREE.Scene.updateMatrixWorld


updateWorldMatrix()

updateWorldMatrix(updateParents, updateChildren): void

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:652

Updates the global transform of the object.

Parameters

Parameter
Type
Description

updateParents

boolean

Recursively updates global transform of ancestors.

updateChildren

boolean

Recursively updates global transform of descendants.

Returns

void

Inherited from

THREE.Scene.updateWorldMatrix


worldToLocal()

worldToLocal(vector): Vector3

Defined in: node_modules/@types/three/src/core/Object3D.d.ts:490

Converts the vector from world space to this object's local space.

Parameters

Parameter
Type
Description

vector

Vector3

A vector representing a position in world space.

Returns

Vector3

Inherited from

THREE.Scene.worldToLocal

Last updated