# RegionDisplay

[**@qbead/bloch-sphere**](https://qbead.gitbook.io/bloch-sphere/index)

***

[@qbead/bloch-sphere](https://qbead.gitbook.io/bloch-sphere/index) / RegionDisplay

## Class: RegionDisplay

Defined in: [src/components/region-display.ts:23](https://github.com/qbead/bloch-sphere/blob/41247d60e67bd802cc21854379a06362e5d0957c/src/components/region-display.ts#L23)

A display for a region on the Bloch sphere

This component shows a spherical polygon on the Bloch sphere.

### Example

```ts
const region = new RegionDisplay([
  BlochVector.fromAngles(0, 0),
  BlochVector.fromAngles(1, 0.1),
  BlochVector.fromAngles(1, 1),
])
region.color = 0xe1b53e
blochSphere.add(region)
```

### Extends

* [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent)

### Constructors

#### Constructor

> **new RegionDisplay**(`region`?): `RegionDisplay`

Defined in: [src/components/region-display.ts:25](https://github.com/qbead/bloch-sphere/blob/41247d60e67bd802cc21854379a06362e5d0957c/src/components/region-display.ts#L25)

**Parameters**

| Parameter | Type                                                                          |
| --------- | ----------------------------------------------------------------------------- |
| `region`? | [`BlochVector`](https://qbead.gitbook.io/bloch-sphere/classes/blochvector)\[] |

**Returns**

`RegionDisplay`

**Overrides**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`constructor`](https://qbead.gitbook.io/bloch-sphere/basecomponent#constructor)

### Properties

| Property                           | Modifier    | Type                                     | Default value                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                   | Inherited from                                                                                                                                                                                            | Defined in                                                                                                                                          |
| ---------------------------------- | ----------- | ---------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `_color`                           | `protected` | `Color`                                  | `undefined`                                                     | -                                                                                                                                                                                                                                                                                                                                                                                             | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`_color`](https://qbead.gitbook.io/bloch-sphere/basecomponent#_color)                                                     | [src/components/component.ts:7](https://github.com/qbead/bloch-sphere/blob/41247d60e67bd802cc21854379a06362e5d0957c/src/components/component.ts#L7) |
| `animations`                       | `public`    | `AnimationClip`\[]                       | `[]`                                                            | Array with object's animation clips.                                                                                                                                                                                                                                                                                                                                                          | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`animations`](https://qbead.gitbook.io/bloch-sphere/basecomponent#animations)                                             | node\_modules/@types/three/src/core/Object3D.d.ts:266                                                                                               |
| `castShadow`                       | `public`    | `boolean`                                | `false`                                                         | Whether the object gets rendered into shadow map.                                                                                                                                                                                                                                                                                                                                             | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`castShadow`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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.                                                                                                                                                                                                                                                                                     | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`children`](https://qbead.gitbook.io/bloch-sphere/basecomponent#children)                                                 | node\_modules/@types/three/src/core/Object3D.d.ts:145                                                                                               |
| `count?`                           | `public`    | `number`                                 | `undefined`                                                     | -                                                                                                                                                                                                                                                                                                                                                                                             | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`count`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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.                                             | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`customDepthMaterial`](https://qbead.gitbook.io/bloch-sphere/basecomponent#customdepthmaterial)                           | node\_modules/@types/three/src/core/Object3D.d.ts:282                                                                                               |
| `customDistanceMaterial?`          | `public`    | `Material`                               | `undefined`                                                     | Same as [customDepthMaterial](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#customdepthmaterial), but used with THREE.Object3DPointLight \| PointLight.                                                                                                                                                                                                                                  | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`customDistanceMaterial`](https://qbead.gitbook.io/bloch-sphere/basecomponent#customdistancematerial)                     | node\_modules/@types/three/src/core/Object3D.d.ts:288                                                                                               |
| `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.                                                                                                                                                                     | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`frustumCulled`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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`                                                                                                                                                                                                           | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`id`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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                                                                                                                                                                                                                                                                                                   | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`isObject3D`](https://qbead.gitbook.io/bloch-sphere/basecomponent#isobject3d)                                             | node\_modules/@types/three/src/core/Object3D.d.ts:102                                                                                               |
| `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.                                                                                            | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`layers`](https://qbead.gitbook.io/bloch-sphere/basecomponent#layers)                                                     | node\_modules/@types/three/src/core/Object3D.d.ts:226                                                                                               |
| `matrix`                           | `public`    | `Matrix4`                                | `new THREE.Matrix4()`                                           | The local transform matrix.                                                                                                                                                                                                                                                                                                                                                                   | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`matrix`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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.                                                                                                                                                                                                                                        | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`matrixAutoUpdate`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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.                                                                                                                                                                                                                                   | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`matrixWorld`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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.                                                                                                                                                                                               | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`matrixWorldAutoUpdate`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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.                                                                                                                                                                                                                                                                                              | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`matrixWorldNeedsUpdate`](https://qbead.gitbook.io/bloch-sphere/basecomponent#matrixworldneedsupdate)                     | node\_modules/@types/three/src/core/Object3D.d.ts:218                                                                                               |
| `modelViewMatrix`                  | `readonly`  | `Matrix4`                                | `new THREE.Matrix4()`                                           | -                                                                                                                                                                                                                                                                                                                                                                                             | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`modelViewMatrix`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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)*.                                                                                                                                                                                                                                                                                                                        | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`name`](https://qbead.gitbook.io/bloch-sphere/basecomponent#name)                                                         | node\_modules/@types/three/src/core/Object3D.d.ts:122                                                                                               |
| `normalMatrix`                     | `readonly`  | `Matrix3`                                | `new THREE.Matrix3()`                                           | -                                                                                                                                                                                                                                                                                                                                                                                             | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`normalMatrix`](https://qbead.gitbook.io/bloch-sphere/basecomponent#normalmatrix)                                         | node\_modules/@types/three/src/core/Object3D.d.ts:185                                                                                               |
| `occlusionTest?`                   | `public`    | `boolean`                                | `undefined`                                                     | -                                                                                                                                                                                                                                                                                                                                                                                             | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`occlusionTest`](https://qbead.gitbook.io/bloch-sphere/basecomponent#occlusiontest)                                       | node\_modules/@types/three/src/renderers/common/Backend.d.ts:9                                                                                      |
| `parent`                           | `public`    | `null` \| `Object3D`<`Object3DEventMap`> | `null`                                                          | Object's parent in the [scene graph](https://en.wikipedia.org/wiki/Scene_graph). **Remarks** An object can have at most one parent.                                                                                                                                                                                                                                                           | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`parent`](https://qbead.gitbook.io/bloch-sphere/basecomponent#parent)                                                     | node\_modules/@types/three/src/core/Object3D.d.ts:137                                                                                               |
| `position`                         | `readonly`  | `Vector3`                                | `new THREE.Vector3()` - that is `(0, 0, 0)`.                    | Object's local position.                                                                                                                                                                                                                                                                                                                                                                      | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`position`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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.                                                                                                                                                                                                                                                                                                                                  | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`quaternion`](https://qbead.gitbook.io/bloch-sphere/basecomponent#quaternion)                                             | node\_modules/@types/three/src/core/Object3D.d.ts:169                                                                                               |
| `receiveShadow`                    | `public`    | `boolean`                                | `false`                                                         | Whether the material receives shadows.                                                                                                                                                                                                                                                                                                                                                        | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`receiveShadow`](https://qbead.gitbook.io/bloch-sphere/basecomponent#receiveshadow)                                       | node\_modules/@types/three/src/core/Object3D.d.ts:244                                                                                               |
| `renderOrder`                      | `public`    | `number`                                 | `0`                                                             | This value allows the default rendering order of [scene graph](https://en.wikipedia.org/wiki/Scene_graph) 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. | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`renderOrder`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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 angles](https://en.wikipedia.org/wiki/Euler_angles)), in radians.                                                                                                                                                                                                                                                                                             | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`rotation`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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.                                                                                                                                                                                                                                                                                                                                                                     | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`scale`](https://qbead.gitbook.io/bloch-sphere/basecomponent#scale)                                                       | node\_modules/@types/three/src/core/Object3D.d.ts:175                                                                                               |
| `static?`                          | `public`    | `boolean`                                | `undefined`                                                     | -                                                                                                                                                                                                                                                                                                                                                                                             | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`static`](https://qbead.gitbook.io/bloch-sphere/basecomponent#static)                                                     | node\_modules/@types/three/src/renderers/common/Backend.d.ts:11                                                                                     |
| `type`                             | `readonly`  | `string`                                 | `Object3D`                                                      | A Read-only *string* to check `this` object type. **Remarks** This can be used to find a specific type of Object3D in a scene. Sub-classes will update this value.                                                                                                                                                                                                                            | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`type`](https://qbead.gitbook.io/bloch-sphere/basecomponent#type)                                                         | node\_modules/@types/three/src/core/Object3D.d.ts:130                                                                                               |
| `up`                               | `public`    | `Vector3`                                | Object3D.DEFAULT\_UP - that is `(0, 1, 0)`.                     | This is used by the [lookAt](#lookat) method, for example, to determine the orientation of the result.                                                                                                                                                                                                                                                                                        | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`up`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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** `{}`                                                                                                                                                                                                                | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`userData`](https://qbead.gitbook.io/bloch-sphere/basecomponent#userdata)                                                 | node\_modules/@types/three/src/core/Object3D.d.ts:273                                                                                               |
| `uuid`                             | `public`    | `string`                                 | `undefined`                                                     | [UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier) of this object instance. **Remarks** This gets automatically assigned and shouldn't be edited.                                                                                                                                                                                                                             | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`uuid`](https://qbead.gitbook.io/bloch-sphere/basecomponent#uuid)                                                         | node\_modules/@types/three/src/core/Object3D.d.ts:115                                                                                               |
| `visible`                          | `public`    | `boolean`                                | `true`                                                          | Object gets rendered if `true`.                                                                                                                                                                                                                                                                                                                                                               | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`visible`](https://qbead.gitbook.io/bloch-sphere/basecomponent#visible)                                                   | node\_modules/@types/three/src/core/Object3D.d.ts:232                                                                                               |
| `DEFAULT_MATRIX_AUTO_UPDATE`       | `static`    | `boolean`                                | `true`                                                          | The default setting for [matrixAutoUpdate](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#matrixautoupdate) for newly created Object3Ds.                                                                                                                                                                                                                                                  | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`DEFAULT_MATRIX_AUTO_UPDATE`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#matrixworldautoupdate) for newly created Object3Ds.                                                                                                                                                                                                                                        | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`DEFAULT_MATRIX_WORLD_AUTO_UPDATE`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#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).                                                                                  | [`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`DEFAULT_UP`](https://qbead.gitbook.io/bloch-sphere/basecomponent#default_up)                                             | node\_modules/@types/three/src/core/Object3D.d.ts:367                                                                                               |

### Accessors

#### color

**Get Signature**

> **get** **color**(): `ColorRepresentation`

Defined in: [src/components/region-display.ts:41](https://github.com/qbead/bloch-sphere/blob/41247d60e67bd802cc21854379a06362e5d0957c/src/components/region-display.ts#L41)

Get color of the component

**Returns**

`ColorRepresentation`

**Set Signature**

> **set** **color**(`color`): `void`

Defined in: [src/components/region-display.ts:46](https://github.com/qbead/bloch-sphere/blob/41247d60e67bd802cc21854379a06362e5d0957c/src/components/region-display.ts#L46)

Get color of the component

**Parameters**

| Parameter | Type                  |
| --------- | --------------------- |
| `color`   | `ColorRepresentation` |

**Returns**

`void`

**Overrides**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`color`](https://qbead.gitbook.io/bloch-sphere/basecomponent#color)

### 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](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#add-1) passed in here will be removed, since an Object3D can have at most one parent.

**See**

* [attach](#attach)
* THREE.Group | Group for info on manually grouping objects.

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`add`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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`, `RegionDisplay`> | The function that gets called when the event is fired. |

**Returns**

`void`

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`addEventListener`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`applyMatrix4`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`applyQuaternion`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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](#add)

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`attach`](https://qbead.gitbook.io/bloch-sphere/basecomponent#attach)

***

#### clear()

> **clear**(): `this`

Defined in: node\_modules/@types/three/src/core/Object3D.d.ts:533

Removes all child objects.

**Returns**

`this`

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`clear`](https://qbead.gitbook.io/bloch-sphere/basecomponent#clear)

***

#### 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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`clone`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`copy`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`dispatchEvent`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#getobjectbyid-1)

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`getObjectById`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`getObjectByName`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`getObjectByProperty`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`getObjectsByProperty`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`getWorldDirection`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`getWorldPosition`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`getWorldQuaternion`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`getWorldScale`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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`, `RegionDisplay`> | The function that gets called when the event is fired. |

**Returns**

`boolean`

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`hasEventListener`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`localToWorld`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`lookAt`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`lookAt`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`onAfterRender`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`onAfterShadow`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`onBeforeRender`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`onBeforeShadow`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`raycast`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`remove`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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`, `RegionDisplay`> | The listener function that gets removed.    |

**Returns**

`void`

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`removeEventListener`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`removeFromParent`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`rotateOnAxis`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`rotateOnWorldAxis`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`rotateX`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`rotateY`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`rotateZ`](https://qbead.gitbook.io/bloch-sphere/basecomponent#rotatez)

***

#### setRegion()

> **setRegion**(`points`): `void`

Defined in: [src/components/region-display.ts:56](https://github.com/qbead/bloch-sphere/blob/41247d60e67bd802cc21854379a06362e5d0957c/src/components/region-display.ts#L56)

Set the region of the display

**Parameters**

| Parameter | Type                                                                          | Description                               |
| --------- | ----------------------------------------------------------------------------- | ----------------------------------------- |
| `points`  | [`BlochVector`](https://qbead.gitbook.io/bloch-sphere/classes/blochvector)\[] | The bloch vectors that define the region. |

**Returns**

`void`

***

#### setRotationFromAxisAngle()

> **setRotationFromAxisAngle**(`axis`, `angle`): `void`

Defined in: node\_modules/@types/three/src/core/Object3D.d.ts:398

Calls THREE.Quaternion.setFromAxisAngle | setFromAxisAngle([axis](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#setrotationfromaxisangle-1), [angle](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#setrotationfromaxisangle-1)) on the [.quaternion](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`setRotationFromAxisAngle`](https://qbead.gitbook.io/bloch-sphere/basecomponent#setrotationfromaxisangle)

***

#### setRotationFromEuler()

> **setRotationFromEuler**(`euler`): `void`

Defined in: node\_modules/@types/three/src/core/Object3D.d.ts:404

Calls THREE.Quaternion.setFromEuler | setFromEuler([euler](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#setrotationfromeuler-1)) on the [.quaternion](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#quaternion).

**Parameters**

| Parameter | Type    | Description                             |
| --------- | ------- | --------------------------------------- |
| `euler`   | `Euler` | Euler angle specifying rotation amount. |

**Returns**

`void`

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`setRotationFromEuler`](https://qbead.gitbook.io/bloch-sphere/basecomponent#setrotationfromeuler)

***

#### setRotationFromMatrix()

> **setRotationFromMatrix**(`m`): `void`

Defined in: node\_modules/@types/three/src/core/Object3D.d.ts:411

Calls THREE.Quaternion.setFromRotationMatrix | setFromRotationMatrix([m](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#setrotationfrommatrix-1)) on the [.quaternion](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`setRotationFromMatrix`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#quaternion).

**Parameters**

| Parameter | Type         | Description            |
| --------- | ------------ | ---------------------- |
| `q`       | `Quaternion` | Normalized Quaternion. |

**Returns**

`void`

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`setRotationFromQuaternion`](https://qbead.gitbook.io/bloch-sphere/basecomponent#setrotationfromquaternion)

***

#### toJSON()

> **toJSON**(`meta`?): `Object3DJSON`

Defined in: node\_modules/@types/three/src/core/Object3D.d.ts:658

Convert the object to three.js [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4).

**Parameters**

| Parameter | Type       | Description                                                                      |
| --------- | ---------- | -------------------------------------------------------------------------------- |
| `meta`?   | `JSONMeta` | Object containing metadata such as materials, textures or images for the object. |

**Returns**

`Object3DJSON`

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`toJSON`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`translateOnAxis`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#translatex-1) units.

**Parameters**

| Parameter  | Type     | Description       |
| ---------- | -------- | ----------------- |
| `distance` | `number` | Expects a `Float` |

**Returns**

`this`

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`translateX`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#translatey-1) units.

**Parameters**

| Parameter  | Type     | Description       |
| ---------- | -------- | ----------------- |
| `distance` | `number` | Expects a `Float` |

**Returns**

`this`

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`translateY`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#translatez-1) units.

**Parameters**

| Parameter  | Type     | Description       |
| ---------- | -------- | ----------------- |
| `distance` | `number` | Expects a `Float` |

**Returns**

`this`

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`translateZ`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`traverse`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`traverseAncestors`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`traverseVisible`](https://qbead.gitbook.io/bloch-sphere/basecomponent#traversevisible)

***

#### updateMatrix()

> **updateMatrix**(): `void`

Defined in: node\_modules/@types/three/src/core/Object3D.d.ts:637

Updates local transform.

**Returns**

`void`

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`updateMatrix`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#matrixworldneedsupdate) is set to true or if the [force](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#updatematrixworld-1) parameter is set to `true`.

**Parameters**

| Parameter | Type      | Description                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `force`?  | `boolean` | A boolean that can be used to bypass [.matrixWorldAutoUpdate](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#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](https://qbead.gitbook.io/bloch-sphere/qubitdisplay#matrixworldautoupdate) set to `true`. |

**Returns**

`void`

**Inherited from**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`updateMatrixWorld`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`updateWorldMatrix`](https://qbead.gitbook.io/bloch-sphere/basecomponent#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**

[`BaseComponent`](https://qbead.gitbook.io/bloch-sphere/classes/basecomponent).[`worldToLocal`](https://qbead.gitbook.io/bloch-sphere/basecomponent#worldtolocal)
