babylon.viewer.module.d.ts 100 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390
  1. /// <reference path="./babylon.d.ts"/>
  2. /// <reference path="./babylon.glTF2Interface.d.ts"/>
  3. /// <reference path="./babylonjs.loaders.d.ts"/>
  4. declare module "babylonjs-loaders"{ export=BABYLON;}
  5. // Generated by dts-bundle v0.7.3
  6. // Dependencies for this module:
  7. // ../../../../../Tools/Gulp/babylonjs
  8. // ../../../../../Tools/Gulp/babylonjs-loaders
  9. declare module 'babylonjs-viewer' {
  10. import { mapperManager } from 'babylonjs-viewer/configuration/mappers';
  11. import { viewerGlobals } from 'babylonjs-viewer/configuration/globals';
  12. import { viewerManager } from 'babylonjs-viewer/viewer/viewerManager';
  13. import { DefaultViewer } from 'babylonjs-viewer/viewer/defaultViewer';
  14. import { AbstractViewer } from 'babylonjs-viewer/viewer/viewer';
  15. import { telemetryManager } from 'babylonjs-viewer/managers/telemetryManager';
  16. import { ModelLoader } from 'babylonjs-viewer/loader/modelLoader';
  17. import { ViewerModel, ModelState } from 'babylonjs-viewer/model/viewerModel';
  18. import { AnimationPlayMode, AnimationState } from 'babylonjs-viewer/model/modelAnimation';
  19. import { ILoaderPlugin } from 'babylonjs-viewer/loader/plugins/loaderPlugin';
  20. import { AbstractViewerNavbarButton } from 'babylonjs-viewer/templating/viewerTemplatePlugin';
  21. import { registerCustomOptimizer } from 'babylonjs-viewer/optimizer/custom';
  22. /**
  23. * BabylonJS Viewer
  24. *
  25. * An HTML-Based viewer for 3D models, based on BabylonJS and its extensions.
  26. */
  27. import * as BABYLON from 'babylonjs';
  28. import 'babylonjs-loaders';
  29. import 'pepjs';
  30. import { InitTags } from 'babylonjs-viewer/initializer';
  31. let disableInit: boolean;
  32. /**
  33. * Dispose all viewers currently registered
  34. */
  35. function disposeAll(): void;
  36. const Version: string;
  37. export { BABYLON, Version, InitTags, DefaultViewer, AbstractViewer, viewerGlobals, telemetryManager, disableInit, viewerManager, mapperManager, disposeAll, ModelLoader, ViewerModel, AnimationPlayMode, AnimationState, ModelState, ILoaderPlugin, AbstractViewerNavbarButton, registerCustomOptimizer };
  38. export * from 'babylonjs-viewer/configuration';
  39. }
  40. declare module 'babylonjs-viewer/configuration/mappers' {
  41. import { ViewerConfiguration } from 'babylonjs-viewer/configuration/configuration';
  42. /**
  43. * This is the mapper's interface. Implement this function to create your own mapper and register it at the mapper manager
  44. */
  45. export interface IMapper {
  46. map(rawSource: any): ViewerConfiguration;
  47. }
  48. /**
  49. * The MapperManager manages the different implemented mappers.
  50. * It allows the user to register new mappers as well and use them to parse their own configuration data
  51. */
  52. export class MapperManager {
  53. /**
  54. * The default mapper is the JSON mapper.
  55. */
  56. static DefaultMapper: string;
  57. constructor();
  58. /**
  59. * Get a specific configuration mapper.
  60. *
  61. * @param type the name of the mapper to load
  62. */
  63. getMapper(type: string): IMapper;
  64. /**
  65. * Use this functio to register your own configuration mapper.
  66. * After a mapper is registered, it can be used to parse the specific type fo configuration to the standard ViewerConfiguration.
  67. * @param type the name of the mapper. This will be used to define the configuration type and/or to get the mapper
  68. * @param mapper The implemented mapper
  69. */
  70. registerMapper(type: string, mapper: IMapper): void;
  71. /**
  72. * Dispose the mapper manager and all of its mappers.
  73. */
  74. dispose(): void;
  75. }
  76. /**
  77. * mapperManager is a singleton of the type MapperManager.
  78. * The mapperManager can be disposed directly with calling mapperManager.dispose()
  79. * or indirectly with using BabylonViewer.disposeAll()
  80. */
  81. export let mapperManager: MapperManager;
  82. }
  83. declare module 'babylonjs-viewer/configuration/globals' {
  84. export class ViewerGlobals {
  85. disableInit: boolean;
  86. disableWebGL2Support: boolean;
  87. readonly version: string;
  88. }
  89. export let viewerGlobals: ViewerGlobals;
  90. }
  91. declare module 'babylonjs-viewer/viewer/viewerManager' {
  92. import { Observable } from 'babylonjs';
  93. import { AbstractViewer } from 'babylonjs-viewer/viewer/viewer';
  94. /**
  95. * The viewer manager is the container for all viewers currently registered on this page.
  96. * It is possible to have more than one viewer on a single page.
  97. */
  98. export class ViewerManager {
  99. /**
  100. * A callback that will be triggered when a new viewer was added
  101. */
  102. onViewerAdded: (viewer: AbstractViewer) => void;
  103. /**
  104. * Will notify when a new viewer was added
  105. */
  106. onViewerAddedObservable: Observable<AbstractViewer>;
  107. /**
  108. * Will notify when a viewer was removed (disposed)
  109. */
  110. onViewerRemovedObservable: Observable<string>;
  111. constructor();
  112. /**
  113. * Adding a new viewer to the viewer manager and start tracking it.
  114. * @param viewer the viewer to add
  115. */
  116. addViewer(viewer: AbstractViewer): void;
  117. /**
  118. * remove a viewer from the viewer manager
  119. * @param viewer the viewer to remove
  120. */
  121. removeViewer(viewer: AbstractViewer): void;
  122. /**
  123. * Get a viewer by its baseId (if the container element has an ID, it is the this is. if not, a random id was assigned)
  124. * @param id the id of the HTMl element (or the viewer's, if none provided)
  125. */
  126. getViewerById(id: string): AbstractViewer;
  127. /**
  128. * Get a viewer using a container element
  129. * @param element the HTML element to search viewers associated with
  130. */
  131. getViewerByHTMLElement(element: HTMLElement): AbstractViewer | undefined;
  132. /**
  133. * Get a promise that will fullfil when this viewer was initialized.
  134. * Since viewer initialization and template injection is asynchronous, using the promise will guaranty that
  135. * you will get the viewer after everything was already configured.
  136. * @param id the viewer id to find
  137. */
  138. getViewerPromiseById(id: string): Promise<AbstractViewer>;
  139. /**
  140. * dispose the manager and all of its associated viewers
  141. */
  142. dispose(): void;
  143. }
  144. export let viewerManager: ViewerManager;
  145. }
  146. declare module 'babylonjs-viewer/viewer/defaultViewer' {
  147. import { ViewerConfiguration, IModelConfiguration } from 'babylonjs-viewer/configuration';
  148. import { Template } from 'babylonjs-viewer/templating/templateManager';
  149. import { AbstractViewer } from 'babylonjs-viewer/viewer/viewer';
  150. import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
  151. import { IViewerTemplatePlugin } from 'babylonjs-viewer/templating/viewerTemplatePlugin';
  152. /**
  153. * The Default viewer is the default implementation of the AbstractViewer.
  154. * It uses the templating system to render a new canvas and controls.
  155. */
  156. export class DefaultViewer extends AbstractViewer {
  157. containerElement: HTMLElement;
  158. fullscreenElement?: HTMLElement;
  159. /**
  160. * Create a new default viewer
  161. * @param containerElement the element in which the templates will be rendered
  162. * @param initialConfiguration the initial configuration. Defaults to extending the default configuration
  163. */
  164. constructor(containerElement: HTMLElement, initialConfiguration?: ViewerConfiguration);
  165. registerTemplatePlugin(plugin: IViewerTemplatePlugin): void;
  166. /**
  167. * This will be executed when the templates initialize.
  168. */
  169. protected _onTemplatesLoaded(): Promise<AbstractViewer>;
  170. protected _initVR(): void;
  171. /**
  172. * Toggle fullscreen of the entire viewer
  173. */
  174. toggleFullscreen: () => void;
  175. /**
  176. * Preparing the container element to present the viewer
  177. */
  178. protected _prepareContainerElement(): void;
  179. /**
  180. * This function will configure the templates and update them after a model was loaded
  181. * It is mainly responsible to changing the title and subtitle etc'.
  182. * @param model the model to be used to configure the templates by
  183. */
  184. protected _configureTemplate(model?: ViewerModel): void;
  185. /**
  186. * This will load a new model to the default viewer
  187. * overriding the AbstractViewer's loadModel.
  188. * The scene will automatically be cleared of the old models, if exist.
  189. * @param model the configuration object (or URL) to load.
  190. */
  191. loadModel(model?: string | File | IModelConfiguration): Promise<ViewerModel>;
  192. /**
  193. * Show the overlay and the defined sub-screen.
  194. * Mainly used for help and errors
  195. * @param subScreen the name of the subScreen. Those can be defined in the configuration object
  196. */
  197. showOverlayScreen(subScreen: string): Promise<Template> | Promise<string>;
  198. /**
  199. * Hide the overlay screen.
  200. */
  201. hideOverlayScreen(): Promise<Template> | Promise<string>;
  202. /**
  203. * show the viewer (in case it was hidden)
  204. *
  205. * @param visibilityFunction an optional function to execute in order to show the container
  206. */
  207. show(visibilityFunction?: ((template: Template) => Promise<Template>)): Promise<Template>;
  208. /**
  209. * hide the viewer (in case it is visible)
  210. *
  211. * @param visibilityFunction an optional function to execute in order to hide the container
  212. */
  213. hide(visibilityFunction?: ((template: Template) => Promise<Template>)): Promise<Template>;
  214. /**
  215. * Show the loading screen.
  216. * The loading screen can be configured using the configuration object
  217. */
  218. showLoadingScreen(): Promise<Template> | Promise<string>;
  219. /**
  220. * Hide the loading screen
  221. */
  222. hideLoadingScreen(): Promise<Template> | Promise<string>;
  223. dispose(): void;
  224. protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
  225. }
  226. }
  227. declare module 'babylonjs-viewer/viewer/viewer' {
  228. }
  229. declare module 'babylonjs-viewer/managers/telemetryManager' {
  230. import { Engine, Observable } from "babylonjs";
  231. /**
  232. * The data structure of a telemetry event.
  233. */
  234. export interface TelemetryData {
  235. event: string;
  236. session: string;
  237. date: Date;
  238. now: number;
  239. viewerId?: string;
  240. detail: any;
  241. }
  242. /**
  243. * Receives Telemetry events and raises events to the API
  244. */
  245. export class TelemetryManager {
  246. onEventBroadcastedObservable: Observable<TelemetryData>;
  247. /**
  248. * Receives a telemetry event
  249. * @param event The name of the Telemetry event
  250. * @param details An additional value, or an object containing a list of property/value pairs
  251. */
  252. readonly broadcast: (event: string, viewerId?: string | undefined, details?: any) => void;
  253. /**
  254. * Log a Telemetry event for errors raised on the WebGL context.
  255. * @param engine The Babylon engine with the WebGL context.
  256. */
  257. flushWebGLErrors(engine: Engine, viewerId?: string): void;
  258. /**
  259. * Enable or disable telemetry events
  260. * @param enabled Boolan, true if events are enabled
  261. */
  262. enable: boolean;
  263. /**
  264. * Returns the current session ID or creates one if it doesn't exixt
  265. * @return The current session ID
  266. */
  267. readonly session: string;
  268. /**
  269. * Disposes the telemetry manager
  270. */
  271. dispose(): void;
  272. }
  273. export const telemetryManager: TelemetryManager;
  274. }
  275. declare module 'babylonjs-viewer/loader/modelLoader' {
  276. import { ConfigurationContainer } from 'babylonjs-viewer/configuration/configurationContainer';
  277. import { IModelConfiguration } from 'babylonjs-viewer/configuration/interfaces/modelConfiguration';
  278. import { ObservablesManager } from 'babylonjs-viewer/managers/observablesManager';
  279. import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
  280. import { ILoaderPlugin } from 'babylonjs-viewer/loader/plugins';
  281. /**
  282. * An instance of the class is in charge of loading the model correctly.
  283. * This class will continously be expended with tasks required from the specific loaders Babylon has.
  284. *
  285. * A Model loader is unique per (Abstract)Viewer. It is being generated by the viewer
  286. */
  287. export class ModelLoader {
  288. readonly baseUrl: string;
  289. /**
  290. * Create a new Model loader
  291. * @param _viewer the viewer using this model loader
  292. */
  293. constructor(_observablesManager: ObservablesManager, _configurationContainer?: ConfigurationContainer | undefined);
  294. /**
  295. * Adds a new plugin to the loader process.
  296. *
  297. * @param plugin the plugin name or the plugin itself
  298. */
  299. addPlugin(plugin: ILoaderPlugin | string): void;
  300. /**
  301. * Load a model using predefined configuration
  302. * @param modelConfiguration the modelConfiguration to use to load the model
  303. */
  304. load(modelConfiguration: IModelConfiguration): ViewerModel;
  305. cancelLoad(model: ViewerModel): void;
  306. /**
  307. * dispose the model loader.
  308. * If loaders are registered and are in the middle of loading, they will be disposed and the request(s) will be cancelled.
  309. */
  310. dispose(): void;
  311. }
  312. }
  313. declare module 'babylonjs-viewer/model/viewerModel' {
  314. import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, AnimationGroup, AbstractMesh, Observable, SceneLoaderProgressEvent, IParticleSystem, Skeleton, IDisposable, Nullable, Animation, Material } from "babylonjs";
  315. import { GLTF2 } from "babylonjs-loaders";
  316. import { IModelConfiguration } from "babylonjs-viewer/configuration/interfaces/modelConfiguration";
  317. import { IModelAnimation } from "babylonjs-viewer/model/modelAnimation";
  318. import { ObservablesManager } from "babylonjs-viewer/managers/observablesManager";
  319. import { ConfigurationContainer } from "babylonjs-viewer/configuration/configurationContainer";
  320. /**
  321. * The current state of the model
  322. */
  323. export enum ModelState {
  324. INIT = 0,
  325. LOADING = 1,
  326. LOADED = 2,
  327. ENTRY = 3,
  328. ENTRYDONE = 4,
  329. COMPLETE = 5,
  330. CANCELED = 6,
  331. ERROR = 7
  332. }
  333. /**
  334. * The viewer model is a container for all assets representing a sngle loaded model.
  335. */
  336. export class ViewerModel implements IDisposable {
  337. /**
  338. * The loader used to load this model.
  339. */
  340. loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync;
  341. /**
  342. * This model's root mesh (the parent of all other meshes).
  343. * This mesh does not(!) exist in the meshes array.
  344. */
  345. rootMesh: AbstractMesh;
  346. /**
  347. * ParticleSystems connected to this model
  348. */
  349. particleSystems: Array<IParticleSystem>;
  350. /**
  351. * Skeletons defined in this model
  352. */
  353. skeletons: Array<Skeleton>;
  354. /**
  355. * The current model animation.
  356. * On init, this will be undefined.
  357. */
  358. currentAnimation: IModelAnimation;
  359. /**
  360. * Observers registered here will be executed when the model is done loading
  361. */
  362. onLoadedObservable: Observable<ViewerModel>;
  363. /**
  364. * Observers registered here will be executed when the loader notified of a progress event
  365. */
  366. onLoadProgressObservable: Observable<SceneLoaderProgressEvent>;
  367. /**
  368. * Observers registered here will be executed when the loader notified of an error.
  369. */
  370. onLoadErrorObservable: Observable<{
  371. message: string;
  372. exception: any;
  373. }>;
  374. /**
  375. * Will be executed after the model finished loading and complete, including entry animation and lod
  376. */
  377. onCompleteObservable: Observable<ViewerModel>;
  378. /**
  379. * Observers registered here will be executed every time the model is being configured.
  380. * This can be used to extend the model's configuration without extending the class itself
  381. */
  382. onAfterConfigure: Observable<ViewerModel>;
  383. /**
  384. * The current model state (loaded, error, etc)
  385. */
  386. state: ModelState;
  387. /**
  388. * A loadID provided by the modelLoader, unique to ths (Abstract)Viewer instance.
  389. */
  390. loadId: number;
  391. loadInfo: GLTF2.IAsset;
  392. constructor(_observablesManager: ObservablesManager, modelConfiguration: IModelConfiguration, _configurationContainer?: ConfigurationContainer | undefined);
  393. shadowsRenderedAfterLoad: boolean;
  394. getViewerId(): string | undefined;
  395. /**
  396. * Set whether this model is enabled or not.
  397. */
  398. enabled: boolean;
  399. loaderDone: boolean;
  400. /**
  401. * Add a mesh to this model.
  402. * Any mesh that has no parent will be provided with the root mesh as its new parent.
  403. *
  404. * @param mesh the new mesh to add
  405. * @param triggerLoaded should this mesh trigger the onLoaded observable. Used when adding meshes manually.
  406. */
  407. addMesh(mesh: AbstractMesh, triggerLoaded?: boolean): Promise<ViewerModel> | undefined;
  408. /**
  409. * get the list of meshes (excluding the root mesh)
  410. */
  411. readonly meshes: AbstractMesh[];
  412. /**
  413. * (Re-)set the model's entire configuration
  414. * @param newConfiguration the new configuration to replace the new one
  415. */
  416. configuration: IModelConfiguration;
  417. /**
  418. * Update the current configuration with new values.
  419. * Configuration will not be overwritten, but merged with the new configuration.
  420. * Priority is to the new configuration
  421. * @param newConfiguration the configuration to be merged into the current configuration;
  422. */
  423. updateConfiguration(newConfiguration: Partial<IModelConfiguration>): void;
  424. /**
  425. * Add a new animation group to this model.
  426. * @param animationGroup the new animation group to be added
  427. */
  428. addAnimationGroup(animationGroup: AnimationGroup): void;
  429. /**
  430. * Get the ModelAnimation array
  431. */
  432. getAnimations(): Array<IModelAnimation>;
  433. /**
  434. * Get the animations' names. Using the names you can play a specific animation.
  435. */
  436. getAnimationNames(): Array<string>;
  437. /**
  438. * Get an animation by the provided name. Used mainly when playing n animation.
  439. * @param name the name of the animation to find
  440. */
  441. protected _getAnimationByName(name: string): Nullable<IModelAnimation>;
  442. /**
  443. * Choose an initialized animation using its name and start playing it
  444. * @param name the name of the animation to play
  445. * @returns The model aniamtion to be played.
  446. */
  447. playAnimation(name: string): IModelAnimation;
  448. setCurrentAnimationByName(name: string): IModelAnimation;
  449. /**
  450. * Apply a material configuration to a material
  451. * @param material Material to apply configuration to
  452. * @hidden
  453. */
  454. _applyModelMaterialConfiguration(material: Material): void;
  455. /**
  456. * Begin @animations with the specified @easingFunction
  457. * @param animations The BABYLON Animations to begin
  458. * @param duration of transition, in seconds
  459. * @param easingFunction An easing function to apply
  460. * @param easingMode A easing mode to apply to the easingFunction
  461. * @param onAnimationEnd Call back trigger at the end of the animation.
  462. */
  463. transitionTo(animations: Animation[], duration: number, easingFunction: any, easingMode: number | undefined, onAnimationEnd: () => void): void;
  464. /**
  465. * Stops and removes all animations that have been applied to the model
  466. */
  467. stopAllAnimations(): void;
  468. /**
  469. * Will remove this model from the viewer (but NOT dispose it).
  470. */
  471. remove(): void;
  472. /**
  473. * Dispose this model, including all of its associated assets.
  474. */
  475. dispose(): void;
  476. }
  477. }
  478. declare module 'babylonjs-viewer/model/modelAnimation' {
  479. import { AnimationGroup, Vector3 } from 'babylonjs';
  480. /**
  481. * Animation play mode enum - is the animation looping or playing once
  482. */
  483. export const enum AnimationPlayMode {
  484. ONCE = 0,
  485. LOOP = 1
  486. }
  487. /**
  488. * An enum representing the current state of an animation object
  489. */
  490. export const enum AnimationState {
  491. INIT = 0,
  492. PLAYING = 1,
  493. PAUSED = 2,
  494. STOPPED = 3,
  495. ENDED = 4
  496. }
  497. /**
  498. * The different type of easing functions available
  499. */
  500. export const enum EasingFunction {
  501. Linear = 0,
  502. CircleEase = 1,
  503. BackEase = 2,
  504. BounceEase = 3,
  505. CubicEase = 4,
  506. ElasticEase = 5,
  507. ExponentialEase = 6,
  508. PowerEase = 7,
  509. QuadraticEase = 8,
  510. QuarticEase = 9,
  511. QuinticEase = 10,
  512. SineEase = 11
  513. }
  514. /**
  515. * Defines a simple animation to be applied to a model (scale).
  516. */
  517. export interface ModelAnimationConfiguration {
  518. /**
  519. * Time of animation, in seconds
  520. */
  521. time: number;
  522. /**
  523. * Scale to apply
  524. */
  525. scaling?: Vector3;
  526. /**
  527. * Easing function to apply
  528. * See SPECTRE.EasingFunction
  529. */
  530. easingFunction?: number;
  531. /**
  532. * An Easing mode to apply to the easing function
  533. * See BABYLON.EasingFunction
  534. */
  535. easingMode?: number;
  536. }
  537. /**
  538. * This interface can be implemented to define new types of ModelAnimation objects.
  539. */
  540. export interface IModelAnimation {
  541. /**
  542. * Current animation state (playing, stopped etc')
  543. */
  544. readonly state: AnimationState;
  545. /**
  546. * the name of the animation
  547. */
  548. readonly name: string;
  549. /**
  550. * Get the max numbers of frame available in the animation group
  551. *
  552. * In correlation to an arry, this would be ".length"
  553. */
  554. readonly frames: number;
  555. /**
  556. * Get the current frame playing right now.
  557. * This can be used to poll the frame currently playing (and, for exmaple, display a progress bar with the data)
  558. *
  559. * In correlation to an array, this would be the current index
  560. */
  561. readonly currentFrame: number;
  562. /**
  563. * Animation's FPS value
  564. */
  565. readonly fps: number;
  566. /**
  567. * Get or set the animation's speed ration (Frame-to-fps)
  568. */
  569. speedRatio: number;
  570. /**
  571. * Gets or sets the aimation's play mode.
  572. */
  573. playMode: AnimationPlayMode;
  574. /**
  575. * Start the animation
  576. */
  577. start(): any;
  578. /**
  579. * Stop the animation.
  580. * This will fail silently if the animation group is already stopped.
  581. */
  582. stop(): any;
  583. /**
  584. * Pause the animation
  585. * This will fail silently if the animation is not currently playing
  586. */
  587. pause(): any;
  588. /**
  589. * Reset this animation
  590. */
  591. reset(): any;
  592. /**
  593. * Restart the animation
  594. */
  595. restart(): any;
  596. /**
  597. * Go to a specific
  598. * @param frameNumber the frame number to go to
  599. */
  600. goToFrame(frameNumber: number): any;
  601. /**
  602. * Dispose this animation
  603. */
  604. dispose(): any;
  605. }
  606. /**
  607. * The GroupModelAnimation is an implementation of the IModelAnimation interface using BABYLON's
  608. * native GroupAnimation class.
  609. */
  610. export class GroupModelAnimation implements IModelAnimation {
  611. /**
  612. * Create a new GroupModelAnimation object using an AnimationGroup object
  613. * @param _animationGroup The aniamtion group to base the class on
  614. */
  615. constructor(_animationGroup: AnimationGroup);
  616. /**
  617. * Get the animation's name
  618. */
  619. readonly name: string;
  620. /**
  621. * Get the current animation's state
  622. */
  623. readonly state: AnimationState;
  624. /**
  625. * Sets the speed ratio to use for all animations
  626. */
  627. speedRatio: number;
  628. /**
  629. * Get the max numbers of frame available in the animation group
  630. *
  631. * In correlation to an arry, this would be ".length"
  632. */
  633. readonly frames: number;
  634. /**
  635. * Get the current frame playing right now.
  636. * This can be used to poll the frame currently playing (and, for exmaple, display a progress bar with the data)
  637. *
  638. * In correlation to an array, this would be the current index
  639. */
  640. readonly currentFrame: number;
  641. /**
  642. * Get the FPS value of this animation
  643. */
  644. readonly fps: number;
  645. /**
  646. * Set the play mode.
  647. * If the animation is played, it will continue playing at least once more, depending on the new play mode set.
  648. * If the animation is not set, the will be initialized and will wait for the user to start playing it.
  649. */
  650. playMode: AnimationPlayMode;
  651. /**
  652. * Reset the animation group
  653. */
  654. reset(): void;
  655. /**
  656. * Restart the animation group
  657. */
  658. restart(): void;
  659. /**
  660. *
  661. * @param frameNumber Go to a specific frame in the animation
  662. */
  663. goToFrame(frameNumber: number): void;
  664. /**
  665. * Start playing the animation.
  666. */
  667. start(): void;
  668. /**
  669. * Pause the animation
  670. */
  671. pause(): void;
  672. /**
  673. * Stop the animation.
  674. * This will fail silently if the animation group is already stopped.
  675. */
  676. stop(): void;
  677. /**
  678. * Dispose this animation object.
  679. */
  680. dispose(): void;
  681. }
  682. }
  683. declare module 'babylonjs-viewer/loader/plugins/loaderPlugin' {
  684. import { ViewerModel } from "babylonjs-viewer/model/viewerModel";
  685. import { IGLTFLoaderExtension, IGLTFLoaderData } from "babylonjs-loaders";
  686. import { AbstractMesh, ISceneLoaderPlugin, ISceneLoaderPluginAsync, SceneLoaderProgressEvent, BaseTexture, Material } from "babylonjs";
  687. /**
  688. * This interface defines the structure of a loader plugin.
  689. * Any of those functions will be called if (!) the loader supports those callbacks.
  690. * Any loader supports onInit, onLoaded, onError and onProgress.
  691. */
  692. export interface ILoaderPlugin {
  693. onInit?: (loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync, model: ViewerModel) => void;
  694. onLoaded?: (model: ViewerModel) => void;
  695. onError?: (message: string, exception?: any) => void;
  696. onProgress?: (progressEvent: SceneLoaderProgressEvent) => void;
  697. onExtensionLoaded?: (extension: IGLTFLoaderExtension) => void;
  698. onParsed?: (parsedData: IGLTFLoaderData) => void;
  699. onMeshLoaded?: (mesh: AbstractMesh) => void;
  700. onTextureLoaded?: (texture: BaseTexture) => void;
  701. onMaterialLoaded?: (material: Material) => void;
  702. onComplete?: () => void;
  703. }
  704. }
  705. declare module 'babylonjs-viewer/templating/viewerTemplatePlugin' {
  706. import { EventCallback, Template } from "babylonjs-viewer/templating/templateManager";
  707. export interface IViewerTemplatePlugin {
  708. readonly templateName: string;
  709. readonly eventsToAttach?: Array<string>;
  710. interactionPredicate(event: EventCallback): boolean;
  711. onEvent?(event: EventCallback): void;
  712. addHTMLTemplate?(template: Template): void;
  713. }
  714. export abstract class AbstractViewerNavbarButton implements IViewerTemplatePlugin {
  715. readonly templateName: string;
  716. readonly eventsToAttach: Array<string>;
  717. protected _prepend: boolean;
  718. protected _buttonName: string;
  719. protected _buttonClass: string;
  720. protected _htmlTemplate: string;
  721. constructor(buttonName: string, buttonClass?: string, htmlTemplate?: string);
  722. interactionPredicate(event: EventCallback): boolean;
  723. abstract onEvent(event: EventCallback): void;
  724. addHTMLTemplate(template: Template): void;
  725. protected _generateHTMLElement(template: Template): Element | DocumentFragment;
  726. }
  727. }
  728. declare module 'babylonjs-viewer/optimizer/custom' {
  729. import { extendedUpgrade } from "babylonjs-viewer/optimizer/custom/extended";
  730. import { SceneManager } from "babylonjs-viewer/managers/sceneManager";
  731. /**
  732. *
  733. * @param name the name of the custom optimizer configuration
  734. * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
  735. */
  736. export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
  737. export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
  738. }
  739. declare module 'babylonjs-viewer/initializer' {
  740. /**
  741. * Will attach an init function the the DOMContentLoaded event.
  742. * The init function will be removed automatically after the event was triggered.
  743. */
  744. export function initListeners(): void;
  745. /**
  746. * Select all HTML tags on the page that match the selector and initialize a viewer
  747. *
  748. * @param selector the selector to initialize the viewer on (default is 'babylon')
  749. */
  750. export function InitTags(selector?: string): void;
  751. }
  752. declare module 'babylonjs-viewer/configuration' {
  753. export * from 'babylonjs-viewer/configuration/configuration';
  754. export * from 'babylonjs-viewer/configuration/interfaces';
  755. }
  756. declare module 'babylonjs-viewer/configuration/configuration' {
  757. import { EngineOptions } from 'babylonjs';
  758. import { ICameraConfiguration, IDefaultRenderingPipelineConfiguration, IGroundConfiguration, ILightConfiguration, IModelConfiguration, IObserversConfiguration, ISceneConfiguration, ISceneOptimizerConfiguration, ISkyboxConfiguration, ITemplateConfiguration, IVRConfiguration } from 'babylonjs-viewer/configuration/interfaces';
  759. import { IEnvironmentMapConfiguration } from 'babylonjs-viewer/configuration/interfaces/environmentMapConfiguration';
  760. export function getConfigurationKey(key: string, configObject: any): any;
  761. export interface ViewerConfiguration {
  762. version?: string;
  763. extends?: string;
  764. pageUrl?: string;
  765. configuration?: string | {
  766. url?: string;
  767. payload?: any;
  768. mapper?: string;
  769. };
  770. observers?: IObserversConfiguration;
  771. canvasElement?: string;
  772. model?: IModelConfiguration | string;
  773. scene?: ISceneConfiguration;
  774. optimizer?: ISceneOptimizerConfiguration | boolean;
  775. camera?: ICameraConfiguration;
  776. skybox?: boolean | ISkyboxConfiguration;
  777. ground?: boolean | IGroundConfiguration;
  778. lights?: {
  779. [name: string]: number | boolean | ILightConfiguration;
  780. };
  781. engine?: {
  782. renderInBackground?: boolean;
  783. antialiasing?: boolean;
  784. disableResize?: boolean;
  785. engineOptions?: EngineOptions;
  786. adaptiveQuality?: boolean;
  787. hdEnabled?: boolean;
  788. };
  789. templates?: {
  790. main: ITemplateConfiguration;
  791. [key: string]: ITemplateConfiguration;
  792. };
  793. customShaders?: {
  794. shaders?: {
  795. [key: string]: string;
  796. };
  797. includes?: {
  798. [key: string]: string;
  799. };
  800. };
  801. loaderPlugins?: {
  802. extendedMaterial?: boolean;
  803. msftLod?: boolean;
  804. telemetry?: boolean;
  805. minecraft?: boolean;
  806. [propName: string]: boolean | undefined;
  807. };
  808. environmentMap?: IEnvironmentMapConfiguration;
  809. vr?: IVRConfiguration;
  810. lab?: {
  811. flashlight?: boolean | {
  812. exponent?: number;
  813. angle?: number;
  814. intensity?: number;
  815. diffuse?: {
  816. r: number;
  817. g: number;
  818. b: number;
  819. };
  820. specular?: {
  821. r: number;
  822. g: number;
  823. b: number;
  824. };
  825. };
  826. hideLoadingDelay?: number;
  827. /** Deprecated */
  828. assetsRootURL?: string;
  829. environmentMainColor?: {
  830. r: number;
  831. g: number;
  832. b: number;
  833. };
  834. /** Deprecated */
  835. environmentMap?: {
  836. /**
  837. * Environment map texture path in relative to the asset folder.
  838. */
  839. texture: string;
  840. /**
  841. * Default rotation to apply to the environment map.
  842. */
  843. rotationY: number;
  844. /**
  845. * Tint level of the main color on the environment map.
  846. */
  847. tintLevel: number;
  848. };
  849. defaultRenderingPipelines?: boolean | IDefaultRenderingPipelineConfiguration;
  850. globalLightRotation?: number;
  851. };
  852. }
  853. }
  854. declare module 'babylonjs-viewer/templating/templateManager' {
  855. import { Observable } from 'babylonjs';
  856. import { EventManager } from 'babylonjs-viewer/templating/eventManager';
  857. import { ITemplateConfiguration } from 'babylonjs-viewer/configuration/interfaces';
  858. /**
  859. * The object sent when an event is triggered
  860. */
  861. export interface EventCallback {
  862. event: Event;
  863. template: Template;
  864. selector: string;
  865. payload?: any;
  866. }
  867. /**
  868. * The template manager, a member of the viewer class, will manage the viewer's templates and generate the HTML.
  869. * The template manager managers a single viewer and can be seen as the collection of all sub-templates of the viewer.
  870. */
  871. export class TemplateManager {
  872. containerElement: HTMLElement;
  873. /**
  874. * Will be triggered when any template is initialized
  875. */
  876. onTemplateInit: Observable<Template>;
  877. /**
  878. * Will be triggered when any template is fully loaded
  879. */
  880. onTemplateLoaded: Observable<Template>;
  881. /**
  882. * Will be triggered when a template state changes
  883. */
  884. onTemplateStateChange: Observable<Template>;
  885. /**
  886. * Will be triggered when all templates finished loading
  887. */
  888. onAllLoaded: Observable<TemplateManager>;
  889. /**
  890. * Will be triggered when any event on any template is triggered.
  891. */
  892. onEventTriggered: Observable<EventCallback>;
  893. /**
  894. * This template manager's event manager. In charge of callback registrations to native event types
  895. */
  896. eventManager: EventManager;
  897. constructor(containerElement: HTMLElement);
  898. /**
  899. * Initialize the template(s) for the viewer. Called bay the Viewer class
  900. * @param templates the templates to be used to initialize the main template
  901. */
  902. initTemplate(templates: {
  903. [key: string]: ITemplateConfiguration;
  904. }): Promise<void>;
  905. /**
  906. * Get the canvas in the template tree.
  907. * There must be one and only one canvas inthe template.
  908. */
  909. getCanvas(): HTMLCanvasElement | null;
  910. /**
  911. * Get a specific template from the template tree
  912. * @param name the name of the template to load
  913. */
  914. getTemplate(name: string): Template | undefined;
  915. /**
  916. * Dispose the template manager
  917. */
  918. dispose(): void;
  919. }
  920. /**
  921. * This class represents a single template in the viewer's template tree.
  922. * An example for a template is a single canvas, an overlay (containing sub-templates) or the navigation bar.
  923. * A template is injected using the template manager in the correct position.
  924. * The template is rendered using Handlebars and can use Handlebars' features (such as parameter injection)
  925. *
  926. * For further information please refer to the documentation page, https://doc.babylonjs.com
  927. */
  928. export class Template {
  929. name: string;
  930. /**
  931. * Will be triggered when the template is loaded
  932. */
  933. onLoaded: Observable<Template>;
  934. /**
  935. * will be triggered when the template is appended to the tree
  936. */
  937. onAppended: Observable<Template>;
  938. /**
  939. * Will be triggered when the template's state changed (shown, hidden)
  940. */
  941. onStateChange: Observable<Template>;
  942. /**
  943. * Will be triggered when an event is triggered on ths template.
  944. * The event is a native browser event (like mouse or pointer events)
  945. */
  946. onEventTriggered: Observable<EventCallback>;
  947. onParamsUpdated: Observable<Template>;
  948. onHTMLRendered: Observable<Template>;
  949. /**
  950. * is the template loaded?
  951. */
  952. isLoaded: boolean;
  953. /**
  954. * This is meant to be used to track the show and hide functions.
  955. * This is NOT (!!) a flag to check if the element is actually visible to the user.
  956. */
  957. isShown: boolean;
  958. /**
  959. * Is this template a part of the HTML tree (the template manager injected it)
  960. */
  961. isInHtmlTree: boolean;
  962. /**
  963. * The HTML element containing this template
  964. */
  965. parent: HTMLElement;
  966. /**
  967. * A promise that is fulfilled when the template finished loading.
  968. */
  969. initPromise: Promise<Template>;
  970. constructor(name: string, _configuration: ITemplateConfiguration);
  971. /**
  972. * Some templates have parameters (like background color for example).
  973. * The parameters are provided to Handlebars which in turn generates the template.
  974. * This function will update the template with the new parameters
  975. *
  976. * Note that when updating parameters the events will be registered again (after being cleared).
  977. *
  978. * @param params the new template parameters
  979. */
  980. updateParams(params: {
  981. [key: string]: string | number | boolean | object;
  982. }, append?: boolean): void;
  983. redraw(): void;
  984. /**
  985. * Get the template'S configuration
  986. */
  987. readonly configuration: ITemplateConfiguration;
  988. /**
  989. * A template can be a parent element for other templates or HTML elements.
  990. * This function will deliver all child HTML elements of this template.
  991. */
  992. getChildElements(): Array<string>;
  993. /**
  994. * Appending the template to a parent HTML element.
  995. * If a parent is already set and you wish to replace the old HTML with new one, forceRemove should be true.
  996. * @param parent the parent to which the template is added
  997. * @param forceRemove if the parent already exists, shoud the template be removed from it?
  998. */
  999. appendTo(parent: HTMLElement, forceRemove?: boolean): void;
  1000. /**
  1001. * Show the template using the provided visibilityFunction, or natively using display: flex.
  1002. * The provided function returns a promise that should be fullfilled when the element is shown.
  1003. * Since it is a promise async operations are more than possible.
  1004. * See the default viewer for an opacity example.
  1005. * @param visibilityFunction The function to execute to show the template.
  1006. */
  1007. show(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
  1008. /**
  1009. * Hide the template using the provided visibilityFunction, or natively using display: none.
  1010. * The provided function returns a promise that should be fullfilled when the element is hidden.
  1011. * Since it is a promise async operations are more than possible.
  1012. * See the default viewer for an opacity example.
  1013. * @param visibilityFunction The function to execute to show the template.
  1014. */
  1015. hide(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
  1016. /**
  1017. * Dispose this template
  1018. */
  1019. dispose(): void;
  1020. }
  1021. }
  1022. declare module 'babylonjs-viewer/configuration/configurationContainer' {
  1023. import { ViewerConfiguration } from 'babylonjs-viewer/configuration/configuration';
  1024. import { Color3, Scene } from 'babylonjs';
  1025. export class ConfigurationContainer {
  1026. configuration: ViewerConfiguration;
  1027. viewerId: string;
  1028. mainColor: Color3;
  1029. reflectionColor: Color3;
  1030. scene?: Scene;
  1031. }
  1032. }
  1033. declare module 'babylonjs-viewer/configuration/interfaces/modelConfiguration' {
  1034. import { IModelAnimationConfiguration } from "babylonjs-viewer/configuration/interfaces/modelAnimationConfiguration";
  1035. export interface IModelConfiguration {
  1036. id?: string;
  1037. url?: string;
  1038. root?: string;
  1039. file?: string | File;
  1040. loader?: string;
  1041. position?: {
  1042. x: number;
  1043. y: number;
  1044. z: number;
  1045. };
  1046. rotation?: {
  1047. x: number;
  1048. y: number;
  1049. z: number;
  1050. w?: number;
  1051. };
  1052. scaling?: {
  1053. x: number;
  1054. y: number;
  1055. z: number;
  1056. };
  1057. parentObjectIndex?: number;
  1058. castShadow?: boolean;
  1059. receiveShadows?: boolean;
  1060. normalize?: boolean | {
  1061. center?: boolean;
  1062. unitSize?: boolean;
  1063. parentIndex?: number;
  1064. };
  1065. title?: string;
  1066. subtitle?: string;
  1067. thumbnail?: string;
  1068. animation?: {
  1069. autoStart?: boolean | string;
  1070. playOnce?: boolean;
  1071. autoStartIndex?: number;
  1072. };
  1073. entryAnimation?: IModelAnimationConfiguration;
  1074. exitAnimation?: IModelAnimationConfiguration;
  1075. material?: {
  1076. directEnabled?: boolean;
  1077. directIntensity?: number;
  1078. emissiveIntensity?: number;
  1079. environmentIntensity?: number;
  1080. [propName: string]: any;
  1081. };
  1082. /**
  1083. * Rotation offset axis definition
  1084. */
  1085. rotationOffsetAxis?: {
  1086. x: number;
  1087. y: number;
  1088. z: number;
  1089. };
  1090. /**
  1091. * the offset angle
  1092. */
  1093. rotationOffsetAngle?: number;
  1094. loaderConfiguration?: {
  1095. maxLODsToLoad?: number;
  1096. progressiveLoading?: boolean;
  1097. };
  1098. }
  1099. }
  1100. declare module 'babylonjs-viewer/managers/observablesManager' {
  1101. import { Engine, ISceneLoaderPlugin, ISceneLoaderPluginAsync, Observable, Scene, SceneLoaderProgressEvent } from 'babylonjs';
  1102. import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
  1103. export class ObservablesManager {
  1104. /**
  1105. * Will notify when the scene was initialized
  1106. */
  1107. onSceneInitObservable: Observable<Scene>;
  1108. /**
  1109. * will notify when the engine was initialized
  1110. */
  1111. onEngineInitObservable: Observable<Engine>;
  1112. /**
  1113. * Will notify when a new model was added to the scene.
  1114. * Note that added does not neccessarily mean loaded!
  1115. */
  1116. onModelAddedObservable: Observable<ViewerModel>;
  1117. /**
  1118. * will notify after every model load
  1119. */
  1120. onModelLoadedObservable: Observable<ViewerModel>;
  1121. /**
  1122. * will notify when any model notify of progress
  1123. */
  1124. onModelLoadProgressObservable: Observable<SceneLoaderProgressEvent>;
  1125. /**
  1126. * will notify when any model load failed.
  1127. */
  1128. onModelLoadErrorObservable: Observable<{
  1129. message: string;
  1130. exception: any;
  1131. }>;
  1132. /**
  1133. * Will notify when a model was removed from the scene;
  1134. */
  1135. onModelRemovedObservable: Observable<ViewerModel>;
  1136. /**
  1137. * will notify when a new loader was initialized.
  1138. * Used mainly to know when a model starts loading.
  1139. */
  1140. onLoaderInitObservable: Observable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;
  1141. /**
  1142. * Observers registered here will be executed when the entire load process has finished.
  1143. */
  1144. onViewerInitDoneObservable: Observable<any>;
  1145. /**
  1146. * Will notify when the viewer init started (after configuration was loaded)
  1147. */
  1148. onViewerInitStartedObservable: Observable<any>;
  1149. /**
  1150. * Functions added to this observable will be executed on each frame rendered.
  1151. */
  1152. onFrameRenderedObservable: Observable<any>;
  1153. /**
  1154. * Will notify when VR mode is entered.
  1155. */
  1156. onEnteringVRObservable: Observable<any>;
  1157. /**
  1158. * Will notify when VR mode is exited.
  1159. */
  1160. onExitingVRObservable: Observable<any>;
  1161. constructor();
  1162. dispose(): void;
  1163. }
  1164. }
  1165. declare module 'babylonjs-viewer/loader/plugins' {
  1166. import { TelemetryLoaderPlugin } from "babylonjs-viewer/loader/plugins/telemetryLoaderPlugin";
  1167. import { ILoaderPlugin } from "babylonjs-viewer/loader/plugins/loaderPlugin";
  1168. import { MSFTLodLoaderPlugin } from 'babylonjs-viewer/loader/plugins/msftLodLoaderPlugin';
  1169. import { ApplyMaterialConfigPlugin } from 'babylonjs-viewer/loader/plugins/applyMaterialConfig';
  1170. import { ExtendedMaterialLoaderPlugin } from 'babylonjs-viewer/loader/plugins/extendedMaterialLoaderPlugin';
  1171. export { TelemetryLoaderPlugin, ILoaderPlugin, MSFTLodLoaderPlugin, ApplyMaterialConfigPlugin, ExtendedMaterialLoaderPlugin };
  1172. /**
  1173. * Get a loader plugin according to its name.
  1174. * The plugin will be cached and will be reused if called for again.
  1175. *
  1176. * @param name the name of the plugin
  1177. */
  1178. export function getLoaderPluginByName(name: string): ILoaderPlugin;
  1179. /**
  1180. *
  1181. */
  1182. export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
  1183. }
  1184. declare module 'babylonjs-viewer/optimizer/custom/extended' {
  1185. import { SceneManager } from 'babylonjs-viewer/managers/sceneManager';
  1186. /**
  1187. * A custom upgrade-oriented function configuration for the scene optimizer.
  1188. *
  1189. * @param viewer the viewer to optimize
  1190. */
  1191. export function extendedUpgrade(sceneManager: SceneManager): boolean;
  1192. /**
  1193. * A custom degrade-oriented function configuration for the scene optimizer.
  1194. *
  1195. * @param viewer the viewer to optimize
  1196. */
  1197. export function extendedDegrade(sceneManager: SceneManager): boolean;
  1198. }
  1199. declare module 'babylonjs-viewer/managers/sceneManager' {
  1200. import { Scene, ArcRotateCamera, Engine, Light, SceneOptimizer, EnvironmentHelper, Color3, Observable, DefaultRenderingPipeline, Nullable, VRExperienceHelper } from 'babylonjs';
  1201. import { ILightConfiguration, ISceneConfiguration, ISceneOptimizerConfiguration, ICameraConfiguration, ISkyboxConfiguration, ViewerConfiguration, IGroundConfiguration, IModelConfiguration, IVRConfiguration } from 'babylonjs-viewer/configuration';
  1202. import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
  1203. import { ViewerLabs } from 'babylonjs-viewer/labs/viewerLabs';
  1204. import { ObservablesManager } from 'babylonjs-viewer/managers/observablesManager';
  1205. import { ConfigurationContainer } from 'babylonjs-viewer/configuration/configurationContainer';
  1206. import { IEnvironmentMapConfiguration } from 'babylonjs-viewer/configuration/interfaces/environmentMapConfiguration';
  1207. /**
  1208. * This interface describes the structure of the variable sent with the configuration observables of the scene manager.
  1209. * O - the type of object we are dealing with (Light, ArcRotateCamera, Scene, etc')
  1210. * T - the configuration type
  1211. */
  1212. export interface IPostConfigurationCallback<OBJ, CONF> {
  1213. newConfiguration: CONF;
  1214. sceneManager: SceneManager;
  1215. object: OBJ;
  1216. model?: ViewerModel;
  1217. }
  1218. export class SceneManager {
  1219. /**
  1220. * Will notify when the scene was initialized
  1221. */
  1222. onSceneInitObservable: Observable<Scene>;
  1223. /**
  1224. * Will notify after the scene was configured. Can be used to further configure the scene
  1225. */
  1226. onSceneConfiguredObservable: Observable<IPostConfigurationCallback<Scene, ISceneConfiguration>>;
  1227. /**
  1228. * Will notify after the scene optimized was configured. Can be used to further configure the scene optimizer
  1229. */
  1230. onSceneOptimizerConfiguredObservable: Observable<IPostConfigurationCallback<SceneOptimizer, ISceneOptimizerConfiguration | boolean>>;
  1231. /**
  1232. * Will notify after the camera was configured. Can be used to further configure the camera
  1233. */
  1234. onCameraConfiguredObservable: Observable<IPostConfigurationCallback<ArcRotateCamera, ICameraConfiguration>>;
  1235. /**
  1236. * Will notify after the lights were configured. Can be used to further configure lights
  1237. */
  1238. onLightsConfiguredObservable: Observable<IPostConfigurationCallback<Array<Light>, {
  1239. [name: string]: ILightConfiguration | boolean | number;
  1240. }>>;
  1241. /**
  1242. * Will notify after the model(s) were configured. Can be used to further configure models
  1243. */
  1244. onModelsConfiguredObservable: Observable<IPostConfigurationCallback<Array<ViewerModel>, IModelConfiguration>>;
  1245. /**
  1246. * Will notify after the envirnoment was configured. Can be used to further configure the environment
  1247. */
  1248. onEnvironmentConfiguredObservable: Observable<IPostConfigurationCallback<EnvironmentHelper, {
  1249. skybox?: ISkyboxConfiguration | boolean;
  1250. ground?: IGroundConfiguration | boolean;
  1251. }>>;
  1252. /**
  1253. * Will notify after the model(s) were configured. Can be used to further configure models
  1254. */
  1255. onVRConfiguredObservable: Observable<IPostConfigurationCallback<VRExperienceHelper, IVRConfiguration>>;
  1256. /**
  1257. * The Babylon Scene of this viewer
  1258. */
  1259. scene: Scene;
  1260. /**
  1261. * The camera used in this viewer
  1262. */
  1263. camera: ArcRotateCamera;
  1264. /**
  1265. * Babylon's scene optimizer
  1266. */
  1267. sceneOptimizer: SceneOptimizer;
  1268. /**
  1269. * Models displayed in this viewer.
  1270. */
  1271. models: Array<ViewerModel>;
  1272. /**
  1273. * Babylon's environment helper of this viewer
  1274. */
  1275. environmentHelper?: EnvironmentHelper;
  1276. protected _defaultHighpTextureType: number;
  1277. protected _shadowGeneratorBias: number;
  1278. protected _defaultPipelineTextureType: number;
  1279. /**
  1280. * The maximum number of shadows supported by the curent viewer
  1281. */
  1282. protected _maxShadows: number;
  1283. /**
  1284. * The labs variable consists of objects that will have their API change.
  1285. * Please be careful when using labs in production.
  1286. */
  1287. labs: ViewerLabs;
  1288. readonly defaultRenderingPipeline: Nullable<DefaultRenderingPipeline>;
  1289. protected _vrHelper?: VRExperienceHelper;
  1290. readonly vrHelper: VRExperienceHelper | undefined;
  1291. constructor(_engine: Engine, _configurationContainer: ConfigurationContainer, _observablesManager?: ObservablesManager | undefined);
  1292. /**
  1293. * Returns a boolean representing HDR support
  1294. */
  1295. readonly isHdrSupported: boolean;
  1296. /**
  1297. * Return the main color defined in the configuration.
  1298. */
  1299. readonly mainColor: Color3;
  1300. readonly reflectionColor: Color3;
  1301. animationBlendingEnabled: boolean;
  1302. readonly observablesManager: ObservablesManager | undefined;
  1303. /**
  1304. * Should shadows be rendered every frame, or only once and stop.
  1305. * This can be used to optimize a scene.
  1306. *
  1307. * Not that the shadows will NOT disapear but will remain in place.
  1308. * @param process if true shadows will be updated once every frame. if false they will stop being updated.
  1309. */
  1310. processShadows: boolean;
  1311. groundEnabled: boolean;
  1312. /**
  1313. * sets wether the reflection is disabled.
  1314. */
  1315. groundMirrorEnabled: boolean;
  1316. defaultRenderingPipelineEnabled: boolean;
  1317. /**
  1318. * Sets the engine flags to unlock all babylon features.
  1319. * Can also be configured using the scene.flags configuration object
  1320. */
  1321. unlockBabylonFeatures(): void;
  1322. /**
  1323. * initialize the scene. Calling this function again will dispose the old scene, if exists.
  1324. */
  1325. initScene(sceneConfiguration?: ISceneConfiguration, optimizerConfiguration?: boolean | ISceneOptimizerConfiguration): Promise<Scene>;
  1326. clearScene(clearModels?: boolean, clearLights?: boolean): void;
  1327. /**
  1328. * This will update the scene's configuration, including camera, lights, environment.
  1329. * @param newConfiguration the delta that should be configured. This includes only the changes
  1330. * @param globalConfiguration The global configuration object, after the new configuration was merged into it
  1331. */
  1332. updateConfiguration(newConfiguration: Partial<ViewerConfiguration>): void;
  1333. bloomEnabled: boolean;
  1334. fxaaEnabled: boolean;
  1335. /**
  1336. * internally configure the scene using the provided configuration.
  1337. * The scene will not be recreated, but just updated.
  1338. * @param sceneConfig the (new) scene configuration
  1339. */
  1340. protected _configureScene(sceneConfig: ISceneConfiguration): void;
  1341. /**
  1342. * Configure the scene optimizer.
  1343. * The existing scene optimizer will be disposed and a new one will be created.
  1344. * @param optimizerConfig the (new) optimizer configuration
  1345. */
  1346. protected _configureOptimizer(optimizerConfig: ISceneOptimizerConfiguration | boolean): void;
  1347. /**
  1348. * configure all models using the configuration.
  1349. * @param modelConfiguration the configuration to use to reconfigure the models
  1350. */
  1351. protected _configureVR(vrConfig: IVRConfiguration): void;
  1352. protected _configureEnvironmentMap(environmentMapConfiguration: IEnvironmentMapConfiguration): any;
  1353. /**
  1354. * (Re) configure the camera. The camera will only be created once and from this point will only be reconfigured.
  1355. * @param cameraConfig the new camera configuration
  1356. * @param model optionally use the model to configure the camera.
  1357. */
  1358. protected _configureCamera(cameraConfig?: ICameraConfiguration): void;
  1359. protected _configureEnvironment(skyboxConifguration?: ISkyboxConfiguration | boolean, groundConfiguration?: IGroundConfiguration | boolean): void;
  1360. /**
  1361. * configure the lights.
  1362. *
  1363. * @param lightsConfiguration the (new) light(s) configuration
  1364. * @param model optionally use the model to configure the camera.
  1365. */
  1366. protected _configureLights(lightsConfiguration?: {
  1367. [name: string]: ILightConfiguration | boolean | number;
  1368. }): void;
  1369. /**
  1370. * Gets the shadow map blur kernel according to the light configuration.
  1371. * @param light The light used to generate the shadows
  1372. * @param bufferSize The size of the shadow map
  1373. * @return the kernel blur size
  1374. */
  1375. getBlurKernel(light: BABYLON.IShadowLight, bufferSize: number): number;
  1376. /**
  1377. * Alters render settings to reduce features based on hardware feature limitations
  1378. * @param enableHDR Allows the viewer to run in HDR mode.
  1379. */
  1380. protected _handleHardwareLimitations(enableHDR?: boolean): void;
  1381. /**
  1382. * Dispoe the entire viewer including the scene and the engine
  1383. */
  1384. dispose(): void;
  1385. }
  1386. }
  1387. declare module 'babylonjs-viewer/configuration/interfaces' {
  1388. export * from 'babylonjs-viewer/configuration/interfaces/cameraConfiguration';
  1389. export * from 'babylonjs-viewer/configuration/interfaces/colorGradingConfiguration';
  1390. export * from 'babylonjs-viewer/configuration/interfaces/defaultRenderingPipelineConfiguration';
  1391. export * from 'babylonjs-viewer/configuration/interfaces/groundConfiguration';
  1392. export * from 'babylonjs-viewer/configuration/interfaces/imageProcessingConfiguration';
  1393. export * from 'babylonjs-viewer/configuration/interfaces/lightConfiguration';
  1394. export * from 'babylonjs-viewer/configuration/interfaces/modelAnimationConfiguration';
  1395. export * from 'babylonjs-viewer/configuration/interfaces/modelConfiguration';
  1396. export * from 'babylonjs-viewer/configuration/interfaces/observersConfiguration';
  1397. export * from 'babylonjs-viewer/configuration/interfaces/sceneConfiguration';
  1398. export * from 'babylonjs-viewer/configuration/interfaces/sceneOptimizerConfiguration';
  1399. export * from 'babylonjs-viewer/configuration/interfaces/skyboxConfiguration';
  1400. export * from 'babylonjs-viewer/configuration/interfaces/templateConfiguration';
  1401. export * from 'babylonjs-viewer/configuration/interfaces/vrConfiguration';
  1402. export * from 'babylonjs-viewer/configuration/interfaces/environmentMapConfiguration';
  1403. }
  1404. declare module 'babylonjs-viewer/configuration/interfaces/environmentMapConfiguration' {
  1405. export interface IEnvironmentMapConfiguration {
  1406. /**
  1407. * Environment map texture path in relative to the asset folder.
  1408. */
  1409. texture: string;
  1410. /**
  1411. * Default rotation to apply to the environment map.
  1412. */
  1413. rotationY: number;
  1414. /**
  1415. * Tint level of the main color on the environment map.
  1416. */
  1417. tintLevel: number;
  1418. /**
  1419. * The environment's main color.
  1420. */
  1421. mainColor?: {
  1422. r?: number;
  1423. g?: number;
  1424. b?: number;
  1425. };
  1426. }
  1427. }
  1428. declare module 'babylonjs-viewer/templating/eventManager' {
  1429. import { EventCallback, TemplateManager } from "babylonjs-viewer/templating/templateManager";
  1430. /**
  1431. * The EventManager is in charge of registering user interctions with the viewer.
  1432. * It is used in the TemplateManager
  1433. */
  1434. export class EventManager {
  1435. constructor(_templateManager: TemplateManager);
  1436. /**
  1437. * Register a new callback to a specific template.
  1438. * The best example for the usage can be found in the DefaultViewer
  1439. *
  1440. * @param templateName the templateName to register the event to
  1441. * @param callback The callback to be executed
  1442. * @param eventType the type of event to register
  1443. * @param selector an optional selector. if not defined the parent object in the template will be selected
  1444. */
  1445. registerCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
  1446. /**
  1447. * This will remove a registered event from the defined template.
  1448. * Each one of the variables apart from the template name are optional, but one must be provided.
  1449. *
  1450. * @param templateName the templateName
  1451. * @param callback the callback to remove (optional)
  1452. * @param eventType the event type to remove (optional)
  1453. * @param selector the selector from which to remove the event (optional)
  1454. */
  1455. unregisterCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
  1456. /**
  1457. * Dispose the event manager
  1458. */
  1459. dispose(): void;
  1460. }
  1461. }
  1462. declare module 'babylonjs-viewer/configuration/interfaces/modelAnimationConfiguration' {
  1463. /**
  1464. * Defines an animation to be applied to a model (translation, scale or rotation).
  1465. */
  1466. export interface IModelAnimationConfiguration {
  1467. /**
  1468. * Time of animation, in seconds
  1469. */
  1470. time?: number;
  1471. /**
  1472. * Scale to apply
  1473. */
  1474. scaling?: {
  1475. x: number;
  1476. y: number;
  1477. z: number;
  1478. };
  1479. /**
  1480. * Easing function to apply
  1481. */
  1482. easingFunction?: number;
  1483. /**
  1484. * An Easing mode to apply to the easing function
  1485. * See BABYLON.EasingFunction
  1486. */
  1487. easingMode?: number;
  1488. }
  1489. }
  1490. declare module 'babylonjs-viewer/loader/plugins/telemetryLoaderPlugin' {
  1491. import { ILoaderPlugin } from "babylonjs-viewer/loader/plugins/loaderPlugin";
  1492. import { ViewerModel } from "babylonjs-viewer/model/viewerModel";
  1493. import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from "babylonjs";
  1494. export class TelemetryLoaderPlugin implements ILoaderPlugin {
  1495. onInit(loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync, model: ViewerModel): void;
  1496. onLoaded(model: ViewerModel): void;
  1497. onError(message: string, exception: any): void;
  1498. onComplete(): void;
  1499. }
  1500. }
  1501. declare module 'babylonjs-viewer/loader/plugins/msftLodLoaderPlugin' {
  1502. import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from 'babylonjs';
  1503. import { IGLTFLoaderExtension } from 'babylonjs-loaders';
  1504. import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
  1505. import { ILoaderPlugin } from 'babylonjs-viewer/loader/plugins/loaderPlugin';
  1506. /**
  1507. * A loder plugin to use MSFT_lod extension correctly (glTF)
  1508. */
  1509. export class MSFTLodLoaderPlugin implements ILoaderPlugin {
  1510. onInit(loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync, model: ViewerModel): void;
  1511. onExtensionLoaded(extension: IGLTFLoaderExtension): void;
  1512. }
  1513. }
  1514. declare module 'babylonjs-viewer/loader/plugins/applyMaterialConfig' {
  1515. import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, Material } from 'babylonjs';
  1516. import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
  1517. import { ILoaderPlugin } from 'babylonjs-viewer/loader/plugins/loaderPlugin';
  1518. /**
  1519. * Force-apply material configuration right after a material was loaded.
  1520. */
  1521. export class ApplyMaterialConfigPlugin implements ILoaderPlugin {
  1522. onInit(loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync, model: ViewerModel): void;
  1523. onMaterialLoaded(material: Material): void;
  1524. }
  1525. }
  1526. declare module 'babylonjs-viewer/loader/plugins/extendedMaterialLoaderPlugin' {
  1527. import { Material } from 'babylonjs';
  1528. import { ILoaderPlugin } from 'babylonjs-viewer/loader/plugins/loaderPlugin';
  1529. /**
  1530. * A (PBR) material will be extended using this function.
  1531. * This function will hold extra default configuration for the viewer, if not implemented in Babylon itself.
  1532. */
  1533. export class ExtendedMaterialLoaderPlugin implements ILoaderPlugin {
  1534. onMaterialLoaded(baseMaterial: Material): void;
  1535. }
  1536. }
  1537. declare module 'babylonjs-viewer/labs/viewerLabs' {
  1538. import { PBREnvironment } from "babylonjs-viewer/labs/environmentSerializer";
  1539. import { ShadowLight, Vector3, Scene } from 'babylonjs';
  1540. /**
  1541. * The ViewerLabs class will hold functions that are not (!) backwards compatible.
  1542. * The APIs in all labs-related classes and configuration might change.
  1543. * Once stable, lab features will be moved to the publis API and configuration object.
  1544. */
  1545. export class ViewerLabs {
  1546. constructor(_scene: Scene);
  1547. assetsRootURL: string;
  1548. environment: PBREnvironment;
  1549. /**
  1550. * Loads an environment map from a given URL
  1551. * @param url URL of environment map
  1552. * @param onSuccess Callback fired after environment successfully applied to the scene
  1553. * @param onProgress Callback fired at progress events while loading the environment map
  1554. * @param onError Callback fired when the load fails
  1555. */
  1556. loadEnvironment(url: string, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
  1557. /**
  1558. * Loads an environment map from a given URL
  1559. * @param buffer ArrayBuffer containing environment map
  1560. * @param onSuccess Callback fired after environment successfully applied to the scene
  1561. * @param onProgress Callback fired at progress events while loading the environment map
  1562. * @param onError Callback fired when the load fails
  1563. */
  1564. loadEnvironment(buffer: ArrayBuffer, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
  1565. /**
  1566. * Sets the environment to an already loaded environment
  1567. * @param env PBREnvironment instance
  1568. * @param onSuccess Callback fired after environment successfully applied to the scene
  1569. * @param onProgress Callback fired at progress events while loading the environment map
  1570. * @param onError Callback fired when the load fails
  1571. */
  1572. loadEnvironment(env: PBREnvironment, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
  1573. /**
  1574. * Applies an `EnvironmentMapConfiguration` to the scene
  1575. * @param environmentMapConfiguration Environment map configuration to apply
  1576. */
  1577. applyEnvironmentMapConfiguration(rotationY?: number): void;
  1578. /**
  1579. * Get an environment asset url by using the configuration if the path is not absolute.
  1580. * @param url Asset url
  1581. * @returns The Asset url using the `environmentAssetsRootURL` if the url is not an absolute path.
  1582. */
  1583. getAssetUrl(url: string): string;
  1584. rotateShadowLight(shadowLight: ShadowLight, amount: number, point?: Vector3, axis?: Vector3, target?: Vector3): void;
  1585. }
  1586. }
  1587. declare module 'babylonjs-viewer/configuration/interfaces/cameraConfiguration' {
  1588. export interface ICameraConfiguration {
  1589. position?: {
  1590. x: number;
  1591. y: number;
  1592. z: number;
  1593. };
  1594. rotation?: {
  1595. x: number;
  1596. y: number;
  1597. z: number;
  1598. w: number;
  1599. };
  1600. fov?: number;
  1601. fovMode?: number;
  1602. minZ?: number;
  1603. maxZ?: number;
  1604. inertia?: number;
  1605. exposure?: number;
  1606. pinchPrecision?: number;
  1607. behaviors?: {
  1608. [name: string]: boolean | number | ICameraBehaviorConfiguration;
  1609. };
  1610. disableCameraControl?: boolean;
  1611. disableCtrlForPanning?: boolean;
  1612. disableAutoFocus?: boolean;
  1613. [propName: string]: any;
  1614. }
  1615. export interface ICameraBehaviorConfiguration {
  1616. type: number;
  1617. [propName: string]: any;
  1618. }
  1619. }
  1620. declare module 'babylonjs-viewer/configuration/interfaces/colorGradingConfiguration' {
  1621. /**
  1622. * The Color Grading Configuration groups the different settings used to define the color grading used in the viewer.
  1623. */
  1624. export interface IColorGradingConfiguration {
  1625. /**
  1626. * Transform data string, encoded as determined by transformDataFormat.
  1627. */
  1628. transformData: string;
  1629. /**
  1630. * The encoding format of TransformData (currently only raw-base16 is supported).
  1631. */
  1632. transformDataFormat: string;
  1633. /**
  1634. * The weight of the transform
  1635. */
  1636. transformWeight: number;
  1637. /**
  1638. * Color curve colorFilterHueGlobal value
  1639. */
  1640. colorFilterHueGlobal: number;
  1641. /**
  1642. * Color curve colorFilterHueShadows value
  1643. */
  1644. colorFilterHueShadows: number;
  1645. /**
  1646. * Color curve colorFilterHueMidtones value
  1647. */
  1648. colorFilterHueMidtones: number;
  1649. /**
  1650. * Color curve colorFilterHueHighlights value
  1651. */
  1652. colorFilterHueHighlights: number;
  1653. /**
  1654. * Color curve colorFilterDensityGlobal value
  1655. */
  1656. colorFilterDensityGlobal: number;
  1657. /**
  1658. * Color curve colorFilterDensityShadows value
  1659. */
  1660. colorFilterDensityShadows: number;
  1661. /**
  1662. * Color curve colorFilterDensityMidtones value
  1663. */
  1664. colorFilterDensityMidtones: number;
  1665. /**
  1666. * Color curve colorFilterDensityHighlights value
  1667. */
  1668. colorFilterDensityHighlights: number;
  1669. /**
  1670. * Color curve saturationGlobal value
  1671. */
  1672. saturationGlobal: number;
  1673. /**
  1674. * Color curve saturationShadows value
  1675. */
  1676. saturationShadows: number;
  1677. /**
  1678. * Color curve saturationMidtones value
  1679. */
  1680. saturationMidtones: number;
  1681. /**
  1682. * Color curve saturationHighlights value
  1683. */
  1684. saturationHighlights: number;
  1685. /**
  1686. * Color curve exposureGlobal value
  1687. */
  1688. exposureGlobal: number;
  1689. /**
  1690. * Color curve exposureShadows value
  1691. */
  1692. exposureShadows: number;
  1693. /**
  1694. * Color curve exposureMidtones value
  1695. */
  1696. exposureMidtones: number;
  1697. /**
  1698. * Color curve exposureHighlights value
  1699. */
  1700. exposureHighlights: number;
  1701. }
  1702. }
  1703. declare module 'babylonjs-viewer/configuration/interfaces/defaultRenderingPipelineConfiguration' {
  1704. import { DepthOfFieldEffectBlurLevel } from 'babylonjs';
  1705. export interface IDefaultRenderingPipelineConfiguration {
  1706. sharpenEnabled?: boolean;
  1707. bloomEnabled?: boolean;
  1708. bloomThreshold?: number;
  1709. depthOfFieldEnabled?: boolean;
  1710. depthOfFieldBlurLevel?: DepthOfFieldEffectBlurLevel;
  1711. fxaaEnabled?: boolean;
  1712. imageProcessingEnabled?: boolean;
  1713. defaultPipelineTextureType?: number;
  1714. bloomScale?: number;
  1715. chromaticAberrationEnabled?: boolean;
  1716. grainEnabled?: boolean;
  1717. bloomKernel?: number;
  1718. hardwareScaleLevel?: number;
  1719. bloomWeight?: number;
  1720. hdr?: boolean;
  1721. samples?: number;
  1722. glowLayerEnabled?: boolean;
  1723. }
  1724. }
  1725. declare module 'babylonjs-viewer/configuration/interfaces/groundConfiguration' {
  1726. export interface IGroundConfiguration {
  1727. size?: number;
  1728. receiveShadows?: boolean;
  1729. shadowLevel?: number;
  1730. shadowOnly?: boolean;
  1731. mirror?: boolean | {
  1732. sizeRatio?: number;
  1733. blurKernel?: number;
  1734. amount?: number;
  1735. fresnelWeight?: number;
  1736. fallOffDistance?: number;
  1737. textureType?: number;
  1738. };
  1739. texture?: string;
  1740. color?: {
  1741. r: number;
  1742. g: number;
  1743. b: number;
  1744. };
  1745. opacity?: number;
  1746. material?: {
  1747. [propName: string]: any;
  1748. };
  1749. }
  1750. }
  1751. declare module 'babylonjs-viewer/configuration/interfaces/imageProcessingConfiguration' {
  1752. export interface IImageProcessingConfiguration {
  1753. colorGradingEnabled?: boolean;
  1754. colorCurvesEnabled?: boolean;
  1755. colorCurves?: {
  1756. globalHue?: number;
  1757. globalDensity?: number;
  1758. globalSaturation?: number;
  1759. globalExposure?: number;
  1760. highlightsHue?: number;
  1761. highlightsDensity?: number;
  1762. highlightsSaturation?: number;
  1763. highlightsExposure?: number;
  1764. midtonesHue?: number;
  1765. midtonesDensity?: number;
  1766. midtonesSaturation?: number;
  1767. midtonesExposure?: number;
  1768. shadowsHue?: number;
  1769. shadowsDensity?: number;
  1770. shadowsSaturation?: number;
  1771. shadowsExposure?: number;
  1772. };
  1773. colorGradingWithGreenDepth?: boolean;
  1774. colorGradingBGR?: boolean;
  1775. exposure?: number;
  1776. toneMappingEnabled?: boolean;
  1777. contrast?: number;
  1778. vignetteEnabled?: boolean;
  1779. vignetteStretch?: number;
  1780. vignetteCentreX?: number;
  1781. vignetteCentreY?: number;
  1782. vignetteWeight?: number;
  1783. vignetteColor?: {
  1784. r: number;
  1785. g: number;
  1786. b: number;
  1787. a?: number;
  1788. };
  1789. vignetteCameraFov?: number;
  1790. vignetteBlendMode?: number;
  1791. vignetteM?: boolean;
  1792. applyByPostProcess?: boolean;
  1793. isEnabled?: boolean;
  1794. }
  1795. }
  1796. declare module 'babylonjs-viewer/configuration/interfaces/lightConfiguration' {
  1797. export interface ILightConfiguration {
  1798. type: number;
  1799. name?: string;
  1800. disabled?: boolean;
  1801. position?: {
  1802. x: number;
  1803. y: number;
  1804. z: number;
  1805. };
  1806. target?: {
  1807. x: number;
  1808. y: number;
  1809. z: number;
  1810. };
  1811. direction?: {
  1812. x: number;
  1813. y: number;
  1814. z: number;
  1815. };
  1816. diffuse?: {
  1817. r: number;
  1818. g: number;
  1819. b: number;
  1820. };
  1821. specular?: {
  1822. r: number;
  1823. g: number;
  1824. b: number;
  1825. };
  1826. intensity?: number;
  1827. intensityMode?: number;
  1828. radius?: number;
  1829. shadownEnabled?: boolean;
  1830. shadowConfig?: {
  1831. useBlurExponentialShadowMap?: boolean;
  1832. useBlurCloseExponentialShadowMap?: boolean;
  1833. useKernelBlur?: boolean;
  1834. blurKernel?: number;
  1835. blurScale?: number;
  1836. minZ?: number;
  1837. maxZ?: number;
  1838. frustumSize?: number;
  1839. angleScale?: number;
  1840. frustumEdgeFalloff?: number;
  1841. [propName: string]: any;
  1842. };
  1843. spotAngle?: number;
  1844. shadowFieldOfView?: number;
  1845. shadowBufferSize?: number;
  1846. shadowFrustumSize?: number;
  1847. shadowMinZ?: number;
  1848. shadowMaxZ?: number;
  1849. [propName: string]: any;
  1850. behaviors?: {
  1851. [name: string]: number | {
  1852. type: number;
  1853. [propName: string]: any;
  1854. };
  1855. };
  1856. }
  1857. }
  1858. declare module 'babylonjs-viewer/configuration/interfaces/observersConfiguration' {
  1859. export interface IObserversConfiguration {
  1860. onEngineInit?: string;
  1861. onSceneInit?: string;
  1862. onModelLoaded?: string;
  1863. }
  1864. }
  1865. declare module 'babylonjs-viewer/configuration/interfaces/sceneConfiguration' {
  1866. import { IImageProcessingConfiguration } from "babylonjs-viewer/configuration/interfaces/imageProcessingConfiguration";
  1867. import { IColorGradingConfiguration } from "babylonjs-viewer/configuration/interfaces/colorGradingConfiguration";
  1868. import { IGlowLayerOptions } from "babylonjs";
  1869. export interface ISceneConfiguration {
  1870. debug?: boolean;
  1871. clearColor?: {
  1872. r: number;
  1873. g: number;
  1874. b: number;
  1875. a: number;
  1876. };
  1877. /** Deprecated, use environmentMap.mainColor instead. */
  1878. mainColor?: {
  1879. r?: number;
  1880. g?: number;
  1881. b?: number;
  1882. };
  1883. imageProcessingConfiguration?: IImageProcessingConfiguration;
  1884. environmentTexture?: string;
  1885. colorGrading?: IColorGradingConfiguration;
  1886. environmentRotationY?: number;
  1887. /**
  1888. * Deprecated, please use default rendering pipeline
  1889. */
  1890. glow?: boolean | IGlowLayerOptions;
  1891. disableHdr?: boolean;
  1892. renderInBackground?: boolean;
  1893. disableCameraControl?: boolean;
  1894. animationPropertiesOverride?: {
  1895. [propName: string]: any;
  1896. };
  1897. defaultMaterial?: {
  1898. materialType: "standard" | "pbr";
  1899. [propName: string]: any;
  1900. };
  1901. flags?: {
  1902. shadowsEnabled?: boolean;
  1903. particlesEnabled?: boolean;
  1904. collisionsEnabled?: boolean;
  1905. lightsEnabled?: boolean;
  1906. texturesEnabled?: boolean;
  1907. lensFlaresEnabled?: boolean;
  1908. proceduralTexturesEnabled?: boolean;
  1909. renderTargetsEnabled?: boolean;
  1910. spritesEnabled?: boolean;
  1911. skeletonsEnabled?: boolean;
  1912. audioEnabled?: boolean;
  1913. };
  1914. assetsRootURL?: string;
  1915. }
  1916. }
  1917. declare module 'babylonjs-viewer/configuration/interfaces/sceneOptimizerConfiguration' {
  1918. export interface ISceneOptimizerConfiguration {
  1919. targetFrameRate?: number;
  1920. trackerDuration?: number;
  1921. autoGeneratePriorities?: boolean;
  1922. improvementMode?: boolean;
  1923. degradation?: string;
  1924. types?: {
  1925. texture?: ISceneOptimizerParameters;
  1926. hardwareScaling?: ISceneOptimizerParameters;
  1927. shadow?: ISceneOptimizerParameters;
  1928. postProcess?: ISceneOptimizerParameters;
  1929. lensFlare?: ISceneOptimizerParameters;
  1930. particles?: ISceneOptimizerParameters;
  1931. renderTarget?: ISceneOptimizerParameters;
  1932. mergeMeshes?: ISceneOptimizerParameters;
  1933. };
  1934. custom?: string;
  1935. }
  1936. export interface ISceneOptimizerParameters {
  1937. priority?: number;
  1938. maximumSize?: number;
  1939. step?: number;
  1940. }
  1941. }
  1942. declare module 'babylonjs-viewer/configuration/interfaces/skyboxConfiguration' {
  1943. import { IImageProcessingConfiguration } from "babylonjs-viewer/configuration/interfaces/imageProcessingConfiguration";
  1944. export interface ISkyboxConfiguration {
  1945. cubeTexture?: {
  1946. noMipMap?: boolean;
  1947. gammaSpace?: boolean;
  1948. url?: string | Array<string>;
  1949. };
  1950. color?: {
  1951. r: number;
  1952. g: number;
  1953. b: number;
  1954. };
  1955. pbr?: boolean;
  1956. scale?: number;
  1957. blur?: number;
  1958. material?: {
  1959. imageProcessingConfiguration?: IImageProcessingConfiguration;
  1960. [propName: string]: any;
  1961. };
  1962. infiniteDistance?: boolean;
  1963. }
  1964. }
  1965. declare module 'babylonjs-viewer/configuration/interfaces/templateConfiguration' {
  1966. /**
  1967. * A single template configuration object
  1968. */
  1969. export interface ITemplateConfiguration {
  1970. /**
  1971. * can be either the id of the template's html element or a URL.
  1972. * See - http://doc.babylonjs.com/extensions/the_templating_system#location-vs-html
  1973. */
  1974. location?: string;
  1975. /**
  1976. * If no location is provided you can provide here the raw html of this template.
  1977. * See http://doc.babylonjs.com/extensions/the_templating_system#location-vs-html
  1978. */
  1979. html?: string;
  1980. id?: string;
  1981. /**
  1982. * Parameters that will be delivered to the template and will render it accordingly.
  1983. */
  1984. params?: {
  1985. [key: string]: string | number | boolean | object;
  1986. };
  1987. /**
  1988. * Events to attach to this template.
  1989. * event name is the key. the value can either be a boolean (attach to the parent element)
  1990. * or a map of html id elements.
  1991. *
  1992. * See - http://doc.babylonjs.com/extensions/the_templating_system#event-binding
  1993. */
  1994. events?: {
  1995. pointerdown?: boolean | {
  1996. [id: string]: boolean;
  1997. };
  1998. pointerup?: boolean | {
  1999. [id: string]: boolean;
  2000. };
  2001. pointermove?: boolean | {
  2002. [id: string]: boolean;
  2003. };
  2004. pointerover?: boolean | {
  2005. [id: string]: boolean;
  2006. };
  2007. pointerout?: boolean | {
  2008. [id: string]: boolean;
  2009. };
  2010. pointerenter?: boolean | {
  2011. [id: string]: boolean;
  2012. };
  2013. pointerleave?: boolean | {
  2014. [id: string]: boolean;
  2015. };
  2016. pointercancel?: boolean | {
  2017. [id: string]: boolean;
  2018. };
  2019. click?: boolean | {
  2020. [id: string]: boolean;
  2021. };
  2022. dragstart?: boolean | {
  2023. [id: string]: boolean;
  2024. };
  2025. drop?: boolean | {
  2026. [id: string]: boolean;
  2027. };
  2028. [key: string]: boolean | {
  2029. [id: string]: boolean;
  2030. } | undefined;
  2031. };
  2032. }
  2033. }
  2034. declare module 'babylonjs-viewer/configuration/interfaces/vrConfiguration' {
  2035. import { VRExperienceHelperOptions } from "babylonjs";
  2036. export interface IVRConfiguration {
  2037. disabled?: boolean;
  2038. objectScaleFactor?: number;
  2039. disableInteractions?: boolean;
  2040. disableTeleportation?: boolean;
  2041. overrideFloorMeshName?: string;
  2042. vrOptions?: VRExperienceHelperOptions;
  2043. modelHeightCorrection?: number | boolean;
  2044. rotateUsingControllers?: boolean;
  2045. cameraPosition?: {
  2046. x: number;
  2047. y: number;
  2048. z: number;
  2049. };
  2050. }
  2051. }
  2052. declare module 'babylonjs-viewer/labs/environmentSerializer' {
  2053. import { Vector3 } from "babylonjs";
  2054. import { TextureCube } from 'babylonjs-viewer/labs/texture';
  2055. /**
  2056. * Spherical polynomial coefficients (counter part to spherical harmonic coefficients used in shader irradiance calculation)
  2057. * @ignoreChildren
  2058. */
  2059. export interface SphericalPolynomalCoefficients {
  2060. x: Vector3;
  2061. y: Vector3;
  2062. z: Vector3;
  2063. xx: Vector3;
  2064. yy: Vector3;
  2065. zz: Vector3;
  2066. yz: Vector3;
  2067. zx: Vector3;
  2068. xy: Vector3;
  2069. }
  2070. /**
  2071. * Wraps data and maps required for environments with physically based rendering
  2072. */
  2073. export interface PBREnvironment {
  2074. /**
  2075. * Spherical Polynomial Coefficients representing an irradiance map
  2076. */
  2077. irradiancePolynomialCoefficients: SphericalPolynomalCoefficients;
  2078. /**
  2079. * Specular cubemap
  2080. */
  2081. specularTexture?: TextureCube;
  2082. /**
  2083. * A scale factor applied to RGB values after reading from environment maps
  2084. */
  2085. textureIntensityScale: number;
  2086. }
  2087. /**
  2088. * Environment map representations: layouts, projections and approximations
  2089. */
  2090. export type MapType = 'irradiance_sh_coefficients_9' | 'cubemap_faces';
  2091. /**
  2092. * Image type used for environment map
  2093. */
  2094. export type ImageType = 'png';
  2095. /**
  2096. * A generic field in JSON that report's its type
  2097. */
  2098. export interface TypedObject<T> {
  2099. type: T;
  2100. }
  2101. /**
  2102. * Describes a range of bytes starting at byte pos (inclusive) and finishing at byte pos + length - 1
  2103. */
  2104. export interface ByteRange {
  2105. pos: number;
  2106. length: number;
  2107. }
  2108. /**
  2109. * Complete Spectre Environment JSON Descriptor
  2110. */
  2111. export interface EnvJsonDescriptor {
  2112. radiance: TypedObject<MapType>;
  2113. irradiance: TypedObject<MapType>;
  2114. specular: TypedObject<MapType>;
  2115. }
  2116. /**
  2117. * Spherical harmonic coefficients to provide an irradiance map
  2118. */
  2119. export interface IrradianceSHCoefficients9 extends TypedObject<MapType> {
  2120. l00: Array<number>;
  2121. l1_1: Array<number>;
  2122. l10: Array<number>;
  2123. l11: Array<number>;
  2124. l2_2: Array<number>;
  2125. l2_1: Array<number>;
  2126. l20: Array<number>;
  2127. l21: Array<number>;
  2128. l22: Array<number>;
  2129. }
  2130. /**
  2131. * A generic set of images, where the image content is specified by byte ranges in the mipmaps field
  2132. */
  2133. export interface ImageSet<T> extends TypedObject<MapType> {
  2134. imageType: ImageType;
  2135. width: number;
  2136. height: number;
  2137. mipmaps: Array<T>;
  2138. multiplier: number;
  2139. }
  2140. /**
  2141. * A set of cubemap faces
  2142. */
  2143. export type CubemapFaces = ImageSet<Array<ByteRange>>;
  2144. /**
  2145. * A single image containing an atlas of equirectangular-projection maps across all mip levels
  2146. */
  2147. export type EquirectangularMipmapAtlas = ImageSet<ByteRange>;
  2148. /**
  2149. * A static class proving methods to aid parsing Spectre environment files
  2150. */
  2151. export class EnvironmentDeserializer {
  2152. /**
  2153. * Parses an arraybuffer into a new PBREnvironment object
  2154. * @param arrayBuffer The arraybuffer of the Spectre environment file
  2155. * @return a PBREnvironment object
  2156. */
  2157. static Parse(arrayBuffer: ArrayBuffer): PBREnvironment;
  2158. }
  2159. }
  2160. declare module 'babylonjs-viewer/labs/texture' {
  2161. import { Scene, CubeTexture, BaseTexture } from "babylonjs";
  2162. /**
  2163. * WebGL Pixel Formats
  2164. */
  2165. export const enum PixelFormat {
  2166. DEPTH_COMPONENT = 6402,
  2167. ALPHA = 6406,
  2168. RGB = 6407,
  2169. RGBA = 6408,
  2170. LUMINANCE = 6409,
  2171. LUMINANCE_ALPHA = 6410
  2172. }
  2173. /**
  2174. * WebGL Pixel Types
  2175. */
  2176. export const enum PixelType {
  2177. UNSIGNED_BYTE = 5121,
  2178. UNSIGNED_SHORT_4_4_4_4 = 32819,
  2179. UNSIGNED_SHORT_5_5_5_1 = 32820,
  2180. UNSIGNED_SHORT_5_6_5 = 33635
  2181. }
  2182. /**
  2183. * WebGL Texture Magnification Filter
  2184. */
  2185. export const enum TextureMagFilter {
  2186. NEAREST = 9728,
  2187. LINEAR = 9729
  2188. }
  2189. /**
  2190. * WebGL Texture Minification Filter
  2191. */
  2192. export const enum TextureMinFilter {
  2193. NEAREST = 9728,
  2194. LINEAR = 9729,
  2195. NEAREST_MIPMAP_NEAREST = 9984,
  2196. LINEAR_MIPMAP_NEAREST = 9985,
  2197. NEAREST_MIPMAP_LINEAR = 9986,
  2198. LINEAR_MIPMAP_LINEAR = 9987
  2199. }
  2200. /**
  2201. * WebGL Texture Wrap Modes
  2202. */
  2203. export const enum TextureWrapMode {
  2204. REPEAT = 10497,
  2205. CLAMP_TO_EDGE = 33071,
  2206. MIRRORED_REPEAT = 33648
  2207. }
  2208. /**
  2209. * Raw texture data and descriptor sufficient for WebGL texture upload
  2210. */
  2211. export interface TextureData {
  2212. /**
  2213. * Width of image
  2214. */
  2215. width: number;
  2216. /**
  2217. * Height of image
  2218. */
  2219. height: number;
  2220. /**
  2221. * Format of pixels in data
  2222. */
  2223. format: PixelFormat;
  2224. /**
  2225. * Row byte alignment of pixels in data
  2226. */
  2227. alignment: number;
  2228. /**
  2229. * Pixel data
  2230. */
  2231. data: ArrayBufferView;
  2232. }
  2233. /**
  2234. * Wraps sampling parameters for a WebGL texture
  2235. */
  2236. export interface SamplingParameters {
  2237. /**
  2238. * Magnification mode when upsampling from a WebGL texture
  2239. */
  2240. magFilter?: TextureMagFilter;
  2241. /**
  2242. * Minification mode when upsampling from a WebGL texture
  2243. */
  2244. minFilter?: TextureMinFilter;
  2245. /**
  2246. * X axis wrapping mode when sampling out of a WebGL texture bounds
  2247. */
  2248. wrapS?: TextureWrapMode;
  2249. /**
  2250. * Y axis wrapping mode when sampling out of a WebGL texture bounds
  2251. */
  2252. wrapT?: TextureWrapMode;
  2253. /**
  2254. * Anisotropic filtering samples
  2255. */
  2256. maxAnisotropy?: number;
  2257. }
  2258. /**
  2259. * Represents a valid WebGL texture source for use in texImage2D
  2260. */
  2261. export type TextureSource = TextureData | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
  2262. /**
  2263. * A generic set of texture mipmaps (where index 0 has the largest dimension)
  2264. */
  2265. export type Mipmaps<T> = Array<T>;
  2266. /**
  2267. * A set of 6 cubemap arranged in the order [+x, -x, +y, -y, +z, -z]
  2268. */
  2269. export type Faces<T> = Array<T>;
  2270. /**
  2271. * A set of texture mipmaps specifically for 2D textures in WebGL (where index 0 has the largest dimension)
  2272. */
  2273. export type Mipmaps2D = Mipmaps<TextureSource>;
  2274. /**
  2275. * A set of texture mipmaps specifically for cubemap textures in WebGL (where index 0 has the largest dimension)
  2276. */
  2277. export type MipmapsCube = Mipmaps<Faces<TextureSource>>;
  2278. /**
  2279. * A minimal WebGL cubemap descriptor
  2280. */
  2281. export class TextureCube {
  2282. internalFormat: PixelFormat;
  2283. type: PixelType;
  2284. source: MipmapsCube;
  2285. /**
  2286. * Returns the width of a face of the texture or 0 if not available
  2287. */
  2288. readonly Width: number;
  2289. /**
  2290. * Returns the height of a face of the texture or 0 if not available
  2291. */
  2292. readonly Height: number;
  2293. /**
  2294. * constructor
  2295. * @param internalFormat WebGL pixel format for the texture on the GPU
  2296. * @param type WebGL pixel type of the supplied data and texture on the GPU
  2297. * @param source An array containing mipmap levels of faces, where each mipmap level is an array of faces and each face is a TextureSource object
  2298. */
  2299. constructor(internalFormat: PixelFormat, type: PixelType, source?: MipmapsCube);
  2300. }
  2301. /**
  2302. * A static class providing methods to aid working with Bablyon textures.
  2303. */
  2304. export class TextureUtils {
  2305. /**
  2306. * A prefix used when storing a babylon texture object reference on a Spectre texture object
  2307. */
  2308. static BabylonTextureKeyPrefix: string;
  2309. /**
  2310. * Controls anisotropic filtering for deserialized textures.
  2311. */
  2312. static MaxAnisotropy: number;
  2313. /**
  2314. * Returns a BabylonCubeTexture instance from a Spectre texture cube, subject to sampling parameters.
  2315. * If such a texture has already been requested in the past, this texture will be returned, otherwise a new one will be created.
  2316. * The advantage of this is to enable working with texture objects without the need to initialize on the GPU until desired.
  2317. * @param scene A Babylon Scene instance
  2318. * @param textureCube A Spectre TextureCube object
  2319. * @param parameters WebGL texture sampling parameters
  2320. * @param automaticMipmaps Pass true to enable automatic mipmap generation where possible (requires power of images)
  2321. * @param environment Specifies that the texture will be used as an environment
  2322. * @param singleLod Specifies that the texture will be a singleLod (for environment)
  2323. * @return Babylon cube texture
  2324. */
  2325. static GetBabylonCubeTexture(scene: Scene, textureCube: TextureCube, automaticMipmaps: boolean, environment?: boolean, singleLod?: boolean): CubeTexture;
  2326. /**
  2327. * Applies Spectre SamplingParameters to a Babylon texture by directly setting texture parameters on the internal WebGLTexture as well as setting Babylon fields
  2328. * @param babylonTexture Babylon texture to apply texture to (requires the Babylon texture has an initialize _texture field)
  2329. * @param parameters Spectre SamplingParameters to apply
  2330. */
  2331. static ApplySamplingParameters(babylonTexture: BaseTexture, parameters: SamplingParameters): void;
  2332. /**
  2333. * Environment preprocessing dedicated value (Internal Use or Advanced only).
  2334. */
  2335. static EnvironmentLODScale: number;
  2336. /**
  2337. * Environment preprocessing dedicated value (Internal Use or Advanced only)..
  2338. */
  2339. static EnvironmentLODOffset: number;
  2340. }
  2341. }