Class Database
Implements
Constructors
constructor
-
new Database(
urlToScene: string,
callbackManifestChecked: (checked: boolean) => any,
disableManifestCheck?: boolean,
): DatabaseCreates a new Database
Parameters
- urlToScene: string
defines the url to load the scene
- callbackManifestChecked: (checked: boolean) => any
defines the callback to use when manifest is checked
- disableManifestCheck: boolean = false
defines a boolean indicating that we want to skip the manifest validation (it will be considered validated and up to date)
Returns Database
- urlToScene: string
Properties
StaticIDB Storage Enabled
Gets a boolean indicating if Database storage is enabled (off by default)
Accessors
enable Scene Offline
-
get enableSceneOffline(): boolean
Gets a boolean indicating if scene must be saved in the database
Returns boolean
enable Textures Offline
-
get enableTexturesOffline(): boolean
Gets a boolean indicating if textures must be saved in the database
Returns boolean
Methods
load File
-
loadFile(
url: string,
sceneLoaded: (data: any) => void,
progressCallBack?: (data: any) => void,
errorCallback?: () => void,
useArrayBuffer?: boolean,
): voidLoads a file from database
Parameters
- url: string
defines the URL to load from
- sceneLoaded: (data: any) => void
defines a callback to call on success
OptionalprogressCallBack: (data: any) => voiddefines a callback to call when progress changed
OptionalerrorCallback: () => voiddefines a callback to call on error
OptionaluseArrayBuffer: booleandefines a boolean to use array buffer instead of text string
Returns void
- url: string
load Image
-
Loads an image from the database
Parameters
- url: string
defines the url to load from
- image: HTMLImageElement
defines the target DOM image
Returns void
- url: string
open
-
Open the database and make it available
Parameters
- successCallback: () => void
defines the callback to call on success
- errorCallback: () => void
defines the callback to call on error
Returns void
- successCallback: () => void
Class used to enable access to IndexedDB
See
https://doc.babylonjs.com/features/featuresDeepDive/scene/optimizeCached