babylon.manager.d.ts 131 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707
  1. declare module BABYLON {
  2. /**
  3. * Babylon scene manager class
  4. * @class SceneManager - All rights reserved (c) 2020 Mackey Kinard
  5. */
  6. class SceneManager {
  7. /** Gets the toolkit framework version number */
  8. static get Version(): string;
  9. /** Gets the toolkit framework copyright notice */
  10. static get Copyright(): string;
  11. /** Pauses the main page render loop */
  12. static PauseRenderLoop: boolean;
  13. /** Register handler that is triggered when the fonts have been loaded (engine.html) */
  14. static OnFontsReadyObservable: Observable<Engine>;
  15. /** Register handler that is triggered when then engine has been resized (engine.html) */
  16. static OnEngineResizeObservable: Observable<Engine>;
  17. /** Register handler that is triggered when the scene has been loaded (engine.html) */
  18. static OnLoadCompleteObservable: Observable<Engine>;
  19. /** Registers an handler for window state show scene loader function (engine.html) */
  20. static RegisterOnShowSceneLoader(func: (show: boolean) => void): void;
  21. /** Registers an handler for window socket disconnect event (engine.html) */
  22. static RegisterOnUpdateSceneLoader(func: (status: string, details: string, state: number) => void): void;
  23. /** Registers an handler for window state show scene loader function (engine.html) */
  24. static RegisterOnTickSceneLoader(func: (percent: number) => void): void;
  25. /** Loads a babylon scene file using the page loader window hooks (engine.html) */
  26. static LoadSceneFile(sceneFile: string, queryString?: string): void;
  27. /** Shows the top page scene loader (engine.html) */
  28. static ShowParentLoader(show: boolean): void;
  29. /** Get the system render quality setting. */
  30. static GetRenderQuality(): BABYLON.RenderQuality;
  31. /** Set the system render quality setting. */
  32. static SetRenderQuality(quality: BABYLON.RenderQuality): void;
  33. /** Get an item from top window local storage. */
  34. static GetLocalStorageItem(key: string): string;
  35. /** Set an item to top window local storage. */
  36. static SetLocalStorageItem(key: string, value: string): void;
  37. /** Get an item from top window session storage. */
  38. static GetSessionStorageItem(key: string): string;
  39. /** Set an item to top window session storage. */
  40. static SetSessionStorageItem(key: string, value: string): void;
  41. /** Store data object in the window state cache */
  42. static SetWindowState(name: string, data: any): void;
  43. /** Retrieve data object from the window state cache */
  44. static GetWindowState<T>(name: string): T;
  45. /** Post a safe message to top or local window */
  46. static PostWindowMessage(message: any, targetOrigin: string, transfer?: Transferable[]): void;
  47. private static SceneParsingEnabled;
  48. /** Enable scene loader parsing plugin */
  49. static EnableSceneParsing(enabled: boolean): void;
  50. /** Is scene loader parsing plugin enabled */
  51. static IsSceneParsingEnabled(): boolean;
  52. private static AdvDynamicTexture;
  53. /** Get the default fullscreen user interface advanced dynamic texture */
  54. static GetFullscreenUI(scene: BABYLON.Scene): BABYLON.GUI.AdvancedDynamicTexture;
  55. /** Get the scene default ambient skybox mesh */
  56. static GetAmbientSkybox(scene: BABYLON.Scene): BABYLON.AbstractMesh;
  57. /** Get the scene default intenisty factor */
  58. static GetIntensityFactor(): number;
  59. /** Are scene manager debugging services available. */
  60. static IsDebugMode(): boolean;
  61. /** Send log data directly to the console. */
  62. static ConsoleLog(...data: any[]): void;
  63. /** Send info data directly to the console. */
  64. static ConsoleInfo(...data: any[]): void;
  65. /** Send warning data directly to the console. */
  66. static ConsoleWarn(...data: any[]): void;
  67. /** Send error data directly to the console. */
  68. static ConsoleError(...data: any[]): void;
  69. /** Logs a message to the console using the babylon logging system. */
  70. static LogMessage(message: string): void;
  71. /** Logs a warning to the console using babylon logging system. */
  72. static LogWarning(warning: string): void;
  73. /** Logs a error to the console using babylon logging system. */
  74. static LogError(error: string): void;
  75. /** Are unversial windows platform services available. */
  76. static IsWindows(): boolean;
  77. /** Are mobile cordova platform services available. */
  78. static IsCordova(): boolean;
  79. /** Are web assembly platform services available. */
  80. static IsWebAssembly(): boolean;
  81. /** Is oculus browser platform agent. */
  82. static IsOculusBrowser(): boolean;
  83. /** Is samsung browser platform agent. */
  84. static IsSamsungBrowser(): boolean;
  85. /** Is windows phone platform agent. */
  86. static IsWindowsPhone(): boolean;
  87. /** Is blackberry web platform agent. */
  88. static IsBlackBerry(): boolean;
  89. /** Is opera web platform agent. */
  90. static IsOperaMini(): boolean;
  91. /** Is android web platform agent. */
  92. static IsAndroid(): boolean;
  93. /** Is web os platform agent. */
  94. static IsWebOS(): boolean;
  95. /** Is ios web platform agent. */
  96. static IsIOS(): boolean;
  97. /** Is iphone web platform agent. */
  98. static IsIPHONE(): boolean;
  99. /** Is ipad web platform agent. */
  100. static IsIPAD(): boolean;
  101. /** Is ipod web platform agent. */
  102. static IsIPOD(): boolean;
  103. /** Is internet explorer 11 platform agent. */
  104. static IsIE11(): boolean;
  105. /** Is mobile web platform agent. */
  106. static IsMobile(): boolean;
  107. /** Are playstation services available. */
  108. static IsPlaystation(): boolean;
  109. /** Are xbox console services available. */
  110. static IsXboxConsole(): boolean;
  111. /** Are xbox live platform services available. */
  112. static IsXboxLive(): boolean;
  113. /** Get the current time in seconds */
  114. static GetTime(): number;
  115. /** Get the total game time in seconds */
  116. static GetGameTime(): number;
  117. /** Get the current delta time in seconds */
  118. static GetDeltaSeconds(scene: BABYLON.Scene): number;
  119. /** Get the delta time animation ratio multiplier */
  120. static GetAnimationRatio(scene: BABYLON.Scene): number;
  121. /** Delays a function call using request animation frames. Returns a handle object */
  122. static SetTimeout(timeout: number, func: () => void): any;
  123. /** Calls request animation frame delay with handle to cancel pending timeout call */
  124. static ClearTimeout(handle: any): void;
  125. /** Repeats a function call using request animation frames. Retuns a handle object */
  126. static SetInterval(interval: number, func: () => void): any;
  127. /** Calls request animation frame repeast with handle to clear pending interval call. */
  128. static ClearInterval(handle: any): void;
  129. /** Run a function on the next render loop. */
  130. static RunOnce(scene: BABYLON.Scene, func: () => void, timeout?: number): void;
  131. /** Popup debug layer in window. */
  132. static PopupDebug(scene: BABYLON.Scene): void;
  133. /** Toggle debug layer on and off. */
  134. static ToggleDebug(scene: BABYLON.Scene, embed?: boolean, parent?: HTMLElement): void;
  135. /** Disposes entire scene and release all resources */
  136. static DisposeScene(scene: BABYLON.Scene, clearColor?: BABYLON.Color4): void;
  137. /** Safely destroy transform node */
  138. static SafeDestroy(transform: BABYLON.TransformNode, delay?: number, disable?: boolean): void;
  139. /** Open alert message dialog. */
  140. static AlertMessage(text: string, title?: string): any;
  141. /** Gets the names query string from page url. */
  142. static GetQueryStringParam(name: string, url: string): string;
  143. /** Gets the current engine WebGL version string info. */
  144. static GetWebGLVersionString(scene: BABYLON.Scene): string;
  145. /** Gets the current engine WebGL version number info. */
  146. static GetWebGLVersionNumber(scene: BABYLON.Scene): number;
  147. /** Get the root url the last scene properties was loaded from */
  148. static GetRootUrl(scene: BABYLON.Scene): string;
  149. /** Sets the root url the last scene properties was loaded from */
  150. static SetRootUrl(scene: BABYLON.Scene, url: string): void;
  151. /** Get the file name the last scene properties was loaded from */
  152. static GetSceneFile(scene: BABYLON.Scene): string;
  153. /** Sets the file name the last scene properties was loaded from */
  154. static SetSceneFile(scene: BABYLON.Scene, fileName: string): void;
  155. /** Get the right hand loader flag the last scene properties was loaded from */
  156. static GetRightHanded(scene: BABYLON.Scene): boolean;
  157. /** Sets the right hand loader flag the last scene properties was loaded from */
  158. static SetRightHanded(scene: BABYLON.Scene, righty: boolean): void;
  159. /** Set the Windows Runtime preferred launch windowing mode. (Example: Windows.UI.ViewManagement.ApplicationViewWindowingMode.fullScreen = 1) */
  160. static SetWindowsLaunchMode(mode?: number): void;
  161. /** Show the default page error message. */
  162. static ShowPageErrorMessage(message: string, title?: string, timeout?: number): void;
  163. /** Quit the Windows Runtime host application. */
  164. static QuitWindowsApplication(): void;
  165. /** Loads a file as text (IFileRequest) */
  166. static LoadTextFile(url: string, onSuccess: (data: string) => void, onProgress?: (data: any) => void, onError?: (request?: WebRequest, exception?: any) => void): BABYLON.IFileRequest;
  167. /** Load a text based file */
  168. static LoadTextFileAsync(url: string): Promise<string>;
  169. /** Post data to server (XmlHttpRequest) */
  170. static PostDataToServer(url: string, data: string | Document | Blob | ArrayBufferView | ArrayBuffer | FormData | URLSearchParams | ReadableStream<Uint8Array>, contentType?: string, onSuccess?: (status: int) => void, onFailure?: (reason: any) => void): XMLHttpRequest;
  171. /** Post data to server asynchronously */
  172. static PostDataToServerAsync(url: string, data: string | Document | Blob | ArrayBufferView | ArrayBuffer | FormData | URLSearchParams | ReadableStream<Uint8Array>, contentType?: string): Promise<number>;
  173. /** Shows the default page scene loader. */
  174. static ShowDefaultLoader(show: boolean): void;
  175. /** Update the default page scene loader status. */
  176. static UpdateLoaderStatus(status: string, details: string, state: number): void;
  177. /** Gets all the created engine instances */
  178. static GetEngineInstances(): BABYLON.Engine[];
  179. /** Get the last create engine instance */
  180. static GetLastCreatedEngine(): BABYLON.Engine;
  181. /** Get the last created scene instance */
  182. static GetLastCreatedScene(): BABYLON.Scene;
  183. /** Get managed asset container. */
  184. static GetAssetContainer(scene: BABYLON.Scene, name: string): BABYLON.AssetContainer;
  185. /** Set managed asset container. */
  186. static SetAssetContainer(scene: BABYLON.Scene, name: string, container: BABYLON.AssetContainer): void;
  187. /** Clear all managed asset containers. */
  188. static ClearAssetContainers(scene: BABYLON.Scene): void;
  189. /** Gets the specified mesh by name from scene. */
  190. static GetMesh(scene: BABYLON.Scene, name: string): BABYLON.Mesh;
  191. /** Gets the specified mesh by id from scene. */
  192. static GetMeshByID(scene: BABYLON.Scene, id: string): BABYLON.Mesh;
  193. /** Gets the specified abstract mesh by name from scene. */
  194. static GetAbstractMesh(scene: BABYLON.Scene, name: string): BABYLON.AbstractMesh;
  195. /** Gets the specified abstract mesh by id from scene. */
  196. static GetAbstractMeshByID(scene: BABYLON.Scene, id: string): BABYLON.AbstractMesh;
  197. /** Gets the specified transform node by name from scene. */
  198. static GetTransformNode(scene: BABYLON.Scene, name: string): BABYLON.TransformNode;
  199. /** Gets the specified transform node by id from scene. */
  200. static GetTransformNodeByID(scene: BABYLON.Scene, id: string): BABYLON.TransformNode;
  201. /** Gets the transform node child detail mesh. */
  202. static GetTransformDetailMesh(transform: TransformNode): BABYLON.AbstractMesh;
  203. /** Gets the transform node primitive meshes. */
  204. static GetPrimitiveMeshes(transform: TransformNode): BABYLON.AbstractMesh[];
  205. /** Gets the specified transform node primary layer index. */
  206. static GetTransformLayer(transform: BABYLON.TransformNode): number;
  207. /** Gets the specified transform node primary tag name. */
  208. static GetTransformTag(transform: BABYLON.TransformNode): string;
  209. /** Check if the transform has the specified query tag match */
  210. static HasTransformTags(transform: BABYLON.TransformNode, query: string): boolean;
  211. /** Are half or full texture floats supported */
  212. static TextureFloatSupported(scene: BABYLON.Scene): boolean;
  213. /** Registers an on pick trigger click action */
  214. static RegisterClickAction(scene: BABYLON.Scene, mesh: BABYLON.AbstractMesh, func: () => void): BABYLON.IAction;
  215. /** Unregisters an on pick trigger click action */
  216. static UnregisterClickAction(mesh: BABYLON.AbstractMesh, action: BABYLON.IAction): boolean;
  217. /** Starts a targeted float animation for tweening. */
  218. static StartTweenAnimation(scene: BABYLON.Scene, name: string, targetObject: any, targetProperty: string, startValue: number, endValue: number, speedRatio?: number, frameRate?: number, loopMode?: number, easingFunction?: BABYLON.EasingFunction, onAnimationComplete?: () => void): BABYLON.Animatable;
  219. /** Get first material with name. (Uses starts with text searching) */
  220. static GetMaterialWithName(scene: BABYLON.Scene, name: string): BABYLON.Material;
  221. /** Get all materials with name. (Uses starts with text searching) */
  222. static GetAllMaterialsWithName(scene: BABYLON.Scene, name: string): BABYLON.Material[];
  223. /** Instantiate the specified prefab asset hierarchy into the scene. (Cloned Hierarchy) */
  224. static InstantiatePrefab(container: BABYLON.AssetContainer, prefabName: string, newName: string, makeNewMaterials?: boolean, cloneAnimations?: boolean): BABYLON.TransformNode;
  225. /** Clones the specified transform node asset into the scene. (Transform Node) */
  226. static CloneTransformNode(container: BABYLON.AssetContainer, nodeName: string, cloneName: string): BABYLON.TransformNode;
  227. /** Clones the specified abstract mesh asset into the scene. (Abtract Mesh) */
  228. static CloneAbstractMesh(container: BABYLON.AssetContainer, nodeName: string, cloneName: string): BABYLON.AbstractMesh;
  229. /** Creates an instance of the specified mesh asset into the scene. (Mesh Instance) */
  230. static CreateInstancedMesh(container: BABYLON.AssetContainer, meshName: string, instanceName: string): BABYLON.InstancedMesh;
  231. /** Registers a script componment with the scene manager. */
  232. static RegisterScriptComponent(instance: BABYLON.ScriptComponent, alias: string, validate?: boolean): void;
  233. /** Destroys a script component instance. */
  234. static DestroyScriptComponent(instance: BABYLON.ScriptComponent): void;
  235. /** Finds a script component on the transform with the specfied class name. */
  236. static FindScriptComponent<T extends BABYLON.ScriptComponent>(transform: BABYLON.TransformNode, klass: string): T;
  237. /** Finds all script components on the transform with the specfied class name. */
  238. static FindAllScriptComponents<T extends BABYLON.ScriptComponent>(transform: BABYLON.TransformNode, klass: string): T[];
  239. /** Finds the transform object metedata in the scene. */
  240. static FindSceneMetadata(transform: BABYLON.TransformNode): any;
  241. /** Finds the specfied camera rig in the scene. */
  242. static FindSceneCameraRig(transform: BABYLON.TransformNode): BABYLON.FreeCamera;
  243. /** Finds the specfied light rig in the scene. */
  244. static FindSceneLightRig(transform: BABYLON.TransformNode): BABYLON.Light;
  245. /** Finds all transforms with the specified script component. */
  246. static FindTransformsWithScript(scene: BABYLON.Scene, klass: string): BABYLON.TransformNode;
  247. /** Finds all transforms with the specified script component. */
  248. static FindAllTransformsWithScript(scene: BABYLON.Scene, klass: string): BABYLON.TransformNode[];
  249. /** Finds the specfied child transform in the scene. */
  250. static FindChildTransformNode(parent: BABYLON.TransformNode, name: string, searchType?: BABYLON.SearchType, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  251. /** Finds the first child transform with matching tags. */
  252. static FindChildTransformWithTags(parent: BABYLON.TransformNode, query: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  253. /** Finds all child transforms with matching tags. */
  254. static FindAllChildTransformsWithTags(parent: BABYLON.TransformNode, query: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode[];
  255. /** Finds the first child transform with the specified script component. */
  256. static FindChildTransformWithScript(parent: BABYLON.TransformNode, klass: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  257. /** Finds all child transforms with the specified script component. */
  258. static FindAllChildTransformsWithScript(parent: BABYLON.TransformNode, klass: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode[];
  259. /** Searches all nodes for the instance of the specified script component. */
  260. static SearchForScriptComponentByName<T extends BABYLON.ScriptComponent>(scene: BABYLON.Scene, klass: string): T;
  261. /** Searches all nodes for all instances of the specified script component. */
  262. static SearchForAllScriptComponentsByName<T extends BABYLON.ScriptComponent>(scene: BABYLON.Scene, klass: string): T[];
  263. /** Moves entity using vector position with camera collisions. */
  264. static MoveWithCollisions(entity: BABYLON.AbstractMesh, velocity: BABYLON.Vector3): void;
  265. /** Moves entity using vector position using translations. */
  266. static MoveWithTranslation(entity: BABYLON.TransformNode, velocity: BABYLON.Vector3): void;
  267. /** Turns entity using quaternion rotations in radians. */
  268. static TurnWithRotation(entity: BABYLON.TransformNode, radians: number, space?: BABYLON.Space): void;
  269. /** Callback to setup ammo.js plugin properties when activated on the scene. */
  270. static OnSetupPhysicsPlugin: (scene: BABYLON.Scene, plugin: BABYLON.AmmoJSPlugin) => void;
  271. /** Get ammo.js total memory heap size */
  272. static GetPhysicsHeapSize(): number;
  273. /** Confiures ammo.js physcis engine advanced sweeping and collision detection options on the scene. */
  274. static ConfigurePhysicsEngine(scene: BABYLON.Scene, deltaWorldStep?: boolean, maxPhysicsStep?: number, maxWorldSweep?: number, ccdEnabled?: boolean, ccdPenetration?: number, gravityLevel?: BABYLON.Vector3): void;
  275. /** Gets the current ammo.js physics world. */
  276. static GetPhysicsEngine(scene: BABYLON.Scene): BABYLON.IPhysicsEngine;
  277. /** Gets the current ammo.js physics world. */
  278. static GetPhysicsWorld(scene: BABYLON.Scene): any;
  279. private static TempVRayDest;
  280. private static TempVRayOrigin;
  281. private static TempShapeVector;
  282. private static TempPhysicsWorld;
  283. private static TempTransformFrom;
  284. private static TempTransformTo;
  285. private static TempCastEndPoint;
  286. private static TempRaycastResult;
  287. private static ClosestRayResultCallback;
  288. private static ClosestConvexResultCallback;
  289. /** Perform a ammo.js physics world ray testing direction length with optional group filter mask. */
  290. static PhysicsRaycast(scene: BABYLON.Scene, origin: BABYLON.Vector3, direction: BABYLON.Vector3, length: number, group?: number, mask?: number): BABYLON.Nullable<BABYLON.RaycastHitResult>;
  291. /** Perform a ammo.js physics world ray testing destination point with optional group filter mask. */
  292. static PhysicsRaycastToPoint(scene: BABYLON.Scene, origin: BABYLON.Vector3, destination: BABYLON.Vector3, group?: number, mask?: number): BABYLON.Nullable<BABYLON.RaycastHitResult>;
  293. /** Perform a ammo.js physics world shape testing direction length with optional group filter mask. */
  294. static PhysicsShapecast(scene: BABYLON.Scene, btConvexShape: any, origin: BABYLON.Vector3, direction: BABYLON.Vector3, length: number, group?: number, mask?: number): BABYLON.Nullable<BABYLON.RaycastHitResult>;
  295. /** Perform a ammo.js physics world shape testing diestination point with optional group filter mask. */
  296. static PhysicsShapecastToPoint(scene: BABYLON.Scene, btConvexShape: any, origin: BABYLON.Vector3, destination: BABYLON.Vector3, group?: number, mask?: number): BABYLON.Nullable<BABYLON.RaycastHitResult>;
  297. /** Creates a validated entity parent child physics impostor */
  298. static CreatePhysicsImpostor(scene: BABYLON.Scene, entity: BABYLON.AbstractMesh, type: number, options: BABYLON.PhysicsImpostorParameters, reparent?: boolean): void;
  299. /** Gets the physics impostor type as a string. */
  300. static GetPhysicsImposterType(type: number): string;
  301. /** Creates a ammo.js physics box collision shape */
  302. static CreatePhysicsBoxShape(halfextents: BABYLON.Vector3): any;
  303. /** Creates a ammo.js physics sphere collision shape */
  304. static CreatePhysicsSphereShape(radius: number): any;
  305. /** Creates a ammo.js physics capsule collision shape */
  306. static CreatePhysicsCapsuleShape(radius: number, height: number): any;
  307. /** Creates a ammo.js physics compound collision shape */
  308. static CreatePhysicsCompoundShape(enableDynamicAabbTree?: boolean): any;
  309. /** Creates a ammo.js physics empty concave collision shape */
  310. static CreatePhysicsEmptyShape(): any;
  311. static MAX_AGENT_COUNT: number;
  312. static MAX_AGENT_RADIUS: number;
  313. private static NavigationMesh;
  314. private static CrowdInterface;
  315. private static PluginInstance;
  316. /** Register handler that is triggered when the audio clip is ready */
  317. static OnNavMeshReadyObservable: Observable<Mesh>;
  318. /** Get recast total memory heap size */
  319. static GetRecastHeapSize(): number;
  320. /** Gets the recast navigation plugin tools. (Singleton Instance) */
  321. static GetNavigationTools(): BABYLON.RecastJSPlugin;
  322. /** Gets the recast navigation crowd interface. (Singleton Instance) */
  323. static GetCrowdInterface(scene: BABYLON.Scene): BABYLON.ICrowd;
  324. /** Has the recast baked navigation data. (Navigation Helper) */
  325. static HasNavigationData(): boolean;
  326. /** Gets the current recast navigation mesh. (Navigation Helper) */
  327. static GetNavigationMesh(): BABYLON.Mesh;
  328. /** Bake the recast navigation mesh from geometry. (Navigation Helper) */
  329. static BakeNavigationMesh(scene: BABYLON.Scene, meshes: BABYLON.Mesh[], properties: BABYLON.INavMeshParameters, debug?: boolean, color?: BABYLON.Color3, collisionMesh?: boolean): BABYLON.Mesh;
  330. /** Load the recast navigation mesh binary data. (Navigation Helper) */
  331. static LoadNavigationMesh(scene: BABYLON.Scene, data: Uint8Array, debug?: boolean, color?: BABYLON.Color3, timeSteps?: number, collisionMesh?: boolean): BABYLON.Mesh;
  332. /** Save the recast navigation mesh binary data. (Navigation Helper) */
  333. static SaveNavigationMesh(): Uint8Array;
  334. /** Computes a recast navigation path. (Navigation Helper) */
  335. static ComputeNavigationPath(start: BABYLON.Vector3, end: BABYLON.Vector3, closetPoint?: boolean): BABYLON.Vector3[];
  336. /** Animate movement along a navigation path. (Navigation Helper) */
  337. static MoveAlongNavigationPath(scene: BABYLON.Scene, agent: BABYLON.TransformNode, path: BABYLON.Vector3[], speed?: number, easing?: BABYLON.EasingFunction, callback?: () => void): BABYLON.Animation;
  338. /** Global gamepad manager */
  339. static GamepadManager: BABYLON.GamepadManager;
  340. /** Global gamepad connect event handler */
  341. static GamepadConnected: (pad: BABYLON.Gamepad, state: BABYLON.EventState) => void;
  342. /** Global gamepad disconnect event handler */
  343. static GamepadDisconnected: (pad: BABYLON.Gamepad, state: BABYLON.EventState) => void;
  344. /** Enable user input state in the scene. */
  345. static EnableUserInput(scene: BABYLON.Scene, options?: {
  346. pointerLock?: boolean;
  347. preventDefault?: boolean;
  348. useCapture?: boolean;
  349. enableVirtualJoystick?: boolean;
  350. disableRightStick?: boolean;
  351. }): void;
  352. /** Disables user input state in the scene. */
  353. static DisableUserInput(scene: BABYLON.Scene, useCapture?: boolean): void;
  354. /** Toggle full screen scene mode. */
  355. static ToggleFullscreenMode(scene: BABYLON.Scene, requestPointerLock?: boolean): void;
  356. /** Enter full screen scene mode. */
  357. static EnterFullscreenMode(scene: BABYLON.Scene, requestPointerLock?: boolean): void;
  358. /** Exit full screen scene mode. */
  359. static ExitFullscreenMode(scene: BABYLON.Scene): void;
  360. /** Locks user pointer state in the scene. */
  361. static LockMousePointer(scene: BABYLON.Scene, lock: boolean): void;
  362. private static PointerLockedFlag;
  363. static IsPointerLocked(): boolean;
  364. private static LockMousePointerObserver;
  365. static IsPointerLockHandled(): boolean;
  366. /** Get user input state from the scene. */
  367. static GetUserInput(input: BABYLON.UserInputAxis, player?: BABYLON.PlayerNumber): number;
  368. /** Set a keyboard up event handler. */
  369. static OnKeyboardUp(callback: (keycode: number) => void): void;
  370. /** Set a keyboard down event handler. */
  371. static OnKeyboardDown(callback: (keycode: number) => void): void;
  372. /** Set a keyboard press event handler. */
  373. static OnKeyboardPress(keycode: number, callback: () => void): void;
  374. /** Get the specified keyboard input by keycode. */
  375. static GetKeyboardInput(keycode: number): boolean;
  376. /** Set a pointer up event handler. */
  377. static OnPointerUp(callback: (button: number) => void): void;
  378. /** Set a pointer down event handler. */
  379. static OnPointerDown(callback: (button: number) => void): void;
  380. /** Set a pointer press event handler. */
  381. static OnPointerPress(button: number, callback: () => void): void;
  382. /** Get the specified pointer input by button. */
  383. static GetPointerInput(button: number): boolean;
  384. /** Get left virtual joystick. */
  385. static GetLeftJoystick(): BABYLON.VirtualJoystick;
  386. /** Get right virtual joystick. */
  387. static GetRightJoystick(): BABYLON.VirtualJoystick;
  388. /** Get joystick button pressed. */
  389. static GetJoystickPress(button: number): boolean;
  390. /** Dispose virtual joystick setup. */
  391. static DisposeVirtualJoysticks(): void;
  392. /** Set on gamepad button up event handler. */
  393. static OnGamepadButtonUp(callback: (button: number) => void, player?: BABYLON.PlayerNumber): void;
  394. /** Set on gamepad button down event handler. */
  395. static OnGamepadButtonDown(callback: (button: number) => void, player?: BABYLON.PlayerNumber): void;
  396. /** Set on gamepad button press event handler. */
  397. static OnGamepadButtonPress(button: number, callback: () => void, player?: BABYLON.PlayerNumber): void;
  398. /** Get the specified gamepad input by button. */
  399. static GetGamepadButtonInput(button: number, player?: BABYLON.PlayerNumber): boolean;
  400. /** Set on gamepad direction pad up event handler. */
  401. static OnGamepadDirectionUp(callback: (direction: number) => void, player?: BABYLON.PlayerNumber): void;
  402. /** Set on gamepad direction pad down event handler. */
  403. static OnGamepadDirectionDown(callback: (direction: number) => void, player?: BABYLON.PlayerNumber): void;
  404. /** Set on gamepad direction pad press event handler. */
  405. static OnGamepadDirectionPress(direction: number, callback: () => void, player?: BABYLON.PlayerNumber): void;
  406. /** Get the specified gamepad direction input by number. */
  407. static GetGamepadDirectionInput(direction: number, player?: BABYLON.PlayerNumber): boolean;
  408. /** Set on gamepad trigger left event handler. */
  409. static OnGamepadTriggerLeft(callback: (value: number) => void, player?: BABYLON.PlayerNumber): void;
  410. /** Set on gamepad trigger right event handler. */
  411. static OnGamepadTriggerRight(callback: (value: number) => void, player?: BABYLON.PlayerNumber): void;
  412. /** Get the specified gamepad trigger input by number. */
  413. static GetGamepadTriggerInput(trigger: number, player?: BABYLON.PlayerNumber): number;
  414. /** Get the specified gamepad type. */
  415. static GetGamepadType(player?: BABYLON.PlayerNumber): BABYLON.GamepadType;
  416. /** Get the specified gamepad. */
  417. static GetGamepad(player?: BABYLON.PlayerNumber): BABYLON.Gamepad;
  418. private static input;
  419. private static keymap;
  420. private static wheel;
  421. private static mousex;
  422. private static mousey;
  423. private static vertical;
  424. private static horizontal;
  425. private static mousex2;
  426. private static mousey2;
  427. private static vertical2;
  428. private static horizontal2;
  429. private static mousex3;
  430. private static mousey3;
  431. private static vertical3;
  432. private static horizontal3;
  433. private static mousex4;
  434. private static mousey4;
  435. private static vertical4;
  436. private static horizontal4;
  437. private static a_mousex;
  438. private static x_wheel;
  439. private static x_mousex;
  440. private static x_mousey;
  441. private static x_vertical;
  442. private static x_horizontal;
  443. private static k_mousex;
  444. private static k_mousey;
  445. private static k_vertical;
  446. private static k_horizontal;
  447. private static j_mousex;
  448. private static j_mousey;
  449. private static j_vertical;
  450. private static j_horizontal;
  451. private static g_mousex1;
  452. private static g_mousey1;
  453. private static g_vertical1;
  454. private static g_horizontal1;
  455. private static g_mousex2;
  456. private static g_mousey2;
  457. private static g_vertical2;
  458. private static g_horizontal2;
  459. private static g_mousex3;
  460. private static g_mousey3;
  461. private static g_vertical3;
  462. private static g_horizontal3;
  463. private static g_mousex4;
  464. private static g_mousey4;
  465. private static g_vertical4;
  466. private static g_horizontal4;
  467. private static mouseButtonPress;
  468. private static mouseButtonDown;
  469. private static mouseButtonUp;
  470. private static keyButtonPress;
  471. private static keyButtonDown;
  472. private static keyButtonUp;
  473. private static leftJoystick;
  474. private static rightJoystick;
  475. private static virtualJoystick;
  476. private static previousPosition;
  477. private static preventDefault;
  478. private static rightHanded;
  479. private static gamepad1;
  480. private static gamepad1Type;
  481. private static gamepad1ButtonPress;
  482. private static gamepad1ButtonDown;
  483. private static gamepad1ButtonUp;
  484. private static gamepad1DpadPress;
  485. private static gamepad1DpadDown;
  486. private static gamepad1DpadUp;
  487. private static gamepad1LeftTrigger;
  488. private static gamepad1RightTrigger;
  489. private static gamepad2;
  490. private static gamepad2Type;
  491. private static gamepad2ButtonPress;
  492. private static gamepad2ButtonDown;
  493. private static gamepad2ButtonUp;
  494. private static gamepad2DpadPress;
  495. private static gamepad2DpadDown;
  496. private static gamepad2DpadUp;
  497. private static gamepad2LeftTrigger;
  498. private static gamepad2RightTrigger;
  499. private static gamepad3;
  500. private static gamepad3Type;
  501. private static gamepad3ButtonPress;
  502. private static gamepad3ButtonDown;
  503. private static gamepad3ButtonUp;
  504. private static gamepad3DpadPress;
  505. private static gamepad3DpadDown;
  506. private static gamepad3DpadUp;
  507. private static gamepad3LeftTrigger;
  508. private static gamepad3RightTrigger;
  509. private static gamepad4;
  510. private static gamepad4Type;
  511. private static gamepad4ButtonPress;
  512. private static gamepad4ButtonDown;
  513. private static gamepad4ButtonUp;
  514. private static gamepad4DpadPress;
  515. private static gamepad4DpadDown;
  516. private static gamepad4DpadUp;
  517. private static gamepad4LeftTrigger;
  518. private static gamepad4RightTrigger;
  519. private static debugLayerVisible;
  520. private static tickKeyboardInput;
  521. private static updateUserInput;
  522. private static resetUserInput;
  523. private static resetKeyMapHandler;
  524. private static inputKeyDownHandler;
  525. private static inputKeyUpHandler;
  526. private static inputPointerWheelHandler;
  527. private static inputPointerDownHandler;
  528. private static inputPointerUpHandler;
  529. private static inputPointerMoveHandler;
  530. private static inputVirtualJoysticks;
  531. private static inputOneButtonDownHandler;
  532. private static inputOneButtonUpHandler;
  533. private static inputOneXboxDPadDownHandler;
  534. private static inputOneShockDPadDownHandler;
  535. private static inputOneXboxDPadUpHandler;
  536. private static inputOneShockDPadUpHandler;
  537. private static inputOneXboxLeftTriggerHandler;
  538. private static inputOneXboxRightTriggerHandler;
  539. private static inputOneLeftStickHandler;
  540. private static inputOneRightStickHandler;
  541. private static inputTwoButtonDownHandler;
  542. private static inputTwoButtonUpHandler;
  543. private static inputTwoXboxDPadDownHandler;
  544. private static inputTwoShockDPadDownHandler;
  545. private static inputTwoXboxDPadUpHandler;
  546. private static inputTwoShockDPadUpHandler;
  547. private static inputTwoXboxLeftTriggerHandler;
  548. private static inputTwoXboxRightTriggerHandler;
  549. private static inputTwoLeftStickHandler;
  550. private static inputTwoRightStickHandler;
  551. private static inputThreeButtonDownHandler;
  552. private static inputThreeButtonUpHandler;
  553. private static inputThreeXboxDPadDownHandler;
  554. private static inputThreeShockDPadDownHandler;
  555. private static inputThreeXboxDPadUpHandler;
  556. private static inputThreeShockDPadUpHandler;
  557. private static inputThreeXboxLeftTriggerHandler;
  558. private static inputThreeXboxRightTriggerHandler;
  559. private static inputThreeLeftStickHandler;
  560. private static inputThreeRightStickHandler;
  561. private static inputFourButtonDownHandler;
  562. private static inputFourButtonUpHandler;
  563. private static inputFourXboxDPadDownHandler;
  564. private static inputFourShockDPadDownHandler;
  565. private static inputFourXboxDPadUpHandler;
  566. private static inputFourShockDPadUpHandler;
  567. private static inputFourXboxLeftTriggerHandler;
  568. private static inputFourXboxRightTriggerHandler;
  569. private static inputFourLeftStickHandler;
  570. private static inputFourRightStickHandler;
  571. private static inputManagerGamepadConnected;
  572. private static inputManagerGamepadDisconnected;
  573. private static inputManagerLeftControllerMainButton;
  574. private static inputManagerLeftControllerPadState;
  575. private static inputManagerLeftControllerPadValues;
  576. private static inputManagerLeftControllerAuxButton;
  577. private static inputManagerLeftControllerTriggered;
  578. private static inputManagerRightControllerMainButton;
  579. private static inputManagerRightControllerPadState;
  580. private static inputManagerRightControllerPadValues;
  581. private static inputManagerRightControllerAuxButton;
  582. private static inputManagerRightControllerTriggered;
  583. private static inputManagerControllerConnected;
  584. }
  585. }
  586. /**
  587. * Babylon Scene Manager Alias
  588. */
  589. declare const SM: typeof BABYLON.SceneManager;
  590. declare module BABYLON {
  591. /**
  592. * Babylon metadata parser class (Internal use only)
  593. * @class MetadataParser - All rights reserved (c) 2020 Mackey Kinard
  594. */
  595. class MetadataParser {
  596. private _physicList;
  597. private _shadowList;
  598. private _freezeList;
  599. private _scriptList;
  600. private _babylonScene;
  601. constructor(scene: BABYLON.Scene);
  602. /** Parse the scene component metadata. Note: Internal use only */
  603. parseSceneComponents(entity: BABYLON.TransformNode): void;
  604. /** Post process pending scene components. Note: Internal use only */
  605. postProcessSceneComponents(): void;
  606. private static DoParseSceneComponents;
  607. private static DoProcessPendingScripts;
  608. private static DoProcessPendingShadows;
  609. private static DoProcessPendingPhysics;
  610. private static DoProcessPendingFreezes;
  611. private static SetupCameraComponent;
  612. private static SetupLightComponent;
  613. }
  614. }
  615. /**
  616. * RequestAnimationFrame() Original Shim By: Paul Irish (Internal use only)
  617. * http://paulirish.com/2011/requestanimationframe-for-smart-animating/
  618. * @class TimerPlugin - All rights reserved (c) 2020 Mackey Kinard
  619. */
  620. declare var TimerPlugin: any;
  621. declare module BABYLON {
  622. /**
  623. * Babylon script component class
  624. * @class ScriptComponent - All rights reserved (c) 2020 Mackey Kinard
  625. */
  626. abstract class ScriptComponent {
  627. private _update;
  628. private _late;
  629. private _after;
  630. private _lateUpdate;
  631. private _properties;
  632. private _awoken;
  633. private _started;
  634. private _scene;
  635. private _transform;
  636. private _registeredClassname;
  637. /** Gets the current scene object */
  638. get scene(): BABYLON.Scene;
  639. /** Gets the transform node entity */
  640. get transform(): BABYLON.TransformNode;
  641. constructor(transform: BABYLON.TransformNode, scene: BABYLON.Scene, properties?: any);
  642. /** Sets the script component property bag value */
  643. protected setProperty(name: string, propertyValue: any): void;
  644. /** Gets the script component property bag value */
  645. protected getProperty<T>(name: string, defaultValue?: T): T;
  646. /** Gets the registered script component class name */
  647. getClassName(): string;
  648. /** Get the current time in seconds */
  649. getTime(): number;
  650. /** Get the total game time in seconds */
  651. getGameTime(): number;
  652. /** Get the current delta time in seconds */
  653. getDeltaSeconds(): number;
  654. /** Get the delta time animation ratio multiplier */
  655. getAnimationRatio(): number;
  656. /** Gets the safe transform mesh entity */
  657. getTransformMesh(): BABYLON.Mesh;
  658. /** Gets the safe transform abstract mesh entity */
  659. getAbstractMesh(): BABYLON.AbstractMesh;
  660. /** Gets the safe transform instanced mesh entity */
  661. getInstancedMesh(): BABYLON.InstancedMesh;
  662. /** Gets the transform primitive meshes */
  663. getPrimitiveMeshes(): BABYLON.AbstractMesh[];
  664. /** Get the transform object metedata in the scene. */
  665. getMetadata(): any;
  666. /** Get a script component on the transform with the specfied class name. */
  667. getComponent<T extends BABYLON.ScriptComponent>(klass: string): T;
  668. /** Get all script components on the transform with the specfied class name. */
  669. getComponents<T extends BABYLON.ScriptComponent>(klass: string): T[];
  670. /** Gets the attached transform light rig */
  671. getLightRig(): BABYLON.Light;
  672. /** Gets the attached transform camera rig */
  673. getCameraRig(): BABYLON.FreeCamera;
  674. /** Gets a script component transform primary tag name. */
  675. getTransformTag(): string;
  676. /** Check if the transform has the specified query tag match */
  677. hasTransformTags(query: string): boolean;
  678. /** Get the specfied child transform in the scene. */
  679. getChildNode(name: string, searchType?: BABYLON.SearchType, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  680. /** Get the first child transform with matching tags. */
  681. getChildWithTags(query: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  682. /** Get all child transforms with matching tags. */
  683. getChildrenWithTags(query: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode[];
  684. /** Get the first child transform with the specified script component. */
  685. getChildWithScript(klass: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  686. /** Get all child transforms with the specified script component. */
  687. getChildrenWithScript(klass: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode[];
  688. /** Register handler that is triggered after the scene has rendered and is ready to go */
  689. registerOnSceneReady(func: (eventData: BABYLON.Scene, eventState: BABYLON.EventState) => void): void;
  690. /** Registers an on pick tricgger click action */
  691. registerOnClickAction(func: () => void): BABYLON.IAction;
  692. /** Unregisters an on pick tricgger click action */
  693. unregisterOnClickAction(action: BABYLON.IAction): boolean;
  694. /** Register handler that is triggered after each physics fixed update step */
  695. registerOnFixedUpdate(func: (impostor: BABYLON.PhysicsImpostor) => void): boolean;
  696. /** Unregister observer that is triggered after each physics fixed update step */
  697. unregisterOnFixedUpdate(func: (impostor: BABYLON.PhysicsImpostor) => void): boolean;
  698. /** Register handler that is triggered when the a volume has entered */
  699. onTriggerEnterObservable: Observable<AbstractMesh>;
  700. /** Register handler that is triggered when the a volume contact is active */
  701. onTriggerStayObservable: Observable<AbstractMesh>;
  702. /** Register handler that is triggered when the a volume contact has exited */
  703. onTriggerExitObservable: Observable<AbstractMesh>;
  704. private triggerMesh;
  705. private triggerVolumeList;
  706. useTriggerVolumePrecision: boolean;
  707. includeTriggerVolumeDescendants: boolean;
  708. getTriggerVolumeList(): BABYLON.TriggerVolume[];
  709. resetTriggerVolumeList(): void;
  710. registerTriggerVolume(volume: BABYLON.AbstractMesh): void;
  711. unregisterTriggerVolume(volume: BABYLON.AbstractMesh): void;
  712. private registerComponentInstance;
  713. private destroyComponentInstance;
  714. private static RegisterInstance;
  715. private static UpdateInstance;
  716. private static LateInstance;
  717. private static AfterInstance;
  718. private static DestroyInstance;
  719. private static ParseAutoProperties;
  720. private static UnpackObjectProperty;
  721. }
  722. }
  723. declare module BABYLON {
  724. /**
  725. * Babylon universal shader defines pro class
  726. * @class UniversalShaderDefines - All rights reserved (c) 2020 Mackey Kinard
  727. */
  728. class UniversalShaderDefines {
  729. private _defines;
  730. constructor();
  731. getDefines(): any;
  732. defineBoolean(name: string): void;
  733. defineNumeric(name: string, value: number): void;
  734. static ShaderIndexer: number;
  735. }
  736. /**
  737. * Babylon universal albedo chunks pro class
  738. * @class UniversalAlbedoChunks - All rights reserved (c) 2020 Mackey Kinard
  739. */
  740. class UniversalAlbedoChunks {
  741. constructor();
  742. Vertex_Begin: string;
  743. Vertex_Definitions: string;
  744. Vertex_MainBegin: string;
  745. Vertex_Before_PositionUpdated: string;
  746. Vertex_Before_NormalUpdated: string;
  747. Vertex_After_WorldPosComputed: string;
  748. Vertex_MainEnd: string;
  749. Fragment_Begin: string;
  750. Fragment_Definitions: string;
  751. Fragment_MainBegin: string;
  752. Fragment_Custom_Albedo: string;
  753. Fragment_Custom_Alpha: string;
  754. Fragment_Before_Lights: string;
  755. Fragment_Before_Fog: string;
  756. Fragment_Before_FragColor: string;
  757. Fragment_MetallicRoughness: string;
  758. Fragment_MicroSurface: string;
  759. }
  760. /**
  761. * Babylon universal albedo material pro class
  762. * @class UniversalAlbedoMaterial - All rights reserved (c) 2020 Mackey Kinard
  763. */
  764. class UniversalAlbedoMaterial extends BABYLON.PBRMaterial {
  765. protected universalMaterial: boolean;
  766. protected locals: BABYLON.UniversalShaderDefines;
  767. protected terrainInfo: any;
  768. private _defines;
  769. private _uniforms;
  770. private _samplers;
  771. private _attributes;
  772. private _textures;
  773. private _vectors4;
  774. private _floats;
  775. private _createdShaderName;
  776. protected enableShaderChunks: boolean;
  777. protected materialShaderChunks: BABYLON.UniversalAlbedoChunks;
  778. protected updateShaderChunks(): void;
  779. constructor(name: string, scene: Scene);
  780. getClassName(): string;
  781. getShaderName(): string;
  782. getShaderChunk(): string;
  783. getShaderDefines(): BABYLON.PBRMaterialDefines;
  784. getCustomAttributes(): string[];
  785. getTexture(name: string): BABYLON.Texture;
  786. getVector4(name: string): BABYLON.Vector4;
  787. getFloat(name: string): number;
  788. setTexture(name: string, texture: BABYLON.Texture, initialize?: boolean): BABYLON.UniversalAlbedoMaterial;
  789. setVector4(name: string, value: BABYLON.Vector4, initialize?: boolean): BABYLON.UniversalAlbedoMaterial;
  790. setFloat(name: string, value: number, initialize?: boolean): BABYLON.UniversalAlbedoMaterial;
  791. addAttribute(attributeName: string): void;
  792. checkUniform(uniformName: string): void;
  793. checkSampler(samplerName: string): void;
  794. getAnimatables(): IAnimatable[];
  795. getActiveTextures(): BaseTexture[];
  796. hasTexture(texture: BaseTexture): boolean;
  797. dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;
  798. clone(cloneName: string): BABYLON.UniversalAlbedoMaterial;
  799. serialize(): any;
  800. static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): BABYLON.UniversalAlbedoMaterial;
  801. protected customShaderChunkResolve(): void;
  802. private _buildCustomShader;
  803. private _createShaderChunks;
  804. private _attachAfterBind;
  805. }
  806. /**
  807. * Babylon universal terrain material pro class
  808. * @class UniversalTerrainMaterial
  809. */
  810. class UniversalTerrainMaterial extends BABYLON.UniversalAlbedoMaterial {
  811. constructor(name: string, scene: BABYLON.Scene);
  812. getClassName(): string;
  813. getShaderName(): string;
  814. getShaderChunk(): string;
  815. protected updateShaderChunks(): void;
  816. private formatTerrainVertexDefintions;
  817. private formatTerrainVertexMainEnd;
  818. private formatTerrainFragmentDefintions;
  819. private formatTerrainFragmentUpdateColor;
  820. }
  821. }
  822. declare module BABYLON {
  823. /**
  824. * Babylon system class
  825. * @class System - All rights reserved (c) 2020 Mackey Kinard
  826. */
  827. enum System {
  828. Deg2Rad,
  829. Rad2Deg,
  830. Epsilon = 0.00001,
  831. EpsilonNormalSqrt = 1e-15,
  832. Kph2Mph = 0.621371,
  833. Mph2Kph = 1.60934,
  834. Mps2Kph = 3.6,
  835. Meter2Inch = 39.3701,
  836. Inch2Meter = 0.0254,
  837. Gravity = 9.81,
  838. Gravity3G = 29.400000000000002,
  839. SkidFactor = 0.25,
  840. MaxInteger = 2147483647,
  841. WalkingVelocity = 4.4,
  842. TerminalVelocity = 55,
  843. SmoothDeltaFactor = 0.2,
  844. ToLinearSpace = 2.2,
  845. ToGammaSpace = 0.45454545454545453
  846. }
  847. enum Handedness {
  848. Default = -1,
  849. Right = 0,
  850. Left = 1
  851. }
  852. enum SearchType {
  853. ExactMatch = 0,
  854. StartsWith = 1,
  855. EndsWith = 2,
  856. IndexOf = 3
  857. }
  858. enum PlayerNumber {
  859. Auto = 0,
  860. One = 1,
  861. Two = 2,
  862. Three = 3,
  863. Four = 4
  864. }
  865. enum PlayerControl {
  866. FirstPerson = 0,
  867. ThirdPerson = 1
  868. }
  869. enum RenderQuality {
  870. High = 0,
  871. Medium = 1,
  872. Low = 2
  873. }
  874. enum GamepadType {
  875. None = -1,
  876. Generic = 0,
  877. Xbox360 = 1,
  878. DualShock = 2,
  879. PoseController = 3
  880. }
  881. enum JoystickButton {
  882. Left = 0,
  883. Right = 1
  884. }
  885. enum Xbox360Trigger {
  886. Left = 0,
  887. Right = 1
  888. }
  889. enum MovementType {
  890. DirectVelocity = 0,
  891. AppliedForces = 1
  892. }
  893. enum CollisionContact {
  894. Top = 0,
  895. Left = 1,
  896. Right = 2,
  897. Bottom = 3
  898. }
  899. enum IntersectionPrecision {
  900. AABB = 0,
  901. OBB = 1
  902. }
  903. enum CollisionFilters {
  904. DefaultFilter = 1,
  905. StaticFilter = 2,
  906. KinematicFilter = 4,
  907. DebrisFilter = 8,
  908. SensorTrigger = 16,
  909. CharacterFilter = 32,
  910. GroundFilter = 64,
  911. AllFilter = -1
  912. }
  913. enum CollisionState {
  914. ACTIVE_TAG = 1,
  915. ISLAND_SLEEPING = 2,
  916. WANTS_DEACTIVATION = 3,
  917. DISABLE_DEACTIVATION = 4,
  918. DISABLE_SIMULATION = 5
  919. }
  920. enum CollisionFlags {
  921. CF_STATIC_OBJECT = 1,
  922. CF_KINEMATIC_OBJECT = 2,
  923. CF_NO_CONTACT_RESPONSE = 4,
  924. CF_CUSTOM_MATERIAL_CALLBACK = 8,
  925. CF_CHARACTER_OBJECT = 16,
  926. CF_DISABLE_VISUALIZE_OBJECT = 32,
  927. CF_DISABLE_SPU_COLLISION_PROCESSING = 64,
  928. CF_HAS_CONTACT_STIFFNESS_DAMPING = 128,
  929. CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR = 256,
  930. CF_HAS_FRICTION_ANCHOR = 512,
  931. CF_HAS_COLLISION_SOUND_TRIGGER = 1024
  932. }
  933. enum UserInputPointer {
  934. Left = 0,
  935. Middle = 1,
  936. Right = 2
  937. }
  938. enum UserInputAxis {
  939. Horizontal = 0,
  940. Vertical = 1,
  941. ClientX = 2,
  942. ClientY = 3,
  943. MouseX = 4,
  944. MouseY = 5,
  945. Wheel = 6
  946. }
  947. enum UserInputKey {
  948. BackSpace = 8,
  949. Tab = 9,
  950. Enter = 13,
  951. Shift = 16,
  952. Ctrl = 17,
  953. Alt = 18,
  954. Pause = 19,
  955. Break = 19,
  956. CapsLock = 20,
  957. Escape = 27,
  958. SpaceBar = 32,
  959. PageUp = 33,
  960. PageDown = 34,
  961. End = 35,
  962. Home = 36,
  963. LeftArrow = 37,
  964. UpArrow = 38,
  965. RightArrow = 39,
  966. DownArrow = 40,
  967. Insert = 45,
  968. Delete = 46,
  969. Num0 = 48,
  970. Num1 = 49,
  971. Num2 = 50,
  972. Num3 = 51,
  973. Num4 = 52,
  974. Num5 = 53,
  975. Num6 = 54,
  976. Num7 = 55,
  977. Num8 = 56,
  978. Num9 = 57,
  979. A = 65,
  980. B = 66,
  981. C = 67,
  982. D = 68,
  983. E = 69,
  984. F = 70,
  985. G = 71,
  986. H = 72,
  987. I = 73,
  988. J = 74,
  989. K = 75,
  990. L = 76,
  991. M = 77,
  992. N = 78,
  993. O = 79,
  994. P = 80,
  995. Q = 81,
  996. R = 82,
  997. S = 83,
  998. T = 84,
  999. U = 85,
  1000. V = 86,
  1001. W = 87,
  1002. X = 88,
  1003. Y = 89,
  1004. Z = 90,
  1005. LeftWindowKey = 91,
  1006. RightWindowKey = 92,
  1007. SelectKey = 93,
  1008. Numpad0 = 96,
  1009. Numpad1 = 97,
  1010. Numpad2 = 98,
  1011. Numpad3 = 99,
  1012. Numpad4 = 100,
  1013. Numpad5 = 101,
  1014. Numpad6 = 102,
  1015. Numpad7 = 103,
  1016. Numpad8 = 104,
  1017. Numpad9 = 105,
  1018. Multiply = 106,
  1019. Add = 107,
  1020. Subtract = 109,
  1021. DecimalPoint = 110,
  1022. Divide = 111,
  1023. F1 = 112,
  1024. F2 = 113,
  1025. F3 = 114,
  1026. F4 = 115,
  1027. F5 = 116,
  1028. F6 = 117,
  1029. F7 = 118,
  1030. F8 = 119,
  1031. F9 = 120,
  1032. F10 = 121,
  1033. F11 = 122,
  1034. F12 = 123,
  1035. NumLock = 144,
  1036. ScrollLock = 145,
  1037. SemiColon = 186,
  1038. EqualSign = 187,
  1039. Comma = 188,
  1040. Dash = 189,
  1041. Period = 190,
  1042. ForwardSlash = 191,
  1043. GraveAccent = 192,
  1044. OpenBracket = 219,
  1045. BackSlash = 220,
  1046. CloseBraket = 221,
  1047. SingleQuote = 222
  1048. }
  1049. interface UserInputPress {
  1050. index: number;
  1051. action: () => void;
  1052. }
  1053. type UserInputAction = (index: number) => void;
  1054. class UserInputOptions {
  1055. static KeyboardSmoothing: boolean;
  1056. static KeyboardMoveSensibility: number;
  1057. static KeyboardMoveDeadZone: number;
  1058. static GamepadDeadStickValue: number;
  1059. static GamepadLStickXInverted: boolean;
  1060. static GamepadLStickYInverted: boolean;
  1061. static GamepadRStickXInverted: boolean;
  1062. static GamepadRStickYInverted: boolean;
  1063. static GamepadLStickSensibility: number;
  1064. static GamepadRStickSensibility: number;
  1065. static JoystickRightHandleColor: string;
  1066. static JoystickLeftSensibility: number;
  1067. static JoystickRightSensibility: number;
  1068. static JoystickDeadStickValue: number;
  1069. static PointerAngularSensibility: number;
  1070. static PointerWheelDeadZone: number;
  1071. static PointerMouseDeadZone: number;
  1072. static UseArrowKeyRotation: boolean;
  1073. static UseCanvasElement: boolean;
  1074. }
  1075. /**
  1076. * Unity Export Interfaces
  1077. */
  1078. interface IUnityTransform {
  1079. type: string;
  1080. id: string;
  1081. tag: string;
  1082. name: string;
  1083. layer: number;
  1084. }
  1085. interface IUnityCurve {
  1086. type: string;
  1087. length: number;
  1088. prewrapmode: string;
  1089. postwrapmode: string;
  1090. animation: any;
  1091. }
  1092. interface IUnityMaterial {
  1093. type: string;
  1094. id: string;
  1095. name: string;
  1096. shader: string;
  1097. gltf: number;
  1098. }
  1099. interface IUnityTexture {
  1100. type: string;
  1101. name: string;
  1102. width: number;
  1103. height: number;
  1104. filename: string;
  1105. wrapmode: string;
  1106. filtermode: string;
  1107. anisolevel: number;
  1108. }
  1109. interface IUnityCubemap {
  1110. type: string;
  1111. name: string;
  1112. info: any;
  1113. width: number;
  1114. height: number;
  1115. filename: string;
  1116. extension: string;
  1117. wrapmode: string;
  1118. filtermode: string;
  1119. anisolevel: number;
  1120. texelsizex: number;
  1121. texelsizey: number;
  1122. dimension: number;
  1123. format: number;
  1124. mipmapbias: number;
  1125. mipmapcount: number;
  1126. }
  1127. interface IUnityAudioClip {
  1128. type: string;
  1129. name: string;
  1130. filename: string;
  1131. length: number;
  1132. channels: number;
  1133. frequency: number;
  1134. samples: number;
  1135. }
  1136. interface IUnityVideoClip {
  1137. type: string;
  1138. name: string;
  1139. filename: string;
  1140. length: number;
  1141. width: number;
  1142. height: number;
  1143. framerate: number;
  1144. framecount: number;
  1145. audiotracks: number;
  1146. }
  1147. interface IUnityFontAsset {
  1148. type: string;
  1149. filename: string;
  1150. format: string;
  1151. }
  1152. interface IUnityTextAsset {
  1153. type: string;
  1154. filename: string;
  1155. base64: string;
  1156. }
  1157. interface IUnityDefaultAsset {
  1158. type: string;
  1159. filename: string;
  1160. base64: string;
  1161. }
  1162. interface IUnityVector2 {
  1163. x: number;
  1164. y: number;
  1165. }
  1166. interface IUnityVector3 {
  1167. x: number;
  1168. y: number;
  1169. z: number;
  1170. }
  1171. interface IUnityVector4 {
  1172. x: number;
  1173. y: number;
  1174. z: number;
  1175. w: number;
  1176. }
  1177. interface IUnityColor {
  1178. r: number;
  1179. g: number;
  1180. b: number;
  1181. a: number;
  1182. }
  1183. /**
  1184. * Trigger Volume State
  1185. * @class TriggerVolume - All rights reserved (c) 2020 Mackey Kinard
  1186. */
  1187. class TriggerVolume {
  1188. mesh: BABYLON.AbstractMesh;
  1189. state: number;
  1190. }
  1191. /**
  1192. * Event Message Bus (Use Static Singleton Pattern)
  1193. * @class EventMessageBus - All rights reserved (c) 2020 Mackey Kinard
  1194. */
  1195. class EventMessageBus {
  1196. AddListener<T>(messageName: string, handler: (data: T) => void): void;
  1197. RemoveListener(messageName: string, handler: (data: any) => void): void;
  1198. RaiseMessage(messageName: string, data?: any): void;
  1199. private ListenerDictionary;
  1200. }
  1201. /**
  1202. * Prefab Object Pool (Use Static Singleton Pattern)
  1203. * @class PrefabObjectPool - All rights reserved (c) 2020 Mackey Kinard
  1204. */
  1205. class PrefabObjectPool {
  1206. private assetContainer;
  1207. private prefabName;
  1208. private makeNewMaterials;
  1209. private cloneAnimations;
  1210. constructor(container: BABYLON.AssetContainer, prefabName: string, makeNewMaterials?: boolean, cloneAnimations?: boolean);
  1211. /** Get a prefab instance from the object pool or create a new one if none available */
  1212. GetInstance(position?: BABYLON.Vector3, rotation?: BABYLON.Quaternion): BABYLON.TransformNode;
  1213. /** Return the prefab instance to the available object pool state */
  1214. ReturnInstance(instance: BABYLON.TransformNode): void;
  1215. /** Pre populate the prefab object pool by the specified count */
  1216. PrePopulatePool(count: number): void;
  1217. private AvailableInstances;
  1218. private CreateNewInstance;
  1219. }
  1220. /**
  1221. * Physics Raycast Classes
  1222. * @class RaycastHitResult - All rights reserved (c) 2020 Mackey Kinard
  1223. */
  1224. class RaycastHitResult {
  1225. private _hit;
  1226. private _dest;
  1227. private _origin;
  1228. private _hitPoint;
  1229. private _hitNormal;
  1230. private _hitDistance;
  1231. private _collisionObject;
  1232. get hasHit(): boolean;
  1233. get hitPoint(): BABYLON.Vector3;
  1234. get hitNormal(): BABYLON.Vector3;
  1235. get hitDistance(): number;
  1236. get collisionObject(): any;
  1237. get rayDestination(): BABYLON.Vector3;
  1238. get rayOrigin(): BABYLON.Vector3;
  1239. constructor();
  1240. reset(origin: BABYLON.Vector3, destination: BABYLON.Vector3): void;
  1241. update(hit: boolean, pointX: number, pointY: number, pointZ: number, normalX: number, normalY: number, normalZ: number, collisionObject?: any): void;
  1242. }
  1243. /**
  1244. * Lines Mesh Render Classes
  1245. * @class LinesMeshRenderer - All rights reserved (c) 2020 Mackey Kinard
  1246. */
  1247. class LinesMeshRenderer {
  1248. private _numPoints;
  1249. private _pointMesh;
  1250. private _pointSize;
  1251. private _pointType;
  1252. private _linesName;
  1253. private _linesMesh;
  1254. private _babylonScene;
  1255. get pointMesh(): BABYLON.Mesh;
  1256. get linesMesh(): BABYLON.LinesMesh;
  1257. constructor(name: string, scene: BABYLON.Scene, pointType?: number, pointSize?: number);
  1258. dispose(doNotRecurse?: boolean): void;
  1259. hidePoint(hide?: boolean): void;
  1260. drawPoint(position: BABYLON.Vector3): void;
  1261. drawLine(points: BABYLON.Vector3[], color?: BABYLON.Color3): void;
  1262. }
  1263. /**
  1264. * Babylon Utility Classes
  1265. * @class Utilities - All rights reserved (c) 2020 Mackey Kinard
  1266. */
  1267. class Utilities {
  1268. private static UpVector;
  1269. private static AuxVector;
  1270. private static ZeroVector;
  1271. private static TempMatrix;
  1272. private static TempVector2;
  1273. private static TempVector3;
  1274. private static TempQuaternion;
  1275. private static PrintElement;
  1276. private static LoadingState;
  1277. static IsLayerMasked(mask: number, layer: number): boolean;
  1278. static GetLoadingState(): number;
  1279. static MoveTowardsVector2(current: BABYLON.Vector2, target: BABYLON.Vector2, maxDelta: number): BABYLON.Vector2;
  1280. static MoveTowardsVector2ToRef(current: BABYLON.Vector2, target: BABYLON.Vector2, maxDelta: number, result: BABYLON.Vector2): void;
  1281. static MoveTowardsVector3(current: BABYLON.Vector3, target: BABYLON.Vector3, maxDelta: number): BABYLON.Vector3;
  1282. static MoveTowardsVector3ToRef(current: BABYLON.Vector3, target: BABYLON.Vector3, maxDelta: number, result: BABYLON.Vector3): void;
  1283. static MoveTowardsVector4(current: BABYLON.Vector4, target: BABYLON.Vector4, maxDelta: number): BABYLON.Vector4;
  1284. static MoveTowardsVector4ToRef(current: BABYLON.Vector4, target: BABYLON.Vector4, maxDelta: number, result: BABYLON.Vector4): void;
  1285. /** Clamps a vector2 magnitude to a max length. */
  1286. static ClampMagnitudeVector2(vector: BABYLON.Vector2, length: number): BABYLON.Vector2;
  1287. /** Clamps a vector2 magnitude to a max length. */
  1288. static ClampMagnitudeVector2ToRef(vector: BABYLON.Vector2, length: number, result: BABYLON.Vector2): void;
  1289. /** Clamps a vector3 magnitude to a max length. */
  1290. static ClampMagnitudeVector3(vector: BABYLON.Vector3, length: number): BABYLON.Vector3;
  1291. /** Clamps a vector3 magnitude to a max length. */
  1292. static ClampMagnitudeVector3ToRef(vector: BABYLON.Vector3, length: number, result: BABYLON.Vector3): void;
  1293. /** Zero pad a number to string */
  1294. static ZeroPad(num: number, places: number): string;
  1295. /** TODO */
  1296. static LerpLog(a: number, b: number, t: number): number;
  1297. /** TODO */
  1298. static LerpExp(a: number, b: number, t: number): number;
  1299. static LerpClamp(a: number, b: number, t: number): number;
  1300. /** TODO */
  1301. static LerpUnclamp(a: number, b: number, t: number): number;
  1302. /** Returns the angle in degrees between the from and to vectors. */
  1303. static GetAngle(from: BABYLON.Vector3, to: BABYLON.Vector3): number;
  1304. /** TODO */
  1305. static ClampAngle(angle: number, min: number, max: number): number;
  1306. /** Gradually changes a number towards a desired goal over time. (Note: Uses currentVelocity.x as output variable) */
  1307. static SmoothDamp(current: number, target: number, smoothTime: number, maxSpeed: number, deltaTime: number, currentVelocity: BABYLON.Vector2): number;
  1308. /** Gradually changes an angle given in degrees towards a desired goal angle over time. (Note: Uses currentVelocity.x as output variable) */
  1309. static SmoothDampAngle(current: number, target: number, smoothTime: number, maxSpeed: number, deltaTime: number, currentVelocity: BABYLON.Vector2): number;
  1310. /** Gradually changes a vector towards a desired goal over time. (Note: Uses currentVelocity.xy as output variable) */
  1311. static SmoothDampVector2(current: BABYLON.Vector2, target: BABYLON.Vector2, smoothTime: number, maxSpeed: number, deltaTime: number, currentVelocity: BABYLON.Vector2): BABYLON.Vector2;
  1312. /** Gradually changes a vector result towards a desired goal over time. (Note: Uses currentVelocity.xy as output variable) */
  1313. static SmoothDampVector2ToRef(current: BABYLON.Vector2, target: BABYLON.Vector2, smoothTime: number, maxSpeed: number, deltaTime: number, currentVelocity: BABYLON.Vector2, result: BABYLON.Vector2): void;
  1314. /** Gradually changes a vector towards a desired goal over time. (Note: Uses currentVelocity.xyz as output variable) */
  1315. static SmoothDampVector3(current: BABYLON.Vector3, target: BABYLON.Vector3, smoothTime: number, maxSpeed: number, deltaTime: number, currentVelocity: BABYLON.Vector3): BABYLON.Vector3;
  1316. /** Gradually changes a vector result towards a desired goal over time. (Note: Uses currentVelocity.xyz as output variable) */
  1317. static SmoothDampVector3ToRef(current: BABYLON.Vector3, target: BABYLON.Vector3, smoothTime: number, maxSpeed: number, deltaTime: number, currentVelocity: BABYLON.Vector3, result: BABYLON.Vector3): void;
  1318. /** Returns a new Matrix as a rotation matrix from the Euler angles in degrees (x, y, z). */
  1319. static ToMatrix(x: number, y: number, z: number): BABYLON.Matrix;
  1320. /** Sets a Matrix result as a rotation matrix from the Euler angles in degrees (x, y, z). */
  1321. static ToMatrixToRef(x: number, y: number, z: number, result: BABYLON.Matrix): void;
  1322. /** Set the passed matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue". */
  1323. static FastMatrixLerp(startValue: BABYLON.Matrix, endValue: BABYLON.Matrix, gradient: number, result: BABYLON.Matrix): void;
  1324. /** Set the passed matrix "result" as the spherical interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue". */
  1325. static FastMatrixSlerp(startValue: BABYLON.Matrix, endValue: BABYLON.Matrix, gradient: number, result: BABYLON.Matrix): void;
  1326. /** Returns a new Vector Euler in degress set from the passed qauternion. */
  1327. static ToEuler(quaternion: BABYLON.Quaternion): BABYLON.Vector3;
  1328. /** Sets a Vector Euler result in degress set from the passed qauternion. */
  1329. static ToEulerToRef(quaternion: BABYLON.Quaternion, result: BABYLON.Vector3): void;
  1330. /** Returns a new Quaternion set from the passed Euler float angles in degrees (x, y, z). */
  1331. static FromEuler(x: number, y: number, z: number): BABYLON.Quaternion;
  1332. /** Sets a Quaternion result set from the passed Euler float angles in degrees (x, y, z). */
  1333. static FromEulerToRef(x: number, y: number, z: number, result: BABYLON.Quaternion): void;
  1334. /** Computes the difference in quaternion values */
  1335. static QuaternionDiff(value1: BABYLON.Quaternion, value2: BABYLON.Quaternion): BABYLON.Quaternion;
  1336. /** Computes the difference in quaternion values to a result value */
  1337. static QuaternionDiffToRef(value1: BABYLON.Quaternion, value2: BABYLON.Quaternion, result: BABYLON.Quaternion): void;
  1338. /** Multplies a quaternion by a vector (rotates vector) */
  1339. static RotateVector(vec: BABYLON.Vector3, quat: BABYLON.Quaternion): BABYLON.Vector3;
  1340. /** Multplies a quaternion by a vector (rotates vector) */
  1341. static RotateVectorToRef(vec: BABYLON.Vector3, quat: BABYLON.Quaternion, result: BABYLON.Vector3): void;
  1342. /** Returns a new Quaternion set from the passed vector direction. */
  1343. static LookRotation(direction: BABYLON.Vector3): BABYLON.Quaternion;
  1344. /** Returns a new Quaternion set from the passed vector direction. */
  1345. static LookRotationToRef(direction: BABYLON.Vector3, result: BABYLON.Quaternion): void;
  1346. /** Returns a new vector3 degrees converted from radions */
  1347. static Vector3Rad2Deg(vector: BABYLON.Vector3): BABYLON.Vector3;
  1348. /** Sets a vector3 result degrees converted from radions */
  1349. static Vector3Rad2DegToRef(vector: BABYLON.Vector3, result: BABYLON.Vector3): void;
  1350. /** Multiply the quaternion by a vector */
  1351. static MultiplyQuaternionByVector(quaternion: BABYLON.Quaternion, vector: BABYLON.Vector3): BABYLON.Vector3;
  1352. /** Multiply the quaternion by a vector to result */
  1353. static MultiplyQuaternionByVectorToRef(quaternion: BABYLON.Quaternion, vector: BABYLON.Vector3, result: BABYLON.Vector3): void;
  1354. /** Validate and switch Quaternion rotation to Euler rotation. */
  1355. static ValidateTransformRotation(transform: BABYLON.TransformNode): void;
  1356. /** Validate and switch Euler rotation to Quaternion rotation. */
  1357. static ValidateTransformQuaternion(transform: BABYLON.TransformNode): void;
  1358. /** Get the smoothed keyboard input value */
  1359. static GetKeyboardInputValue(scene: BABYLON.Scene, currentValue: number, targetValue: number): number;
  1360. /** TODO */
  1361. static DownloadEnvironment(cubemap: BABYLON.CubeTexture, success?: () => void, failure?: () => void): void;
  1362. static HasOwnProperty(object: any, property: string): boolean;
  1363. static GetFilenameFromUrl(url: string): string;
  1364. static GetUrlParameter(key: string): string;
  1365. static CreateFontFace(scene: BABYLON.Scene, family: string, asset: BABYLON.IUnityFontAsset, descriptors?: FontFaceDescriptors, oncomplete?: (fontFace: FontFace) => void): FontFace;
  1366. static CreateFontFaceElement(scene: BABYLON.Scene, family: string, asset: BABYLON.IUnityFontAsset, options?: string): HTMLStyleElement;
  1367. /** TODO */
  1368. static PrintToScreen(text: string, color?: string): void;
  1369. private static TmpHullMatrix;
  1370. private static TmpAmmoVectorA;
  1371. private static TmpAmmoVectorB;
  1372. private static TmpAmmoVectorC;
  1373. private static TmpAmmoVectorD;
  1374. private static TmpAmmoNormalA;
  1375. private static TmpAmmoNormalB;
  1376. private static TmpAmmoNormalC;
  1377. static AddMeshVerts(btTriangleMesh: any, topLevelObject: BABYLON.IPhysicsEnabledObject, object: BABYLON.IPhysicsEnabledObject, scaling?: boolean, normals?: boolean): number;
  1378. static AddHullVerts(btConvexHullShape: any, topLevelObject: BABYLON.IPhysicsEnabledObject, object: BABYLON.IPhysicsEnabledObject, scaling?: boolean): number;
  1379. static CreateImpostorCustomShape(scene: BABYLON.Scene, impostor: BABYLON.PhysicsImpostor, type: number, showDebugColliders?: boolean, colliderVisibility?: number): any;
  1380. static ShowDebugColliders(): boolean;
  1381. static ColliderVisibility(): number;
  1382. static CollisionWireframe(): boolean;
  1383. static GetColliderMaterial(scene: BABYLON.Scene): BABYLON.Material;
  1384. /** TODO */
  1385. static GetDirectTargetAngle(transform: BABYLON.TransformNode, worldSpaceTarget: BABYLON.Vector3): number;
  1386. /** TODO */
  1387. static GetSmoothTargetAngle(transform: BABYLON.TransformNode, worldSpaceTarget: BABYLON.Vector3): number;
  1388. /** TODO */
  1389. static CalculatCatmullRom(p0: BABYLON.Vector3, p1: BABYLON.Vector3, p2: BABYLON.Vector3, p3: BABYLON.Vector3, i: number): BABYLON.Vector3;
  1390. /** TODO */
  1391. static CalculatCatmullRomToRef(p0: BABYLON.Vector3, p1: BABYLON.Vector3, p2: BABYLON.Vector3, p3: BABYLON.Vector3, i: number, result: BABYLON.Vector3): void;
  1392. /** TODO */
  1393. static StartsWith(source: string, word: string): boolean;
  1394. /** TODO */
  1395. static EndsWith(source: string, word: string): boolean;
  1396. /** TODO */
  1397. static ReplaceAll(source: string, word: string, replace: string): string;
  1398. /** TODO */
  1399. static IsNullOrEmpty(source: string): boolean;
  1400. /** TODO */
  1401. static SafeStringPush(array: string[], value: string): void;
  1402. /** TODO */
  1403. static ParseColor3(source: BABYLON.IUnityColor, defaultValue?: BABYLON.Color3, toLinearSpace?: boolean): BABYLON.Color3;
  1404. /** TODO */
  1405. static ParseColor4(source: BABYLON.IUnityColor, defaultValue?: BABYLON.Color4, toLinearSpace?: boolean): BABYLON.Color4;
  1406. /** TODO */
  1407. static ParseVector2(source: BABYLON.IUnityVector2, defaultValue?: BABYLON.Vector2): BABYLON.Vector2;
  1408. /** TODO */
  1409. static ParseVector3(source: BABYLON.IUnityVector3, defaultValue?: BABYLON.Vector3): BABYLON.Vector3;
  1410. /** TODO */
  1411. static ParseVector4(source: BABYLON.IUnityVector4, defaultValue?: BABYLON.Vector4): BABYLON.Vector4;
  1412. /** TODO */
  1413. static ParseSound(source: BABYLON.IUnityAudioClip, scene: BABYLON.Scene, name: string, callback?: Nullable<() => void>, options?: BABYLON.ISoundOptions): BABYLON.Sound;
  1414. /** TODO */
  1415. static ParseTexture(source: BABYLON.IUnityTexture, scene: BABYLON.Scene, noMipmap?: boolean, invertY?: boolean, samplingMode?: number, onLoad?: Nullable<() => void>, onError?: Nullable<(message?: string, exception?: any) => void>, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob>, deleteBuffer?: boolean, format?: number): BABYLON.Texture;
  1416. static ParseCubemap(source: BABYLON.IUnityCubemap, scene: BABYLON.Scene): BABYLON.CubeTexture;
  1417. /** TODO */
  1418. static ParseTextAsset(source: BABYLON.IUnityTextAsset, defaultValue?: string): string;
  1419. /** TODO */
  1420. static ParseJsonAsset<T>(source: BABYLON.IUnityTextAsset, defaultValue?: string, reviver?: (this: any, key: string, value: any) => any): T;
  1421. /** TODO */
  1422. static ParseTransformByID(source: BABYLON.IUnityTransform, scene: BABYLON.Scene, defaultValue?: BABYLON.TransformNode): BABYLON.TransformNode;
  1423. static ParseTransformByName(source: BABYLON.IUnityTransform, scene: BABYLON.Scene, defaultValue?: BABYLON.TransformNode): BABYLON.TransformNode;
  1424. /** TODO */
  1425. static ParseChildTransform(parent: BABYLON.TransformNode, source: BABYLON.IUnityTransform, defaultValue?: BABYLON.TransformNode): BABYLON.TransformNode;
  1426. /** Gets the transform node abosulte position */
  1427. static GetAbsolutePosition(transform: BABYLON.TransformNode, offsetPosition?: BABYLON.Vector3, computeMatrix?: boolean): BABYLON.Vector3;
  1428. /** Gets the transform node abosulte position */
  1429. static GetAbsolutePositionToRef(transform: BABYLON.TransformNode, result: BABYLON.Vector3, offsetPosition?: BABYLON.Vector3, computeMatrix?: boolean): void;
  1430. /** Transforms position from local space to world space. (Using TransformCoordinates) */
  1431. static TransformPoint(owner: BABYLON.TransformNode | BABYLON.Camera, position: BABYLON.Vector3, computeMatrix?: boolean): BABYLON.Vector3;
  1432. /** Inverse transforms position from world space to local space. (Using TransformCoordinates) */
  1433. static InverseTransformPoint(owner: BABYLON.TransformNode | BABYLON.Camera, position: BABYLON.Vector3, computeMatrix?: boolean): BABYLON.Vector3;
  1434. /** Transforms position from local space to world space. (Using TransformCoordinates) */
  1435. static TransformPointToRef(owner: BABYLON.TransformNode | BABYLON.Camera, position: BABYLON.Vector3, result: BABYLON.Vector3, computeMatrix?: boolean): void;
  1436. /** Inverse transforms position from world space to local space. (Using TransformCoordinates) */
  1437. static InverseTransformPointToRef(owner: BABYLON.TransformNode | BABYLON.Camera, position: BABYLON.Vector3, result: BABYLON.Vector3, computeMatrix?: boolean): void;
  1438. /** Transforms direction from local space to world space. (Using TransformNormal) */
  1439. static TransformDirection(owner: BABYLON.TransformNode | BABYLON.Camera, direction: BABYLON.Vector3, computeMatrix?: boolean): BABYLON.Vector3;
  1440. /** Inverse transforms direction from world space to local space. (Using TransformNormal) */
  1441. static InverseTransformDirection(owner: BABYLON.TransformNode | BABYLON.Camera, direction: BABYLON.Vector3, computeMatrix?: boolean): BABYLON.Vector3;
  1442. /** Transforms direction from local space to world space. (Using TransformNormal) */
  1443. static TransformDirectionToRef(owner: BABYLON.TransformNode | BABYLON.Camera, direction: BABYLON.Vector3, result: BABYLON.Vector3, computeMatrix?: boolean): void;
  1444. /** Inverse transforms direction from world space to local space. (Using TransformNormal) */
  1445. static InverseTransformDirectionToRef(owner: BABYLON.TransformNode | BABYLON.Camera, direction: BABYLON.Vector3, result: BABYLON.Vector3, computeMatrix?: boolean): void;
  1446. /** Recomputes the meshes bounding center pivot point */
  1447. static RecomputeCenterPivotPoint(owner: BABYLON.AbstractMesh): void;
  1448. /** Gets any direction vector of the owner in world space. */
  1449. static GetDirectionVector(owner: BABYLON.TransformNode | BABYLON.Camera, vector: BABYLON.Vector3): BABYLON.Vector3;
  1450. /** Gets any direction vector of the owner in world space. */
  1451. static GetDirectionVectorToRef(owner: BABYLON.TransformNode | BABYLON.Camera, vector: BABYLON.Vector3, result: BABYLON.Vector3): void;
  1452. /** Gets the blue axis of the owner in world space. */
  1453. static GetForwardVector(owner: BABYLON.TransformNode | BABYLON.Camera): BABYLON.Vector3;
  1454. /** Gets the blue axis of the owner in world space. */
  1455. static GetForwardVectorToRef(owner: BABYLON.TransformNode | BABYLON.Camera, result: BABYLON.Vector3): void;
  1456. /** Gets the red axis of the owner in world space. */
  1457. static GetRightVector(owner: BABYLON.TransformNode | BABYLON.Camera): BABYLON.Vector3;
  1458. /** Gets the red axis of the owner in world space. */
  1459. static GetRightVectorToRef(owner: BABYLON.TransformNode | BABYLON.Camera, result: BABYLON.Vector3): void;
  1460. /** Gets the green axis of the owner in world space. */
  1461. static GetUpVector(owner: BABYLON.TransformNode | BABYLON.Camera): BABYLON.Vector3;
  1462. /** Gets the green axis of the owner in world space. */
  1463. static GetUpVectorToRef(owner: BABYLON.TransformNode | BABYLON.Camera, result: BABYLON.Vector3): void;
  1464. /** Blend float buffer values */
  1465. static BlendFloatValue(source: number, value: number, weight: number): number;
  1466. /** Blend vector2 buffer values */
  1467. static BlendVector2Value(source: BABYLON.Vector2, value: BABYLON.Vector2, weight: number): void;
  1468. /** Blend vector3 buffer values */
  1469. static BlendVector3Value(source: BABYLON.Vector3, value: BABYLON.Vector3, weight: number): void;
  1470. /** Blend quaternion buffer values */
  1471. static BlendQuaternionValue(source: BABYLON.Quaternion, value: BABYLON.Quaternion, weight: number): void;
  1472. /** Set animation target property */
  1473. static SetAnimationTargetProperty(animation: BABYLON.Animation, property: string): void;
  1474. /** Gets the float "result" as the sampled key frame value for the specfied animation track. */
  1475. static SampleAnimationFloat(animation: BABYLON.Animation, time: number): number;
  1476. /** Set the passed vector2 "result" as the sampled key frame value for the specfied animation track. */
  1477. static SampleAnimationVector2(animation: BABYLON.Animation, time: number): BABYLON.Vector2;
  1478. /** Set the passed vector3 "result" as the sampled key frame value for the specfied animation track. */
  1479. static SampleAnimationVector3(animation: BABYLON.Animation, time: number): BABYLON.Vector3;
  1480. /** Set the passed quaternion "result" as the sampled key frame value for the specfied animation track. */
  1481. static SampleAnimationQuaternion(animation: BABYLON.Animation, time: number): BABYLON.Quaternion;
  1482. /** Set the passed matrix "result" as the sampled key frame value for the specfied animation track. */
  1483. static SampleAnimationMatrix(animation: BABYLON.Animation, time: number): BABYLON.Matrix;
  1484. /** Creates a targeted float animation for tweening. */
  1485. static CreateTweenAnimation(name: string, targetProperty: string, startValue: number, endValue: number, frameRate?: number, loopMode?: number): BABYLON.Animation;
  1486. /** Gets the last key frame index value. */
  1487. static GetLastKeyFrameIndex(animation: BABYLON.Animation): number;
  1488. /** Private internal frame interpolation helper */
  1489. private static InterpolateAnimation;
  1490. /** Initialize default shader material properties */
  1491. static InitializeShaderMaterial(material: BABYLON.ShaderMaterial, binding?: boolean): void;
  1492. /** Transforms position from world space into screen space. */
  1493. static WorldToScreenPoint(scene: BABYLON.Scene, position: BABYLON.Vector3, camera?: BABYLON.Camera): BABYLON.Vector3;
  1494. /** Transforms a point from screen space into world space. */
  1495. static ScreenToWorldPoint(scene: BABYLON.Scene, position: BABYLON.Vector3): BABYLON.Vector3;
  1496. /** TODO */
  1497. static ConvertAmmoVector3(btVector: any): BABYLON.Vector3;
  1498. /** TODO */
  1499. static ConvertAmmoVector3ToRef(btVector: any, result: BABYLON.Vector3): void;
  1500. /** TODO */
  1501. static ConvertAmmoQuaternion(btVector: any): BABYLON.Quaternion;
  1502. /** TODO */
  1503. static ConvertAmmoQuaternionToRef(btQuaternion: any, result: BABYLON.Quaternion): void;
  1504. static CloneSkeletonPrefab(scene: BABYLON.Scene, skeleton: BABYLON.Skeleton, name: string, id?: string, root?: BABYLON.TransformNode): BABYLON.Skeleton;
  1505. /** Get all loaded scene transform nodes. */
  1506. static GetSceneTransforms(scene: BABYLON.Scene): BABYLON.TransformNode[];
  1507. /** Parse scene component metadata. */
  1508. static ParseSceneComponents(scene: BABYLON.Scene, transforms: BABYLON.TransformNode[]): void;
  1509. /**
  1510. * Gets the specified asset container mesh.
  1511. * @param container defines the asset container
  1512. * @param meshName defines the mesh name to get
  1513. * @returns the mesh from the container
  1514. */
  1515. static GetAssetContainerMesh(container: BABYLON.AssetContainer, meshName: string): BABYLON.Mesh;
  1516. /**
  1517. * Gets the specified asset container transform node.
  1518. * @param container defines the asset container
  1519. * @param nodeName defines the transform node name to get
  1520. * @returns the transform node from the container
  1521. */
  1522. static GetAssetContainerNode(container: BABYLON.AssetContainer, nodeName: string): BABYLON.TransformNode;
  1523. /**
  1524. * Clones the specified asset container item.
  1525. * Associcated skeletons and animation groups will all be cloned. (Internal Use Only)
  1526. * @param container defines the asset container
  1527. * @param assetName defines the asset item name to clone
  1528. * @param nameFunction defines an optional function used to get new names for clones
  1529. * @param cloneAnimations defines an option to clone any animation groups (true by default)
  1530. * @param makeNewMaterials defines an optional boolean that defines if materials must be cloned as well (false by default)
  1531. * @returns the transform node that was duplicated
  1532. */
  1533. static CloneAssetContainerItem(container: BABYLON.AssetContainer, assetName: string, nameFunction?: (sourceName: string) => string, makeNewMaterials?: boolean, cloneAnimations?: boolean): BABYLON.TransformNode;
  1534. static InstantiateHierarchy(node: BABYLON.TransformNode, newParent?: BABYLON.Nullable<BABYLON.TransformNode>, onNewNodeCreated?: (source: BABYLON.TransformNode, clone: BABYLON.TransformNode) => void): BABYLON.Nullable<BABYLON.TransformNode>;
  1535. static InstantiateNodeHierarchy(node: BABYLON.TransformNode, newParent?: BABYLON.Nullable<BABYLON.TransformNode>, onNewNodeCreated?: (source: BABYLON.TransformNode, clone: BABYLON.TransformNode) => void): BABYLON.Nullable<BABYLON.TransformNode>;
  1536. static InstantiateMeshHierarchy(mesh: BABYLON.Mesh, newParent: BABYLON.Nullable<BABYLON.TransformNode>, createInstance: boolean, onNewNodeCreated?: (source: BABYLON.TransformNode, clone: BABYLON.TransformNode) => void): BABYLON.Nullable<BABYLON.TransformNode>;
  1537. /** Computes the transition duration blending speed */
  1538. static ComputeBlendingSpeed(rate: number, duration: number, dampen?: boolean): number;
  1539. static CalculateCameraDistance(farClipPlane: number, lodPercent: number, clipPlaneScale?: number): number;
  1540. /** TODO */
  1541. static InstantiateClass(className: string): any;
  1542. /** TODO */
  1543. static GetSimpleClassName(obj: any): string;
  1544. /** TODO */
  1545. static DisposeEntity(entity: BABYLON.AbstractMesh): void;
  1546. /** TODO */
  1547. static SearchTransformNodes(name: string, nodes: BABYLON.Node[], searchType?: BABYLON.SearchType): BABYLON.Node;
  1548. /** TODO */
  1549. static SearchTransformNodeForTags(query: string, nodes: BABYLON.Node[]): BABYLON.Node;
  1550. /** TODO */
  1551. static SearchAllTransformNodesForTags(query: string, nodes: BABYLON.Node[]): BABYLON.Node[];
  1552. /** TODO */
  1553. static SearchTransformNodeForScript(klass: string, nodes: BABYLON.Node[]): BABYLON.Node;
  1554. /** TODO */
  1555. static SearchAllTransformNodesForScript(klass: string, nodes: BABYLON.Node[]): BABYLON.Node[];
  1556. /** TODO */
  1557. static CreateGuid(suffix?: string): string;
  1558. /** TODO */
  1559. static ValidateTransformGuid(node: TransformNode): void;
  1560. /** TODO */
  1561. static RegisterInstancedMeshBuffers(mesh: BABYLON.Mesh): void;
  1562. /** TODO */
  1563. static CloneValue(source: any, destinationObject: any): any;
  1564. /** TODO */
  1565. static CloneEntityMetadata(source: any): any;
  1566. /** TODO */
  1567. static DeepCopyProperties(source: any, destination: any, doNotCopyList?: string[], mustCopyList?: string[]): void;
  1568. /** TODO */
  1569. static ValidateTransformMetadata(transform: BABYLON.TransformNode): void;
  1570. }
  1571. }
  1572. /**
  1573. * Babylon Utilties Alias
  1574. */
  1575. declare const UTIL: typeof BABYLON.Utilities;
  1576. declare const CVTOOLS_NAME = "CVTOOLS_unity_metadata";
  1577. declare const CVTOOLS_MESH = "CVTOOLS_babylon_mesh";
  1578. declare const CVTOOLS_HAND = "CVTOOLS_left_handed";
  1579. /**
  1580. * Babylon Toolkit Editor - Loader Class
  1581. * @class CVTOOLS_unity_metadata - All rights reserved (c) 2020 Mackey Kinard
  1582. * [Specification](https://github.com/MackeyK24/glTF/tree/master/extensions/2.0/Vendor/CVTOOLS_unity_metadata)
  1583. */
  1584. declare class CVTOOLS_unity_metadata implements BABYLON.GLTF2.IGLTFLoaderExtension {
  1585. /** The name of this extension. */
  1586. readonly name = "CVTOOLS_unity_metadata";
  1587. /** Defines whether this extension is enabled. */
  1588. enabled: boolean;
  1589. private static LastRootUrl;
  1590. private static LastParseScene;
  1591. private static LastBabylonScene;
  1592. private _loader;
  1593. private _parserList;
  1594. private _masterList;
  1595. private _detailList;
  1596. private _shaderList;
  1597. private _materialMap;
  1598. private _lightmapMap;
  1599. private _reflectionMap;
  1600. private _activeMeshes;
  1601. private _parseScene;
  1602. private _leftHanded;
  1603. private _disposeRoot;
  1604. private _sceneParsed;
  1605. private _rootUrl;
  1606. /** @hidden */
  1607. constructor(loader: BABYLON.GLTF2.GLTFLoader);
  1608. /** @hidden */
  1609. dispose(): void;
  1610. /** @hidden */
  1611. onLoading(): void;
  1612. /** @hidden */
  1613. loadSceneAsync(context: string, scene: BABYLON.GLTF2.IScene): BABYLON.Nullable<Promise<void>>;
  1614. /** @hidden */
  1615. onReady(): void;
  1616. private _processActiveMeshes;
  1617. private _processUnityMeshes;
  1618. /** @hidden */
  1619. loadNodeAsync(context: string, node: BABYLON.GLTF2.INode, assign: (babylonMesh: BABYLON.TransformNode) => void): BABYLON.Nullable<Promise<BABYLON.TransformNode>>;
  1620. /** @hidden */
  1621. loadMaterialPropertiesAsync(context: string, material: BABYLON.GLTF2.IMaterial, babylonMaterial: BABYLON.Material): BABYLON.Nullable<Promise<void>>;
  1622. private _getCachedLightmapByIndex;
  1623. private _getCachedMaterialByIndex;
  1624. private _getCachedCubemapByUrl;
  1625. /** @hidden */
  1626. createMaterial(context: string, material: BABYLON.GLTF2.IMaterial, babylonDrawMode: number): BABYLON.Nullable<BABYLON.Material>;
  1627. /** @hidden */
  1628. _loadSkinAsync(context: string, node: BABYLON.GLTF2.INode, skin: BABYLON.GLTF2.ISkin): Promise<void>;
  1629. /** @hidden */
  1630. loadAnimationAsync(context: string, animation: BABYLON.GLTF2.IAnimation): Promise<BABYLON.AnimationGroup>;
  1631. /** @hidden */
  1632. _loadMeshPrimitiveAsync(context: string, name: string, node: BABYLON.GLTF2.INode, mesh: BABYLON.GLTF2.IMesh, primitive: BABYLON.GLTF2.IMeshPrimitive, assign: (babylonMesh: BABYLON.AbstractMesh) => void): Promise<BABYLON.AbstractMesh>;
  1633. private _setupBabylonMesh;
  1634. private _processLevelOfDetail;
  1635. private _setupBabylonMaterials;
  1636. private _processShaderMaterials;
  1637. private preProcessSceneProperties;
  1638. private postProcessSceneProperties;
  1639. private _preloadRawMaterialsAsync;
  1640. private _parseMultiMaterialAsync;
  1641. private _parseShaderMaterialPropertiesAsync;
  1642. private _parseDiffuseMaterialPropertiesAsync;
  1643. private _parseCommonConstantProperties;
  1644. }
  1645. /**
  1646. * Babylon Toolkit Editor - Loader Class
  1647. * @class CVTOOLS_babylon_mesh - All rights reserved (c) 2020 Mackey Kinard
  1648. * [Specification](https://github.com/MackeyK24/glTF/tree/master/extensions/2.0/Vendor/CVTOOLS_unity_metadata)
  1649. */
  1650. declare class CVTOOLS_babylon_mesh implements BABYLON.GLTF2.IGLTFLoaderExtension {
  1651. /** The name of this extension. */
  1652. readonly name = "CVTOOLS_babylon_mesh";
  1653. /** Defines whether this extension is enabled. */
  1654. enabled: boolean;
  1655. private _loader;
  1656. /** @hidden */
  1657. constructor(loader: BABYLON.GLTF2.GLTFLoader);
  1658. /** @hidden */
  1659. dispose(): void;
  1660. }
  1661. /**
  1662. * Babylon Toolkit Editor - Loader Class
  1663. * @class CVTOOLS_left_handed - All rights reserved (c) 2020 Mackey Kinard
  1664. * [Specification](https://github.com/MackeyK24/glTF/tree/master/extensions/2.0/Vendor/CVTOOLS_unity_metadata)
  1665. */
  1666. declare class CVTOOLS_left_handed implements BABYLON.GLTF2.IGLTFLoaderExtension {
  1667. /** The name of this extension. */
  1668. readonly name = "CVTOOLS_left_handed";
  1669. /** Defines whether this extension is enabled. */
  1670. enabled: boolean;
  1671. private _loader;
  1672. /** @hidden */
  1673. constructor(loader: BABYLON.GLTF2.GLTFLoader);
  1674. /** @hidden */
  1675. dispose(): void;
  1676. }
  1677. declare module BABYLON {
  1678. /**
  1679. * Babylon animation state pro class (Unity Style Mechanim Animation System)
  1680. * @class AnimationState - All rights reserved (c) 2020 Mackey Kinard
  1681. */
  1682. class AnimationState extends BABYLON.ScriptComponent {
  1683. private static FPS;
  1684. private static TIME;
  1685. private static EXIT;
  1686. private static MOTION;
  1687. private _frametime;
  1688. private _layercount;
  1689. private _updatemode;
  1690. private _hasrootmotion;
  1691. private _processmotion;
  1692. private _initialtargetblending;
  1693. private _hastransformhierarchy;
  1694. private _leftfeetbottomheight;
  1695. private _rightfeetbottomheight;
  1696. private _runtimecontroller;
  1697. private _executed;
  1698. private _checkers;
  1699. private _source;
  1700. private _machine;
  1701. private _deltaPosition;
  1702. private _deltaRotation;
  1703. private _deltaAngleY;
  1704. private _positionWeight;
  1705. private _rootBoneWeight;
  1706. private _rotationWeight;
  1707. private _rootQuatWeight;
  1708. private _positionHolder;
  1709. private _rootBoneHolder;
  1710. private _rotationHolder;
  1711. private _rootQuatHolder;
  1712. private _rootMotionMatrix;
  1713. private _rootMotionScaling;
  1714. private _rootMotionRotation;
  1715. private _rootMotionPosition;
  1716. private _lastMotionRotation;
  1717. private _lastMotionPosition;
  1718. private _quatRotationDiff;
  1719. private _quatRotateVector;
  1720. private _dirtyMotionMatrix;
  1721. private _dirtyBlenderMatrix;
  1722. private _targetPosition;
  1723. private _targetRotation;
  1724. private _targetScaling;
  1725. private _updateMatrix;
  1726. private _blenderMatrix;
  1727. private _blendWeights;
  1728. private _data;
  1729. private _anims;
  1730. private _numbers;
  1731. private _booleans;
  1732. private _triggers;
  1733. private _parameters;
  1734. speedRatio: number;
  1735. applyRootMotion: boolean;
  1736. enableAnimation: boolean;
  1737. hasRootMotion(): boolean;
  1738. getAnimationTime(): number;
  1739. getDeltaPosition(): BABYLON.Vector3;
  1740. getDeltaRotation(): BABYLON.Quaternion;
  1741. getRuntimeController(): string;
  1742. protected m_avatarMask: Map<string, number>;
  1743. protected m_defaultGroup: BABYLON.AnimationGroup;
  1744. protected m_animationTargets: BABYLON.TargetedAnimation[];
  1745. protected awake(): void;
  1746. protected late(): void;
  1747. protected destroy(): void;
  1748. /** Register handler that is triggered when the animation ik setup has been triggered */
  1749. onAnimationIKObservable: Observable<number>;
  1750. /** Register handler that is triggered when the animation end has been triggered */
  1751. onAnimationEndObservable: Observable<number>;
  1752. /** Register handler that is triggered when the animation loop has been triggered */
  1753. onAnimationLoopObservable: Observable<number>;
  1754. /** Register handler that is triggered when the animation event has been triggered */
  1755. onAnimationEventObservable: Observable<IAnimatorEvent>;
  1756. /** Register handler that is triggered when the animation frame has been updated */
  1757. onAnimationUpdateObservable: Observable<TransformNode>;
  1758. playAnimation(state: string, transitionDuration?: number, animationLayer?: number, frameRate?: number): boolean;
  1759. getBool(name: string): boolean;
  1760. setBool(name: string, value: boolean): void;
  1761. getFloat(name: string): float;
  1762. setFloat(name: string, value: float): void;
  1763. getInteger(name: string): int;
  1764. setInteger(name: string, value: int): void;
  1765. getTrigger(name: string): boolean;
  1766. setTrigger(name: string): void;
  1767. resetTrigger(name: string): void;
  1768. private getMachineState;
  1769. private setMachineState;
  1770. getCurrentState(layer: number): BABYLON.MachineState;
  1771. getAnimationGroup(name: string): BABYLON.AnimationGroup;
  1772. getAnimationGroups(): Map<string, BABYLON.AnimationGroup>;
  1773. setAnimationGroups(groups: BABYLON.AnimationGroup[], remapTargets?: boolean): void;
  1774. getRootMotionAngle(): number;
  1775. getRootMotionSpeed(): number;
  1776. getForwardMoveSpeed(absolute?: boolean): number;
  1777. private awakeStateMachine;
  1778. private lateStateMachine;
  1779. private destroyStateMachine;
  1780. private updateAnimationState;
  1781. private updateAnimationCurves;
  1782. private updateAnimationTargets;
  1783. private updateBlendableTargets;
  1784. private finalizeAnimationTargets;
  1785. private checkStateMachine;
  1786. private checkStateTransitions;
  1787. private setCurrentAnimationState;
  1788. private checkAvatarTransformPath;
  1789. private filterTargetAvatarMask;
  1790. private sortWeightedBlendingList;
  1791. private computeWeightedFrameRatio;
  1792. private setupTreeBranches;
  1793. private parseTreeBranches;
  1794. private parse1DSimpleTreeBranches;
  1795. private parse2DSimpleDirectionalTreeBranches;
  1796. private parse2DFreeformDirectionalTreeBranches;
  1797. private parse2DFreeformCartesianTreeBranches;
  1798. }
  1799. class BlendTreeValue {
  1800. source: BABYLON.IBlendTreeChild;
  1801. motion: string;
  1802. posX: number;
  1803. posY: number;
  1804. weight: number;
  1805. constructor(config: {
  1806. source: BABYLON.IBlendTreeChild;
  1807. motion: string;
  1808. posX?: number;
  1809. posY?: number;
  1810. weight?: number;
  1811. });
  1812. }
  1813. class BlendTreeUtils {
  1814. static ClampValue(num: number, min: number, max: number): number;
  1815. static GetSignedAngle(a: BABYLON.Vector2, b: BABYLON.Vector2): number;
  1816. static GetLinearInterpolation(x0: number, y0: number, x1: number, y1: number, x: number): number;
  1817. static GetRightNeighbourIndex(inputX: number, blendTreeArray: BABYLON.BlendTreeValue[]): number;
  1818. }
  1819. class BlendTreeSystem {
  1820. static Calculate1DSimpleBlendTree(inputX: number, blendTreeArray: BABYLON.BlendTreeValue[]): void;
  1821. static Calculate2DFreeformDirectional(inputX: number, inputY: number, blendTreeArray: BABYLON.BlendTreeValue[]): void;
  1822. static Calculate2DFreeformCartesian(inputX: number, inputY: number, blendTreeArray: BABYLON.BlendTreeValue[]): void;
  1823. private static TempVector2_IP;
  1824. private static TempVector2_POSI;
  1825. private static TempVector2_POSJ;
  1826. private static TempVector2_POSIP;
  1827. private static TempVector2_POSIJ;
  1828. }
  1829. class MachineState {
  1830. hash: number;
  1831. name: string;
  1832. tag: string;
  1833. time: number;
  1834. type: BABYLON.MotionType;
  1835. rate: number;
  1836. length: number;
  1837. layer: string;
  1838. layerIndex: number;
  1839. played: number;
  1840. machine: string;
  1841. motionid: number;
  1842. interrupted: boolean;
  1843. apparentSpeed: number;
  1844. averageAngularSpeed: number;
  1845. averageDuration: number;
  1846. averageSpeed: number[];
  1847. cycleOffset: number;
  1848. cycleOffsetParameter: string;
  1849. cycleOffsetParameterActive: boolean;
  1850. iKOnFeet: boolean;
  1851. mirror: boolean;
  1852. mirrorParameter: string;
  1853. irrorParameterActive: boolean;
  1854. speed: number;
  1855. speedParameter: string;
  1856. speedParameterActive: boolean;
  1857. blendtree: BABYLON.IBlendTree;
  1858. transitions: BABYLON.ITransition[];
  1859. behaviours: BABYLON.IBehaviour[];
  1860. events: BABYLON.IAnimatorEvent[];
  1861. constructor();
  1862. }
  1863. class TransitionCheck {
  1864. result: string;
  1865. offest: number;
  1866. blending: number;
  1867. triggered: string[];
  1868. }
  1869. class AnimationMixer {
  1870. influenceBuffer: number;
  1871. positionBuffer: BABYLON.Vector3;
  1872. rotationBuffer: BABYLON.Quaternion;
  1873. scalingBuffer: BABYLON.Vector3;
  1874. originalMatrix: BABYLON.Matrix;
  1875. blendingFactor: number;
  1876. blendingSpeed: number;
  1877. rootPosition: BABYLON.Vector3;
  1878. rootRotation: BABYLON.Quaternion;
  1879. }
  1880. class BlendingWeights {
  1881. primary: BABYLON.IBlendTreeChild;
  1882. secondary: BABYLON.IBlendTreeChild;
  1883. }
  1884. enum MotionType {
  1885. Clip = 0,
  1886. Tree = 1
  1887. }
  1888. enum ConditionMode {
  1889. If = 1,
  1890. IfNot = 2,
  1891. Greater = 3,
  1892. Less = 4,
  1893. Equals = 6,
  1894. NotEqual = 7
  1895. }
  1896. enum InterruptionSource {
  1897. None = 0,
  1898. Source = 1,
  1899. Destination = 2,
  1900. SourceThenDestination = 3,
  1901. DestinationThenSource = 4
  1902. }
  1903. enum BlendTreeType {
  1904. Simple1D = 0,
  1905. SimpleDirectional2D = 1,
  1906. FreeformDirectional2D = 2,
  1907. FreeformCartesian2D = 3,
  1908. Direct = 4,
  1909. Clip = 5
  1910. }
  1911. enum BlendTreePosition {
  1912. Lower = 0,
  1913. Upper = 1
  1914. }
  1915. enum AnimatorParameterType {
  1916. Float = 1,
  1917. Int = 3,
  1918. Bool = 4,
  1919. Trigger = 9
  1920. }
  1921. interface IAnimatorEvent {
  1922. id: number;
  1923. clip: string;
  1924. time: number;
  1925. function: string;
  1926. intParameter: number;
  1927. floatParameter: number;
  1928. stringParameter: string;
  1929. objectIdParameter: string;
  1930. objectNameParameter: string;
  1931. }
  1932. interface IAvatarMask {
  1933. hash: number;
  1934. maskName: string;
  1935. maskType: string;
  1936. transformCount: number;
  1937. transformPaths: string[];
  1938. }
  1939. interface IAnimationLayer {
  1940. hash: number;
  1941. name: string;
  1942. index: number;
  1943. entry: string;
  1944. machine: string;
  1945. iKPass: boolean;
  1946. avatarMask: BABYLON.IAvatarMask;
  1947. blendingMode: number;
  1948. defaultWeight: number;
  1949. syncedLayerIndex: number;
  1950. syncedLayerAffectsTiming: boolean;
  1951. animationTime: number;
  1952. animationNormal: number;
  1953. animationFirstRun: boolean;
  1954. animationEndFrame: boolean;
  1955. animationLoopFrame: boolean;
  1956. animationLoopEvents: any;
  1957. animationStateMachine: BABYLON.MachineState;
  1958. }
  1959. interface IAnimationCurve {
  1960. length: number;
  1961. preWrapMode: string;
  1962. postWrapMode: string;
  1963. keyframes: BABYLON.IAnimationKeyframe[];
  1964. }
  1965. interface IAnimationKeyframe {
  1966. time: number;
  1967. value: number;
  1968. inTangent: number;
  1969. outTangent: number;
  1970. tangentMode: number;
  1971. }
  1972. interface IBehaviour {
  1973. hash: number;
  1974. name: string;
  1975. layerIndex: number;
  1976. properties: any;
  1977. }
  1978. interface ITransition {
  1979. hash: number;
  1980. anyState: boolean;
  1981. layerIndex: number;
  1982. machineLayer: string;
  1983. machineName: string;
  1984. canTransitionToSelf: boolean;
  1985. destination: string;
  1986. duration: number;
  1987. exitTime: number;
  1988. hasExitTime: boolean;
  1989. fixedDuration: boolean;
  1990. intSource: BABYLON.InterruptionSource;
  1991. isExit: boolean;
  1992. mute: boolean;
  1993. name: string;
  1994. offset: number;
  1995. orderedInt: boolean;
  1996. solo: boolean;
  1997. conditions: BABYLON.ICondition[];
  1998. }
  1999. interface ICondition {
  2000. hash: number;
  2001. mode: BABYLON.ConditionMode;
  2002. parameter: string;
  2003. threshold: number;
  2004. }
  2005. interface IBlendTree {
  2006. hash: number;
  2007. name: string;
  2008. state: string;
  2009. children: BABYLON.IBlendTreeChild[];
  2010. layerIndex: number;
  2011. apparentSpeed: number;
  2012. averageAngularSpeed: number;
  2013. averageDuration: number;
  2014. averageSpeed: number[];
  2015. blendParameterX: string;
  2016. blendParameterY: string;
  2017. blendType: BABYLON.BlendTreeType;
  2018. isAnimatorMotion: boolean;
  2019. isHumanMotion: boolean;
  2020. isLooping: boolean;
  2021. minThreshold: number;
  2022. maxThreshold: number;
  2023. useAutomaticThresholds: boolean;
  2024. valueParameterX: number;
  2025. valueParameterY: number;
  2026. }
  2027. interface IBlendTreeChild {
  2028. hash: number;
  2029. layerIndex: number;
  2030. cycleOffset: number;
  2031. directBlendParameter: string;
  2032. apparentSpeed: number;
  2033. averageAngularSpeed: number;
  2034. averageDuration: number;
  2035. averageSpeed: number[];
  2036. mirror: boolean;
  2037. type: BABYLON.MotionType;
  2038. motion: string;
  2039. positionX: number;
  2040. positionY: number;
  2041. threshold: number;
  2042. timescale: number;
  2043. subtree: BABYLON.IBlendTree;
  2044. weight: number;
  2045. ratio: number;
  2046. track: BABYLON.AnimationGroup;
  2047. }
  2048. }
  2049. declare module BABYLON {
  2050. /**
  2051. * Babylon audio source manager pro class
  2052. * @class AudioSource - All rights reserved (c) 2020 Mackey Kinard
  2053. */
  2054. class AudioSource extends BABYLON.ScriptComponent {
  2055. private _audio;
  2056. private _name;
  2057. private _file;
  2058. private _loop;
  2059. private _mute;
  2060. private _volume;
  2061. private _pitch;
  2062. private _priority;
  2063. private _panstereo;
  2064. private _mindistance;
  2065. private _maxdistance;
  2066. private _rolloffmode;
  2067. private _rollofffactor;
  2068. private _playonawake;
  2069. private _spatialblend;
  2070. private _reverbzonemix;
  2071. private _lastmutedvolume;
  2072. private _bypasseffects;
  2073. private _bypassreverbzones;
  2074. private _bypasslistenereffects;
  2075. private _initializedReadyInstance;
  2076. getSoundClip(): BABYLON.Sound;
  2077. getAudioElement(): HTMLAudioElement;
  2078. /** Register handler that is triggered when the audio clip is ready */
  2079. onReadyObservable: Observable<Sound>;
  2080. protected awake(): void;
  2081. protected destroy(): void;
  2082. protected awakeAudioSource(): void;
  2083. protected destroyAudioSource(): void;
  2084. /**
  2085. * Gets the ready status for track
  2086. */
  2087. isReady(): boolean;
  2088. /**
  2089. * Gets the playing status for track
  2090. */
  2091. isPlaying(): boolean;
  2092. /**
  2093. * Gets the paused status for track
  2094. */
  2095. isPaused(): boolean;
  2096. /**
  2097. * Play the sound track
  2098. * @param time (optional) Start the sound after X seconds. Start immediately (0) by default.
  2099. * @param offset (optional) Start the sound at a specific time in seconds
  2100. * @param length (optional) Sound duration (in seconds)
  2101. */
  2102. play(time?: number, offset?: number, length?: number): boolean;
  2103. /**
  2104. * Pause the sound track
  2105. */
  2106. pause(): boolean;
  2107. /**
  2108. * Stop the sound track
  2109. * @param time (optional) Start the sound after X seconds. Start immediately (0) by default.
  2110. */
  2111. stop(time?: number): boolean;
  2112. /**
  2113. * Mute the sound track
  2114. * @param time (optional) Mute the sound after X seconds. Start immediately (0) by default.
  2115. */
  2116. mute(time?: number): boolean;
  2117. /**
  2118. * Unmute the sound track
  2119. * @param time (optional) Unmute the sound after X seconds. Start immediately (0) by default.
  2120. */
  2121. unmute(time?: number): boolean;
  2122. /**
  2123. * Gets the volume of the track
  2124. */
  2125. getVolume(): number;
  2126. /**
  2127. * Sets the volume of the track
  2128. * @param volume Define the new volume of the sound
  2129. * @param time Define time for gradual change to new volume
  2130. */
  2131. setVolume(volume: number, time?: number): boolean;
  2132. /**
  2133. * Gets the spatial sound option of the track
  2134. */
  2135. getSpatialSound(): boolean;
  2136. /**
  2137. * Gets the spatial sound option of the track
  2138. * @param value Define the value of the spatial sound
  2139. */
  2140. setSpatialSound(value: boolean): void;
  2141. /**
  2142. * Sets the sound track playback speed
  2143. * @param rate the audio playback rate
  2144. */
  2145. setPlaybackSpeed(rate: number): void;
  2146. /**
  2147. * Gets the current time of the track
  2148. */
  2149. getCurrentTrackTime(): number;
  2150. }
  2151. }
  2152. declare module BABYLON {
  2153. /**
  2154. * Babylon kinematic character controller pro class (Native Bullet Physics 2.82)
  2155. * @class CharacterController - All rights reserved (c) 2020 Mackey Kinard
  2156. */
  2157. class CharacterController extends BABYLON.ScriptComponent {
  2158. private static MARGIN_FACTOR;
  2159. private _abstractMesh;
  2160. private _avatarRadius;
  2161. private _avatarHeight;
  2162. private _centerOffset;
  2163. private _skinWidth;
  2164. private _stepOffset;
  2165. private _slopeLimit;
  2166. private _capsuleSegments;
  2167. private _minMoveDistance;
  2168. private _isPhysicsReady;
  2169. private _maxCollisions;
  2170. private _useGhostSweepTest;
  2171. private _tmpPositionBuffer;
  2172. private _tmpCollisionContacts;
  2173. updatePosition: boolean;
  2174. getInternalCharacter(): any;
  2175. getAvatarRadius(): number;
  2176. getAvatarHeight(): number;
  2177. getSkinWidth(): number;
  2178. getStepOffset(): number;
  2179. getUseSweepTest(): any;
  2180. getMinMoveDistance(): number;
  2181. setMinMoveDistance(distance: number): void;
  2182. getVerticalVelocity(): number;
  2183. getAddedMargin(): number;
  2184. setAddedMargin(margin: number): void;
  2185. setMaxJumpHeight(maxJumpHeight: number): void;
  2186. setFallingSpeed(fallSpeed: number): void;
  2187. getSlopeLimit(): number;
  2188. setSlopeLimit(slopeRadians: number): void;
  2189. setUpAxis(axis: number): void;
  2190. getGravity(): number;
  2191. setGravity(gravity: number): void;
  2192. isGrounded(): boolean;
  2193. isReady(): boolean;
  2194. canJump(): boolean;
  2195. protected m_character: any;
  2196. protected m_ghostShape: any;
  2197. protected m_ghostObject: any;
  2198. protected m_ghostCollision: any;
  2199. protected m_ghostTransform: any;
  2200. protected m_ghostPosition: any;
  2201. protected m_startPosition: any;
  2202. protected m_startTransform: any;
  2203. protected m_walkDirection: any;
  2204. protected m_warpPosition: any;
  2205. protected m_turningRate: number;
  2206. protected m_moveDeltaX: number;
  2207. protected m_moveDeltaZ: number;
  2208. protected m_physicsEngine: BABYLON.IPhysicsEngine;
  2209. protected m_characterPosition: BABYLON.Vector3;
  2210. protected internalWarp(position: any): void;
  2211. protected internalJump(): void;
  2212. protected internalSetJumpSpeed(speed: number): void;
  2213. protected internalSetWalkDirection(direction: any): void;
  2214. protected internalSetVelocityForTimeInterval(velocity: any, interval: number): void;
  2215. protected awake(): void;
  2216. protected start(): void;
  2217. protected update(): void;
  2218. protected destroy(): void;
  2219. protected awakeMovementState(): void;
  2220. protected startMovementState(): void;
  2221. protected syncMovementState(): void;
  2222. protected updateMovementState(): void;
  2223. protected parseGhostCollisionContacts(): void;
  2224. protected destroyMovementState(): void;
  2225. /** Register handler that is triggered when the transform position has been updated */
  2226. onUpdatePositionObservable: Observable<TransformNode>;
  2227. /** Register handler that is triggered when the a collision contact has entered */
  2228. onCollisionEnterObservable: Observable<AbstractMesh>;
  2229. /** Register handler that is triggered when the a collision contact is active */
  2230. onCollisionStayObservable: Observable<AbstractMesh>;
  2231. /** Register handler that is triggered when the a collision contact has exited */
  2232. onCollisionExitObservable: Observable<AbstractMesh>;
  2233. /** Sets the maximum number of simultaneous contact notfications to dispatch per frame. Defaults value is 4. (Advanved Use Only) */
  2234. setMaxNotifications(max: number): void;
  2235. /** Sets character collision activation state using physics ghost object. (Advanved Use Only) */
  2236. setActivationState(state: number): void;
  2237. /** Gets character collision group filter using physics ghost object. (Advanved Use Only) */
  2238. getCollisionFilterGroup(): number;
  2239. /** Sets character collision group filter using physics ghost object. (Advanved Use Only) */
  2240. setCollisionFilterGroup(group: number): void;
  2241. /** Gets character collision mask filter using physics ghost object. (Advanved Use Only) */
  2242. getCollisionFilterMask(): number;
  2243. /** Sets the character collision mask filter using physics ghost object. (Advanved Use Only) */
  2244. setCollisionFilterMask(mask: number): void;
  2245. /** Gets the chracter contact processing threshold using physics ghost object. (Advanved Use Only) */
  2246. getContactProcessingThreshold(): number;
  2247. /** Sets character contact processing threshold using physics ghost object. (Advanved Use Only) */
  2248. setContactProcessingThreshold(threshold: number): void;
  2249. /** Get the current position of the physics ghost object world transform. (Advanved Use Only) */
  2250. getGhostWorldPosition(): BABYLON.Vector3;
  2251. /** Get the current position of the physics ghost object world transform. (Advanved Use Only) */
  2252. getGhostWorldPositionToRef(result: BABYLON.Vector3): void;
  2253. /** Manually set the position of the physics ghost object world transform. (Advanved Use Only) */
  2254. setGhostWorldPosition(position: BABYLON.Nullable<BABYLON.Vector3>): void;
  2255. /** Sets the kinematic character position to the specified location. */
  2256. set(x: number, y: number, z: number): void;
  2257. /** Translates the kinematic character with the specfied velocity. */
  2258. move(velocity: BABYLON.Vector3): void;
  2259. /** Jumps the kinematic chacracter with the specified speed. */
  2260. jump(speed: number): void;
  2261. /** Warps the kinematic chacracter to the specified position. */
  2262. warp(position: BABYLON.Vector3): void;
  2263. }
  2264. }
  2265. declare module BABYLON {
  2266. /**
  2267. * Babylon navigation agent pro class (Unity Style Navigation Agent System)
  2268. * @class NavigationAgent - All rights reserved (c) 2020 Mackey Kinard
  2269. */
  2270. class NavigationAgent extends BABYLON.ScriptComponent {
  2271. private static TARGET_ANGLE_FACTOR;
  2272. private static ANGULAR_SPEED_RATIO;
  2273. private type;
  2274. private speed;
  2275. private baseOffset;
  2276. private avoidRadius;
  2277. private avoidHeight;
  2278. private acceleration;
  2279. private areaMask;
  2280. private autoRepath;
  2281. private autoBraking;
  2282. private autoTraverseOffMeshLink;
  2283. private avoidancePriority;
  2284. private obstacleAvoidanceType;
  2285. private distanceToTarget;
  2286. private teleporting;
  2287. private moveDirection;
  2288. private resetPosition;
  2289. private lastPosition;
  2290. private distancePosition;
  2291. private currentPosition;
  2292. private currentRotation;
  2293. private currentVelocity;
  2294. private currentWaypoint;
  2295. heightOffset: number;
  2296. angularSpeed: number;
  2297. updatePosition: boolean;
  2298. updateRotation: boolean;
  2299. distanceEpsilon: number;
  2300. velocityEpsilon: number;
  2301. offMeshVelocity: number;
  2302. stoppingDistance: number;
  2303. isReady(): boolean;
  2304. isNavigating(): boolean;
  2305. isTeleporting(): boolean;
  2306. isOnOffMeshLink(): boolean;
  2307. getAgentType(): number;
  2308. getAgentState(): number;
  2309. getAgentIndex(): number;
  2310. getAgentOffset(): number;
  2311. getTargetDistance(): number;
  2312. getCurrentWaypoint(): BABYLON.Vector3;
  2313. getCurrentPosition(): BABYLON.Vector3;
  2314. getCurrentRotation(): BABYLON.Quaternion;
  2315. getCurrentVelocity(): BABYLON.Vector3;
  2316. getAgentParameters(): BABYLON.IAgentParameters;
  2317. setAgentParameters(parameters: BABYLON.IAgentParameters): void;
  2318. protected m_agentState: number;
  2319. protected m_agentIndex: number;
  2320. protected m_agentReady: boolean;
  2321. protected m_agentGhost: BABYLON.TransformNode;
  2322. protected m_agentParams: BABYLON.IAgentParameters;
  2323. protected m_agentMovement: BABYLON.Vector3;
  2324. protected m_agentDirection: BABYLON.Vector3;
  2325. protected m_agentQuaternion: BABYLON.Quaternion;
  2326. protected m_agentDestination: BABYLON.Vector3;
  2327. protected awake(): void;
  2328. protected update(): void;
  2329. protected destroy(): void;
  2330. /** Register handler that is triggered when the agent is ready for navigation */
  2331. onReadyObservable: Observable<TransformNode>;
  2332. /** Register handler that is triggered before the navigation update */
  2333. onPreUpdateObservable: Observable<TransformNode>;
  2334. /** Register handler that is triggered after the navigation update */
  2335. onPostUpdateObservable: Observable<TransformNode>;
  2336. /** Register handler that is triggered when the navigation is complete */
  2337. onNavCompleteObservable: Observable<TransformNode>;
  2338. private awakeNavigationAgent;
  2339. private updateNavigationAgent;
  2340. private updateAgentParameters;
  2341. private destroyNavigationAgent;
  2342. /** Move agent relative to current position. */
  2343. move(offset: BABYLON.Vector3, closetPoint?: boolean): void;
  2344. /** Teleport agent to destination point. */
  2345. teleport(destination: BABYLON.Vector3, closetPoint?: boolean): void;
  2346. /** Sets agent current destination point. */
  2347. setDestination(destination: BABYLON.Vector3, closetPoint?: boolean): void;
  2348. /** Gets agent current world space velocity. */
  2349. getAgentVelocity(): BABYLON.Vector3;
  2350. /** Gets agent current world space velocity. */
  2351. getAgentVelocityToRef(result: BABYLON.Vector3): void;
  2352. /** Gets agent current world space position. */
  2353. getAgentPosition(): BABYLON.Vector3;
  2354. /** Gets agent current world space position. */
  2355. getAgentPositionToRef(result: BABYLON.Vector3): void;
  2356. /** Gets agent current waypoint position. */
  2357. getAgentWaypoint(): BABYLON.Vector3;
  2358. /** Gets agent current waypoint position. */
  2359. getAgentWaypointToRef(result: BABYLON.Vector3): void;
  2360. /** Cancel current waypoint path navigation. */
  2361. cancelNavigation(): void;
  2362. }
  2363. /**
  2364. * Recast Detour Crowd Agent States
  2365. */
  2366. enum CrowdAgentState {
  2367. DT_CROWDAGENT_STATE_INVALID = 0,
  2368. DT_CROWDAGENT_STATE_WALKING = 1,
  2369. DT_CROWDAGENT_STATE_OFFMESH = 2
  2370. }
  2371. }
  2372. declare module BABYLON {
  2373. /**
  2374. * Babylon raycast vehicle controller pro class (Native Bullet Physics 2.82)
  2375. * @class RaycastVehicle - All rights reserved (c) 2020 Mackey Kinard
  2376. */
  2377. class RaycastVehicle {
  2378. private _centerMass;
  2379. private _chassisMesh;
  2380. private _tempVectorPos;
  2381. lockedWheelIndexes: number[];
  2382. getInternalVehicle(): any;
  2383. getUpAxis(): number;
  2384. getRightAxis(): number;
  2385. getForwardAxis(): number;
  2386. getForwardVector(): any;
  2387. getNumWheels(): number;
  2388. getWheelInfo(wheel: number): any;
  2389. resetSuspension(): void;
  2390. setPitchControl(pitch: number): void;
  2391. setEngineForce(power: number, wheel: number): void;
  2392. setBrakingForce(brake: number, wheel: number): void;
  2393. getWheelTransform(wheel: number): any;
  2394. updateWheelTransform(wheel: number, interpolate: boolean): void;
  2395. getUserConstraintType(): number;
  2396. setUserConstraintType(userConstraintType: number): void;
  2397. setUserConstraintId(uid: number): void;
  2398. getUserConstraintId(): number;
  2399. getRawCurrentSpeedKph(): number;
  2400. getRawCurrentSpeedMph(): number;
  2401. getAbsCurrentSpeedKph(): number;
  2402. getAbsCurrentSpeedMph(): number;
  2403. getVehicleTuningSystem(): any;
  2404. getChassisWorldTransform(): any;
  2405. protected m_vehicle: any;
  2406. protected m_vehicleTuning: any;
  2407. protected m_vehicleRaycaster: any;
  2408. protected m_vehicleColliders: any[];
  2409. protected m_tempTransform: any;
  2410. protected m_tempPosition: any;
  2411. protected m_wheelDirectionCS0: any;
  2412. protected m_wheelAxleCS: any;
  2413. constructor(entity: BABYLON.AbstractMesh, world: any, center: BABYLON.Vector3, defaultAngularFactor?: BABYLON.Vector3);
  2414. dispose(): void;
  2415. /** Gets the rigidbody raycast vehicle controller for the entity. Note: Wheel collider metadata informaion is required for raycast vehicle control. */
  2416. static GetInstance(scene: BABYLON.Scene, rigidbody: BABYLON.RigidbodyPhysics, defaultAngularFactor?: BABYLON.Vector3): BABYLON.RaycastVehicle;
  2417. /** Gets vehicle enable multi raycast flag using physics vehicle object. (Advanved Use Only) */
  2418. getEnableMultiRaycast(): boolean;
  2419. /** Sets vehicle enable multi raycast flag using physics vehicle object. (Advanved Use Only) */
  2420. setEnableMultiRaycast(flag: boolean): void;
  2421. /** Gets vehicle stable force using physics vehicle object. (Advanved Use Only) */
  2422. getStabilizingForce(): number;
  2423. /** Sets vehicle stable force using physics vehicle object. (Advanved Use Only) */
  2424. setStabilizingForce(force: number): void;
  2425. /** Gets vehicle smooth flying impulse force using physics vehicle object. (Advanved Use Only) */
  2426. getSmoothFlyingImpulse(): number;
  2427. /** Sets vehicle smooth flying impulse using physics vehicle object. (Advanved Use Only) */
  2428. setSmoothFlyingImpulse(impulse: number): void;
  2429. /** Gets vehicle track connection accel force using physics vehicle object. (Advanved Use Only) */
  2430. getTrackConnectionAccel(): number;
  2431. /** Sets vehicle track connection accel force using physics vehicle object. (Advanved Use Only) */
  2432. setTrackConnectionAccel(force: number): void;
  2433. /** Gets vehicle min wheel contact count using physics vehicle object. (Advanved Use Only) */
  2434. getMinimumWheelContacts(): number;
  2435. /** Sets vehicle min wheel contact count using physics vehicle object. (Advanved Use Only) */
  2436. setMinimumWheelContacts(force: number): void;
  2437. /** Gets vehicle interpolate mesh normals flag using physics raycaster object. (Advanved Use Only) */
  2438. getInterpolateNormals(): boolean;
  2439. /** Sets the vehicle interpolate mesh normals using physics raycaster object. (Advanved Use Only) */
  2440. setInterpolateNormals(flag: boolean): void;
  2441. /** Gets vehicle shape testing mode using physics raycaster object. (Advanved Use Only) */
  2442. getShapeTestingMode(): boolean;
  2443. /** Sets the vehicle shape testing mode using physics raycaster object. (Advanved Use Only) */
  2444. setShapeTestingMode(mode: boolean): void;
  2445. /** Gets vehicle shape testing size using physics raycaster object. (Advanved Use Only) */
  2446. getShapeTestingSize(): float;
  2447. /** Sets the vehicle shape testing mode using physics raycaster object. (Advanved Use Only) */
  2448. setShapeTestingSize(size: float): void;
  2449. /** Gets vehicle shape test point count using physics raycaster object. (Advanved Use Only) */
  2450. getShapeTestingCount(): float;
  2451. /** Sets the vehicle shape test point count using physics raycaster object. (Advanved Use Only) */
  2452. setShapeTestingCount(count: float): void;
  2453. /** Gets vehicle sweep penetration amount using physics raycaster object. (Advanved Use Only) */
  2454. getSweepPenetration(): float;
  2455. /** Sets the vehicle sweep penetration amount using physics raycaster object. (Advanved Use Only) */
  2456. setSweepPenetration(amount: float): void;
  2457. /** Gets vehicle collision group filter using physics raycaster object. (Advanved Use Only) */
  2458. getCollisionFilterGroup(): number;
  2459. /** Sets vehicle collision group filter using physics raycaster object. (Advanved Use Only) */
  2460. setCollisionFilterGroup(group: number): void;
  2461. /** Gets vehicle collision mask filter using physics raycaster object. (Advanved Use Only) */
  2462. getCollisionFilterMask(): number;
  2463. /** Sets the vehicle collision mask filter using physics raycaster object. (Advanved Use Only) */
  2464. setCollisionFilterMask(mask: number): void;
  2465. /** Gets the internal wheel index by id string. */
  2466. getWheelIndexByID(id: string): number;
  2467. /** Gets the internal wheel index by name string. */
  2468. getWheelIndexByName(name: string): number;
  2469. /** Gets the internal wheel collider information. */
  2470. getWheelColliderInfo(wheel: number): number;
  2471. /** Sets the internal wheel hub transform mesh by index. Used to rotate and bounce wheels. */
  2472. setWheelTransformMesh(wheel: number, transform: BABYLON.TransformNode): void;
  2473. getVisualSteeringAngle(wheel: number): number;
  2474. setVisualSteeringAngle(angle: number, wheel: number): void;
  2475. getPhysicsSteeringAngle(wheel: number): number;
  2476. setPhysicsSteeringAngle(angle: number, wheel: number): void;
  2477. protected setupWheelInformation(defaultAngularFactor?: BABYLON.Vector3): void;
  2478. protected updateWheelInformation(): void;
  2479. protected lockedWheelInformation(wheel: number): boolean;
  2480. protected deleteWheelInformation(): void;
  2481. }
  2482. }
  2483. declare module BABYLON {
  2484. /**
  2485. * Babylon realtime reflection system pro class (Unity Style Realtime Reflection Probes)
  2486. * @class RealtimeReflection - All rights reserved (c) 2020 Mackey Kinard
  2487. */
  2488. class RealtimeReflection extends BABYLON.ScriptComponent {
  2489. private static SKYBOX_FLAG;
  2490. private renderList;
  2491. private probeList;
  2492. private refreshMode;
  2493. private cullingMask;
  2494. private clearFlags;
  2495. private probeid;
  2496. private useProbeList;
  2497. private includeChildren;
  2498. private resolution;
  2499. private boxPos;
  2500. private boxSize;
  2501. private boxProjection;
  2502. getProbeList(): BABYLON.AbstractMesh[];
  2503. getRenderList(): BABYLON.AbstractMesh[];
  2504. protected awake(): void;
  2505. protected start(): void;
  2506. protected destroy(): void;
  2507. protected awakeRealtimReflections(): void;
  2508. protected startRealtimReflections(): void;
  2509. protected destroyRealtimReflections(): void;
  2510. }
  2511. }
  2512. declare module BABYLON {
  2513. /**
  2514. * Babylon full rigidbody physics pro class (Native Bullet Physics 2.82)
  2515. * @class RigidbodyPhysics - All rights reserved (c) 2020 Mackey Kinard
  2516. */
  2517. class RigidbodyPhysics extends BABYLON.ScriptComponent {
  2518. private static TempAmmoVector;
  2519. private static TempAmmoVectorAux;
  2520. private static TempCenterTransform;
  2521. private _abstractMesh;
  2522. private _isKinematic;
  2523. private _maxCollisions;
  2524. private _isPhysicsReady;
  2525. private _centerOfMass;
  2526. private _tmpLinearFactor;
  2527. private _tmpAngularFactor;
  2528. private _tmpCenterOfMass;
  2529. private _tmpGravityVector;
  2530. private _tmpCollisionContacts;
  2531. get isKinematic(): boolean;
  2532. get centerOfMass(): BABYLON.Vector3;
  2533. protected m_physicsWorld: any;
  2534. protected m_physicsEngine: BABYLON.IPhysicsEngine;
  2535. protected m_raycastVehicle: any;
  2536. protected awake(): void;
  2537. protected update(): void;
  2538. protected after(): void;
  2539. protected destroy(): void;
  2540. protected awakeRigidbodyState(): void;
  2541. protected updateRigidbodyState(): void;
  2542. protected afterRigidbodyState(): void;
  2543. protected destroyRigidbodyState(): void;
  2544. protected syncronizeVehicleController(): void;
  2545. protected parseBodyCollisionContacts(): void;
  2546. protected resetBodyCollisionContacts(): void;
  2547. /** Register handler that is triggered when the a collision contact has entered */
  2548. onCollisionEnterObservable: Observable<AbstractMesh>;
  2549. /** Register handler that is triggered when the a collision contact is active */
  2550. onCollisionStayObservable: Observable<AbstractMesh>;
  2551. /** Register handler that is triggered when the a collision contact has exited */
  2552. onCollisionExitObservable: Observable<AbstractMesh>;
  2553. /** Sets entity gravity value using physics impostor body. */
  2554. setGravity(gravity: BABYLON.Vector3): void;
  2555. /** Gets entity gravity value using physics impostor body. */
  2556. getGravity(): BABYLON.Nullable<BABYLON.Vector3>;
  2557. /** Gets entity gravity value using physics impostor body. */
  2558. getGravityToRef(result: BABYLON.Vector3): void;
  2559. /** Gets mass of entity using physics impostor. */
  2560. getMass(): number;
  2561. /** Sets mass to entity using physics impostor. */
  2562. setMass(mass: number): void;
  2563. /** Gets entity friction level using physics impostor. */
  2564. getFriction(): number;
  2565. /** Applies friction to entity using physics impostor. */
  2566. setFriction(friction: number): void;
  2567. /** Gets restitution of entity using physics impostor. */
  2568. getRestitution(): number;
  2569. /** Sets restitution to entity using physics impostor. */
  2570. setRestitution(restitution: number): void;
  2571. /** Gets entity linear velocity using physics impostor. */
  2572. getLinearVelocity(): BABYLON.Nullable<BABYLON.Vector3>;
  2573. /** Sets entity linear velocity using physics impostor. */
  2574. setLinearVelocity(velocity: BABYLON.Vector3): void;
  2575. /** Gets entity angular velocity using physics impostor. */
  2576. getAngularVelocity(): BABYLON.Nullable<BABYLON.Vector3>;
  2577. /** Sets entity angular velocity using physics impostor. */
  2578. setAngularVelocity(velocity: BABYLON.Vector3): void;
  2579. /** Gets the native physics world transform object using physics impostor body. (Advanved Use Only) */
  2580. getWorldTransform(): any;
  2581. /** Gets the entity world transform position using physics impostor body. (Advanved Use Only) */
  2582. getTransformPositionToRef(result: BABYLON.Vector3): void;
  2583. /** Gets the entity world transform rotation using physics impostor body. (Advanved Use Only) */
  2584. getTransformRotationToRef(result: BABYLON.Quaternion): void;
  2585. clearForces(): void;
  2586. applyTorque(torque: BABYLON.Vector3): void;
  2587. applyLocalTorque(torque: BABYLON.Vector3): void;
  2588. applyImpulse(impulse: BABYLON.Vector3, rel_pos: BABYLON.Vector3): void;
  2589. applyCentralImpulse(impulse: BABYLON.Vector3): void;
  2590. applyTorqueImpulse(torque: BABYLON.Vector3): void;
  2591. applyForce(force: BABYLON.Vector3, rel_pos: BABYLON.Vector3): void;
  2592. applyCentralForce(force: BABYLON.Vector3): void;
  2593. applyCentralLocalForce(force: BABYLON.Vector3): void;
  2594. /** gets rigidbody center of mass */
  2595. getCenterOfMassTransform(): BABYLON.Vector3;
  2596. /** Sets rigidbody center of mass */
  2597. setCenterOfMassTransform(center: BABYLON.Vector3): void;
  2598. /** Gets entity linear factor using physics impostor body. */
  2599. getLinearFactor(): BABYLON.Vector3;
  2600. /** Sets entity linear factor using physics impostor body. */
  2601. setLinearFactor(factor: BABYLON.Vector3): void;
  2602. /** Gets entity angular factor using physics impostor body. */
  2603. getAngularFactor(): BABYLON.Vector3;
  2604. /** Sets entity angular factor using physics impostor body. */
  2605. setAngularFactor(factor: BABYLON.Vector3): void;
  2606. /** Gets entity angular damping using physics impostor body. */
  2607. getAngularDamping(): number;
  2608. /** Gets entity linear damping using physics impostor body. */
  2609. getLinearDamping(): number;
  2610. /** Sets entity drag damping using physics impostor body. */
  2611. setDamping(linear: number, angular: number): void;
  2612. /** Sets entity sleeping threshold using physics impostor body. */
  2613. setSleepingThresholds(linear: number, angular: number): void;
  2614. /** Checks if rigidbody has wheel collider metadata for the entity. Note: Wheel collider metadata informaion is required for vehicle control. */
  2615. hasWheelColliders(): boolean;
  2616. /** Sets the maximum number of simultaneous contact notfications to dispatch per frame. Defaults value is 4. (Advanved Use Only) */
  2617. setMaxNotifications(max: number): void;
  2618. /** Sets entity collision activation state using physics impostor body. (Advanved Use Only) */
  2619. setActivationState(state: number): void;
  2620. /** Gets entity collision filter group using physics impostor body. (Advanved Use Only) */
  2621. getCollisionFilterGroup(): number;
  2622. /** Sets entity collision filter group using physics impostor body. (Advanved Use Only) */
  2623. setCollisionFilterGroup(group: number): void;
  2624. /** Gets entity collision filter mask using physics impostor body. (Advanved Use Only) */
  2625. getCollisionFilterMask(): number;
  2626. /** Sets entity collision filter mask using physics impostor body. (Advanved Use Only) */
  2627. setCollisionFilterMask(mask: number): void;
  2628. /** Gets the entity collision shape type using physics impostor body. (Advanved Use Only) */
  2629. getCollisionShapeType(): number;
  2630. /** Gets the entity collision shape margin using physics impostor body. (Advanved Use Only) */
  2631. getCollisionShapeMargin(): number;
  2632. /** Sets entity collision shape margin using physics impostor body. (Advanved Use Only) */
  2633. setCollisionShapeMargin(margin: number): void;
  2634. /** Gets the entity contact processing threshold using physics impostor body. (Advanved Use Only) */
  2635. /** Sets entity contact processing threshold using physics impostor body. (Advanved Use Only) */
  2636. setContactProcessingThreshold(threshold: number): void;
  2637. /** TODO */
  2638. static CreatePhysicsMetadata(mass: number, drag?: number, angularDrag?: number, centerMass?: Vector3): any;
  2639. /** TODO */
  2640. static CreateCollisionMetadata(type: string, trigger?: boolean, convexmesh?: boolean, restitution?: number, dynamicfriction?: number, staticfriction?: number): any;
  2641. /** TODO */
  2642. static CreatePhysicsProperties(mass: number, drag?: number, angularDrag?: number, useGravity?: boolean, isKinematic?: boolean): any;
  2643. /** TODO */
  2644. static SetupPhysicsComponent(scene: BABYLON.Scene, entity: BABYLON.AbstractMesh): void;
  2645. private static ConfigRigidbodyPhysics;
  2646. }
  2647. /**
  2648. * Babylon collision contact info pro class (Native Bullet Physics 2.82)
  2649. * @class CollisionContactInfo - All rights reserved (c) 2020 Mackey Kinard
  2650. */
  2651. class CollisionContactInfo {
  2652. mesh: BABYLON.AbstractMesh;
  2653. state: number;
  2654. reset: boolean;
  2655. }
  2656. }
  2657. declare module BABYLON {
  2658. /**
  2659. * Babylon shuriken particle system pro class (Unity Style Shuriken Particle System)
  2660. * @class ShurikenParticles - All rights reserved (c) 2020 Mackey Kinard
  2661. */
  2662. class ShurikenParticles extends BABYLON.ScriptComponent {
  2663. protected awake(): void;
  2664. protected start(): void;
  2665. protected update(): void;
  2666. protected late(): void;
  2667. protected after(): void;
  2668. protected destroy(): void;
  2669. }
  2670. }
  2671. declare module BABYLON {
  2672. /**
  2673. * Babylon web video player pro class (Unity Style Shuriken Particle System)
  2674. * @class WebVideoPlayer - All rights reserved (c) 2020 Mackey Kinard
  2675. */
  2676. class WebVideoPlayer extends BABYLON.ScriptComponent {
  2677. getVideoMaterial(): BABYLON.StandardMaterial;
  2678. getVideoTexture(): BABYLON.VideoTexture;
  2679. getVideoElement(): HTMLVideoElement;
  2680. getVideoScreen(): BABYLON.AbstractMesh;
  2681. protected m_abstractMesh: BABYLON.AbstractMesh;
  2682. protected m_videoTexture: BABYLON.VideoTexture;
  2683. protected m_videoMaterial: BABYLON.StandardMaterial;
  2684. protected m_diffuseIntensity: number;
  2685. protected awake(): void;
  2686. protected destroy(): void;
  2687. protected awakeWebVideoPlayer(): void;
  2688. protected destroyWebVideoPlayer(): void;
  2689. /** Set web video player source */
  2690. setVideoSource(src: string | string[] | HTMLVideoElement, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number, settings?: BABYLON.VideoTextureSettings, volume?: number, speed?: number): void;
  2691. }
  2692. }