Skip to content

editorGlobalsSceneBackground

Class: SceneBackground

Hierarchy

  • SceneBackground

Index

Constructors

Properties

Methods

Constructors

constructor

+ new SceneBackground(camera: PerspectiveCamera, scene: Scene, animationFunction: function, physicsContext: PhysicsContext): SceneBackground

Defined in src/renderContext/SceneBackground.ts:47

Parameters:

camera: PerspectiveCamera

scene: Scene

animationFunction: function

▸ (animation: KyubAnimation‹any›): void

Parameters:

Name Type
animation KyubAnimation‹any›

physicsContext: PhysicsContext

Returns: SceneBackground

Properties

Private animationFunction

animationFunction: function

Defined in src/renderContext/SceneBackground.ts:34

Type declaration:

▸ (animation: KyubAnimation‹any›): void

Parameters:

Name Type
animation KyubAnimation‹any›

Private backgroundLoaded

backgroundLoaded: boolean = false

Defined in src/renderContext/SceneBackground.ts:45


Private backgroundObjectContainer

backgroundObjectContainer: Object3D = new Object3D()

Defined in src/renderContext/SceneBackground.ts:31


Private backgroundPartsCache

backgroundPartsCache: Record‹string, any›

Defined in src/renderContext/SceneBackground.ts:28


Private camera

camera: PerspectiveCamera

Defined in src/renderContext/SceneBackground.ts:36


Private compositeModel

compositeModel: CompositeModel | null = null

Defined in src/renderContext/SceneBackground.ts:41


Private currentBackgroundName

currentBackgroundName: string | null = null

Defined in src/renderContext/SceneBackground.ts:23


Private currentBackgroundParts

currentBackgroundParts: BackgroundParts | null = null

Defined in src/renderContext/SceneBackground.ts:26


Private nextBackgroundParts

nextBackgroundParts: BackgroundParts | null = null

Defined in src/renderContext/SceneBackground.ts:27


Private physicsContext

physicsContext: PhysicsContext

Defined in src/renderContext/SceneBackground.ts:38


Private physicsWallsAdjustTimeout

physicsWallsAdjustTimeout: any = null

Defined in src/renderContext/SceneBackground.ts:47


Private scene

scene: Scene

Defined in src/renderContext/SceneBackground.ts:37

Methods

Private _animateCamera

_animateCamera(duration: number, position: Vector3, rotation: Quaternion): Promise‹any›

Defined in src/renderContext/SceneBackground.ts:262

Animates the camera. The animation is skipped, if the camera does not change its position/rotation.

Parameters:

Name Type Description
duration number the duration of the animation
position Vector3 the position the camera will have after the animation
rotation Quaternion the rotation the camera will have after the animation

Returns: Promise‹any›

a promise that resolves, when the animation finished


Private _showNextBackground

_showNextBackground(): void

Defined in src/renderContext/SceneBackground.ts:236

Shows the next background, then hides the current one

Returns: void


animateCameraWithinOneBackground

animateCameraWithinOneBackground(targetPosition: Vector3, targetRotation: Quaternion, immediateStageSizeAdjustment: boolean): Promise‹any›

Defined in src/renderContext/SceneBackground.ts:191

Parameters:

Name Type Default
targetPosition Vector3 -
targetRotation Quaternion -
immediateStageSizeAdjustment boolean true

Returns: Promise‹any›


getCurrentBackgroundName

getCurrentBackgroundName(): string | null

Defined in src/renderContext/SceneBackground.ts:79

Returns: string | null


getCurrentBackgroundParts

getCurrentBackgroundParts(): BackgroundParts | null

Defined in src/renderContext/SceneBackground.ts:83

Returns: BackgroundParts | null


getCurrentBackgroundProperties

getCurrentBackgroundProperties(): IBackgroundProperties | undefined

Defined in src/renderContext/SceneBackground.ts:87

Returns: IBackgroundProperties | undefined


getThreeNode

getThreeNode(): Object3D

Defined in src/renderContext/SceneBackground.ts:91

Returns: Object3D


isBackgroundLoaded

isBackgroundLoaded(): boolean

Defined in src/renderContext/SceneBackground.ts:179

true if the scene contains a fully loaded background

Returns: boolean


resetBackgroundParts

resetBackgroundParts(): void

Defined in src/renderContext/SceneBackground.ts:183

Returns: void


setBackground

setBackground(newBackgroundName: string, transition: "zoomThenBlend" | "blendThenZoom"): Promise‹void›

Defined in src/renderContext/SceneBackground.ts:102

Sets the background name. If it differs from the current background, the new background will be loaded.

Parameters:

Name Type Description
newBackgroundName string the name of the background (foldername in assets folder)
transition "zoomThenBlend" | "blendThenZoom" the transition to be used, either 'zoomThenBlend' or 'blendThenZoom'

Returns: Promise‹void›

promise that resolves when the background is fully loaded


setCompositeModel

setCompositeModel(compositeModel: CompositeModel, initBackground: boolean): void

Defined in src/renderContext/SceneBackground.ts:68

Parameters:

Name Type Default
compositeModel CompositeModel -
initBackground boolean false

Returns: void


stageSizeChanged

stageSizeChanged(camera: any): void

Defined in src/renderContext/SceneBackground.ts:227

Notify backgroundParts of the new stage size

Parameters:

Name Type
camera any

Returns: void


updateLights

updateLights(): void

Defined in src/renderContext/SceneBackground.ts:187

Returns: void