babylon.manager.d.ts 131 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720
  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, defaultSpeedRatio?: number, defaultFrameRate?: number, defaultLoopMode?: number, defaultEasingFunction?: 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, subTimeStep?: 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 _fixed;
  631. private _lateUpdate;
  632. private _properties;
  633. private _awoken;
  634. private _started;
  635. private _scene;
  636. private _transform;
  637. private _registeredClassname;
  638. private _lateUpdateObserver;
  639. private _fixedUpdateObserver;
  640. /** Gets the current scene object */
  641. get scene(): BABYLON.Scene;
  642. /** Gets the transform node entity */
  643. get transform(): BABYLON.TransformNode;
  644. constructor(transform: BABYLON.TransformNode, scene: BABYLON.Scene, properties?: any);
  645. /** Sets the script component property bag value */
  646. protected setProperty(name: string, propertyValue: any): void;
  647. /** Gets the script component property bag value */
  648. protected getProperty<T>(name: string, defaultValue?: T): T;
  649. /** Gets the registered script component class name */
  650. getClassName(): string;
  651. /** Get the current time in seconds */
  652. getTime(): number;
  653. /** Get the total game time in seconds */
  654. getGameTime(): number;
  655. /** Get the current delta time in seconds */
  656. getDeltaSeconds(): number;
  657. /** Get the delta time animation ratio multiplier */
  658. getAnimationRatio(): number;
  659. /** Gets the safe transform mesh entity */
  660. getTransformMesh(): BABYLON.Mesh;
  661. /** Gets the safe transform abstract mesh entity */
  662. getAbstractMesh(): BABYLON.AbstractMesh;
  663. /** Gets the safe transform instanced mesh entity */
  664. getInstancedMesh(): BABYLON.InstancedMesh;
  665. /** Gets the transform primitive meshes */
  666. getPrimitiveMeshes(): BABYLON.AbstractMesh[];
  667. /** Get the transform object metedata in the scene. */
  668. getMetadata(): any;
  669. /** Get a script component on the transform with the specfied class name. */
  670. getComponent<T extends BABYLON.ScriptComponent>(klass: string): T;
  671. /** Get all script components on the transform with the specfied class name. */
  672. getComponents<T extends BABYLON.ScriptComponent>(klass: string): T[];
  673. /** Gets the attached transform light rig */
  674. getLightRig(): BABYLON.Light;
  675. /** Gets the attached transform camera rig */
  676. getCameraRig(): BABYLON.FreeCamera;
  677. /** Gets a script component transform primary tag name. */
  678. getTransformTag(): string;
  679. /** Check if the transform has the specified query tag match */
  680. hasTransformTags(query: string): boolean;
  681. /** Get the specfied child transform in the scene. */
  682. getChildNode(name: string, searchType?: BABYLON.SearchType, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  683. /** Get the first child transform with matching tags. */
  684. getChildWithTags(query: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  685. /** Get all child transforms with matching tags. */
  686. getChildrenWithTags(query: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode[];
  687. /** Get the first child transform with the specified script component. */
  688. getChildWithScript(klass: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode;
  689. /** Get all child transforms with the specified script component. */
  690. getChildrenWithScript(klass: string, directDecendantsOnly?: boolean, predicate?: (node: BABYLON.Node) => boolean): BABYLON.TransformNode[];
  691. /** Register handler that is triggered after the scene has rendered and is ready to go */
  692. registerOnSceneReady(func: (eventData: BABYLON.Scene, eventState: BABYLON.EventState) => void): void;
  693. /** Registers an on pick tricgger click action */
  694. registerOnClickAction(func: () => void): BABYLON.IAction;
  695. /** Unregisters an on pick tricgger click action */
  696. unregisterOnClickAction(action: BABYLON.IAction): boolean;
  697. /** Register handler that is triggered when the a volume has entered */
  698. onTriggerEnterObservable: Observable<AbstractMesh>;
  699. /** Register handler that is triggered when the a volume contact is active */
  700. onTriggerStayObservable: Observable<AbstractMesh>;
  701. /** Register handler that is triggered when the a volume contact has exited */
  702. onTriggerExitObservable: Observable<AbstractMesh>;
  703. private triggerMesh;
  704. private triggerVolumeList;
  705. useTriggerVolumePrecision: boolean;
  706. includeTriggerVolumeDescendants: boolean;
  707. getTriggerVolumeList(): BABYLON.TriggerVolume[];
  708. resetTriggerVolumeList(): void;
  709. registerTriggerVolume(volume: BABYLON.AbstractMesh): void;
  710. unregisterTriggerVolume(volume: BABYLON.AbstractMesh): void;
  711. private registerComponentInstance;
  712. private destroyComponentInstance;
  713. private static RegisterInstance;
  714. private static UpdateInstance;
  715. private static LateInstance;
  716. private static AfterInstance;
  717. private static FixedInstance;
  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 _frametime;
  1687. private _layercount;
  1688. private _updatemode;
  1689. private _hasrootmotion;
  1690. private _processmotion;
  1691. private _initialtargetblending;
  1692. private _hastransformhierarchy;
  1693. private _leftfeetbottomheight;
  1694. private _rightfeetbottomheight;
  1695. private _runtimecontroller;
  1696. private _executed;
  1697. private _checkers;
  1698. private _source;
  1699. private _machine;
  1700. private _deltaPosition;
  1701. private _deltaRotation;
  1702. private _deltaAngleY;
  1703. private _positionWeight;
  1704. private _rootBoneWeight;
  1705. private _rotationWeight;
  1706. private _rootQuatWeight;
  1707. private _positionHolder;
  1708. private _rootBoneHolder;
  1709. private _rotationHolder;
  1710. private _rootQuatHolder;
  1711. private _rootMotionMatrix;
  1712. private _rootMotionScaling;
  1713. private _rootMotionRotation;
  1714. private _rootMotionPosition;
  1715. private _rootMotionVelocity;
  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. updatePosition: boolean;
  1736. updateRotation: boolean;
  1737. applyRootMotion: boolean;
  1738. enableAnimation: boolean;
  1739. moveWithCollisions: boolean;
  1740. hasRootMotion(): boolean;
  1741. getAnimationTime(): number;
  1742. getRootPosition(): BABYLON.Vector3;
  1743. getRootRotation(): BABYLON.Quaternion;
  1744. getDeltaPosition(): BABYLON.Vector3;
  1745. getDeltaRotation(): BABYLON.Quaternion;
  1746. getRuntimeController(): string;
  1747. protected m_rootTransform: BABYLON.TransformNode;
  1748. protected m_rigidbodyPhysics: BABYLON.RigidbodyPhysics;
  1749. protected m_characterController: BABYLON.CharacterController;
  1750. protected m_avatarMask: Map<string, number>;
  1751. protected m_defaultGroup: BABYLON.AnimationGroup;
  1752. protected m_animationTargets: BABYLON.TargetedAnimation[];
  1753. protected awake(): void;
  1754. protected late(): void;
  1755. protected destroy(): void;
  1756. /** Register handler that is triggered when the animation ik setup has been triggered */
  1757. onAnimationIKObservable: Observable<number>;
  1758. /** Register handler that is triggered when the animation end has been triggered */
  1759. onAnimationEndObservable: Observable<number>;
  1760. /** Register handler that is triggered when the animation loop has been triggered */
  1761. onAnimationLoopObservable: Observable<number>;
  1762. /** Register handler that is triggered when the animation event has been triggered */
  1763. onAnimationEventObservable: Observable<IAnimatorEvent>;
  1764. /** Register handler that is triggered when the animation frame has been updated */
  1765. onAnimationUpdateObservable: Observable<TransformNode>;
  1766. playAnimation(state: string, transitionDuration?: number, animationLayer?: number, frameRate?: number): boolean;
  1767. getBool(name: string): boolean;
  1768. setBool(name: string, value: boolean): void;
  1769. getFloat(name: string): float;
  1770. setFloat(name: string, value: float): void;
  1771. getInteger(name: string): int;
  1772. setInteger(name: string, value: int): void;
  1773. getTrigger(name: string): boolean;
  1774. setTrigger(name: string): void;
  1775. resetTrigger(name: string): void;
  1776. private getMachineState;
  1777. private setMachineState;
  1778. getCurrentState(layer: number): BABYLON.MachineState;
  1779. getAnimationGroup(name: string): BABYLON.AnimationGroup;
  1780. getAnimationGroups(): Map<string, BABYLON.AnimationGroup>;
  1781. setAnimationGroups(groups: BABYLON.AnimationGroup[], remapTargets?: boolean): void;
  1782. setRootTransform(transform: BABYLON.TransformNode): void;
  1783. getRootTransform(): BABYLON.TransformNode;
  1784. getRigidbodyPhysics(): BABYLON.RigidbodyPhysics;
  1785. getCharacterController(): BABYLON.CharacterController;
  1786. getRootMotionSpeed(): number;
  1787. getRootMotionAngle(): number;
  1788. private awakeStateMachine;
  1789. private lateStateMachine;
  1790. private destroyStateMachine;
  1791. private updateAnimationState;
  1792. private updateAnimationCurves;
  1793. private updateAnimationTargets;
  1794. private updateBlendableTargets;
  1795. private finalizeAnimationTargets;
  1796. private checkStateMachine;
  1797. private checkStateTransitions;
  1798. private setCurrentAnimationState;
  1799. private checkAvatarTransformPath;
  1800. private filterTargetAvatarMask;
  1801. private sortWeightedBlendingList;
  1802. private computeWeightedFrameRatio;
  1803. private setupTreeBranches;
  1804. private parseTreeBranches;
  1805. private parse1DSimpleTreeBranches;
  1806. private parse2DSimpleDirectionalTreeBranches;
  1807. private parse2DFreeformDirectionalTreeBranches;
  1808. private parse2DFreeformCartesianTreeBranches;
  1809. }
  1810. class BlendTreeValue {
  1811. source: BABYLON.IBlendTreeChild;
  1812. motion: string;
  1813. posX: number;
  1814. posY: number;
  1815. weight: number;
  1816. constructor(config: {
  1817. source: BABYLON.IBlendTreeChild;
  1818. motion: string;
  1819. posX?: number;
  1820. posY?: number;
  1821. weight?: number;
  1822. });
  1823. }
  1824. class BlendTreeUtils {
  1825. static ClampValue(num: number, min: number, max: number): number;
  1826. static GetSignedAngle(a: BABYLON.Vector2, b: BABYLON.Vector2): number;
  1827. static GetLinearInterpolation(x0: number, y0: number, x1: number, y1: number, x: number): number;
  1828. static GetRightNeighbourIndex(inputX: number, blendTreeArray: BABYLON.BlendTreeValue[]): number;
  1829. }
  1830. class BlendTreeSystem {
  1831. static Calculate1DSimpleBlendTree(inputX: number, blendTreeArray: BABYLON.BlendTreeValue[]): void;
  1832. static Calculate2DFreeformDirectional(inputX: number, inputY: number, blendTreeArray: BABYLON.BlendTreeValue[]): void;
  1833. static Calculate2DFreeformCartesian(inputX: number, inputY: number, blendTreeArray: BABYLON.BlendTreeValue[]): void;
  1834. private static TempVector2_IP;
  1835. private static TempVector2_POSI;
  1836. private static TempVector2_POSJ;
  1837. private static TempVector2_POSIP;
  1838. private static TempVector2_POSIJ;
  1839. }
  1840. class MachineState {
  1841. hash: number;
  1842. name: string;
  1843. tag: string;
  1844. time: number;
  1845. type: BABYLON.MotionType;
  1846. rate: number;
  1847. length: number;
  1848. layer: string;
  1849. layerIndex: number;
  1850. played: number;
  1851. machine: string;
  1852. motionid: number;
  1853. interrupted: boolean;
  1854. apparentSpeed: number;
  1855. averageAngularSpeed: number;
  1856. averageDuration: number;
  1857. averageSpeed: number[];
  1858. cycleOffset: number;
  1859. cycleOffsetParameter: string;
  1860. cycleOffsetParameterActive: boolean;
  1861. iKOnFeet: boolean;
  1862. mirror: boolean;
  1863. mirrorParameter: string;
  1864. irrorParameterActive: boolean;
  1865. speed: number;
  1866. speedParameter: string;
  1867. speedParameterActive: boolean;
  1868. blendtree: BABYLON.IBlendTree;
  1869. transitions: BABYLON.ITransition[];
  1870. behaviours: BABYLON.IBehaviour[];
  1871. events: BABYLON.IAnimatorEvent[];
  1872. constructor();
  1873. }
  1874. class TransitionCheck {
  1875. result: string;
  1876. offest: number;
  1877. blending: number;
  1878. triggered: string[];
  1879. }
  1880. class AnimationMixer {
  1881. influenceBuffer: number;
  1882. positionBuffer: BABYLON.Vector3;
  1883. rotationBuffer: BABYLON.Quaternion;
  1884. scalingBuffer: BABYLON.Vector3;
  1885. originalMatrix: BABYLON.Matrix;
  1886. blendingFactor: number;
  1887. blendingSpeed: number;
  1888. rootPosition: BABYLON.Vector3;
  1889. rootRotation: BABYLON.Quaternion;
  1890. }
  1891. class BlendingWeights {
  1892. primary: BABYLON.IBlendTreeChild;
  1893. secondary: BABYLON.IBlendTreeChild;
  1894. }
  1895. enum MotionType {
  1896. Clip = 0,
  1897. Tree = 1
  1898. }
  1899. enum ConditionMode {
  1900. If = 1,
  1901. IfNot = 2,
  1902. Greater = 3,
  1903. Less = 4,
  1904. Equals = 6,
  1905. NotEqual = 7
  1906. }
  1907. enum InterruptionSource {
  1908. None = 0,
  1909. Source = 1,
  1910. Destination = 2,
  1911. SourceThenDestination = 3,
  1912. DestinationThenSource = 4
  1913. }
  1914. enum BlendTreeType {
  1915. Simple1D = 0,
  1916. SimpleDirectional2D = 1,
  1917. FreeformDirectional2D = 2,
  1918. FreeformCartesian2D = 3,
  1919. Direct = 4,
  1920. Clip = 5
  1921. }
  1922. enum BlendTreePosition {
  1923. Lower = 0,
  1924. Upper = 1
  1925. }
  1926. enum AnimatorParameterType {
  1927. Float = 1,
  1928. Int = 3,
  1929. Bool = 4,
  1930. Trigger = 9
  1931. }
  1932. interface IAnimatorEvent {
  1933. id: number;
  1934. clip: string;
  1935. time: number;
  1936. function: string;
  1937. intParameter: number;
  1938. floatParameter: number;
  1939. stringParameter: string;
  1940. objectIdParameter: string;
  1941. objectNameParameter: string;
  1942. }
  1943. interface IAvatarMask {
  1944. hash: number;
  1945. maskName: string;
  1946. maskType: string;
  1947. transformCount: number;
  1948. transformPaths: string[];
  1949. }
  1950. interface IAnimationLayer {
  1951. hash: number;
  1952. name: string;
  1953. index: number;
  1954. entry: string;
  1955. machine: string;
  1956. iKPass: boolean;
  1957. avatarMask: BABYLON.IAvatarMask;
  1958. blendingMode: number;
  1959. defaultWeight: number;
  1960. syncedLayerIndex: number;
  1961. syncedLayerAffectsTiming: boolean;
  1962. animationTime: number;
  1963. animationNormal: number;
  1964. animationFirstRun: boolean;
  1965. animationEndFrame: boolean;
  1966. animationLoopFrame: boolean;
  1967. animationLoopEvents: any;
  1968. animationStateMachine: BABYLON.MachineState;
  1969. }
  1970. interface IAnimationCurve {
  1971. length: number;
  1972. preWrapMode: string;
  1973. postWrapMode: string;
  1974. keyframes: BABYLON.IAnimationKeyframe[];
  1975. }
  1976. interface IAnimationKeyframe {
  1977. time: number;
  1978. value: number;
  1979. inTangent: number;
  1980. outTangent: number;
  1981. tangentMode: number;
  1982. }
  1983. interface IBehaviour {
  1984. hash: number;
  1985. name: string;
  1986. layerIndex: number;
  1987. properties: any;
  1988. }
  1989. interface ITransition {
  1990. hash: number;
  1991. anyState: boolean;
  1992. layerIndex: number;
  1993. machineLayer: string;
  1994. machineName: string;
  1995. canTransitionToSelf: boolean;
  1996. destination: string;
  1997. duration: number;
  1998. exitTime: number;
  1999. hasExitTime: boolean;
  2000. fixedDuration: boolean;
  2001. intSource: BABYLON.InterruptionSource;
  2002. isExit: boolean;
  2003. mute: boolean;
  2004. name: string;
  2005. offset: number;
  2006. orderedInt: boolean;
  2007. solo: boolean;
  2008. conditions: BABYLON.ICondition[];
  2009. }
  2010. interface ICondition {
  2011. hash: number;
  2012. mode: BABYLON.ConditionMode;
  2013. parameter: string;
  2014. threshold: number;
  2015. }
  2016. interface IBlendTree {
  2017. hash: number;
  2018. name: string;
  2019. state: string;
  2020. children: BABYLON.IBlendTreeChild[];
  2021. layerIndex: number;
  2022. apparentSpeed: number;
  2023. averageAngularSpeed: number;
  2024. averageDuration: number;
  2025. averageSpeed: number[];
  2026. blendParameterX: string;
  2027. blendParameterY: string;
  2028. blendType: BABYLON.BlendTreeType;
  2029. isAnimatorMotion: boolean;
  2030. isHumanMotion: boolean;
  2031. isLooping: boolean;
  2032. minThreshold: number;
  2033. maxThreshold: number;
  2034. useAutomaticThresholds: boolean;
  2035. valueParameterX: number;
  2036. valueParameterY: number;
  2037. }
  2038. interface IBlendTreeChild {
  2039. hash: number;
  2040. layerIndex: number;
  2041. cycleOffset: number;
  2042. directBlendParameter: string;
  2043. apparentSpeed: number;
  2044. averageAngularSpeed: number;
  2045. averageDuration: number;
  2046. averageSpeed: number[];
  2047. mirror: boolean;
  2048. type: BABYLON.MotionType;
  2049. motion: string;
  2050. positionX: number;
  2051. positionY: number;
  2052. threshold: number;
  2053. timescale: number;
  2054. subtree: BABYLON.IBlendTree;
  2055. weight: number;
  2056. ratio: number;
  2057. track: BABYLON.AnimationGroup;
  2058. }
  2059. }
  2060. declare module BABYLON {
  2061. /**
  2062. * Babylon audio source manager pro class
  2063. * @class AudioSource - All rights reserved (c) 2020 Mackey Kinard
  2064. */
  2065. class AudioSource extends BABYLON.ScriptComponent {
  2066. private _audio;
  2067. private _name;
  2068. private _file;
  2069. private _loop;
  2070. private _mute;
  2071. private _volume;
  2072. private _pitch;
  2073. private _priority;
  2074. private _panstereo;
  2075. private _mindistance;
  2076. private _maxdistance;
  2077. private _rolloffmode;
  2078. private _rollofffactor;
  2079. private _playonawake;
  2080. private _spatialblend;
  2081. private _reverbzonemix;
  2082. private _lastmutedvolume;
  2083. private _bypasseffects;
  2084. private _bypassreverbzones;
  2085. private _bypasslistenereffects;
  2086. private _initializedReadyInstance;
  2087. getSoundClip(): BABYLON.Sound;
  2088. getAudioElement(): HTMLAudioElement;
  2089. /** Register handler that is triggered when the audio clip is ready */
  2090. onReadyObservable: Observable<Sound>;
  2091. protected awake(): void;
  2092. protected destroy(): void;
  2093. protected awakeAudioSource(): void;
  2094. protected destroyAudioSource(): void;
  2095. /**
  2096. * Gets the ready status for track
  2097. */
  2098. isReady(): boolean;
  2099. /**
  2100. * Gets the playing status for track
  2101. */
  2102. isPlaying(): boolean;
  2103. /**
  2104. * Gets the paused status for track
  2105. */
  2106. isPaused(): boolean;
  2107. /**
  2108. * Play the sound track
  2109. * @param time (optional) Start the sound after X seconds. Start immediately (0) by default.
  2110. * @param offset (optional) Start the sound at a specific time in seconds
  2111. * @param length (optional) Sound duration (in seconds)
  2112. */
  2113. play(time?: number, offset?: number, length?: number): boolean;
  2114. /**
  2115. * Pause the sound track
  2116. */
  2117. pause(): boolean;
  2118. /**
  2119. * Stop the sound track
  2120. * @param time (optional) Start the sound after X seconds. Start immediately (0) by default.
  2121. */
  2122. stop(time?: number): boolean;
  2123. /**
  2124. * Mute the sound track
  2125. * @param time (optional) Mute the sound after X seconds. Start immediately (0) by default.
  2126. */
  2127. mute(time?: number): boolean;
  2128. /**
  2129. * Unmute the sound track
  2130. * @param time (optional) Unmute the sound after X seconds. Start immediately (0) by default.
  2131. */
  2132. unmute(time?: number): boolean;
  2133. /**
  2134. * Gets the volume of the track
  2135. */
  2136. getVolume(): number;
  2137. /**
  2138. * Sets the volume of the track
  2139. * @param volume Define the new volume of the sound
  2140. * @param time Define time for gradual change to new volume
  2141. */
  2142. setVolume(volume: number, time?: number): boolean;
  2143. /**
  2144. * Gets the spatial sound option of the track
  2145. */
  2146. getSpatialSound(): boolean;
  2147. /**
  2148. * Gets the spatial sound option of the track
  2149. * @param value Define the value of the spatial sound
  2150. */
  2151. setSpatialSound(value: boolean): void;
  2152. /**
  2153. * Sets the sound track playback speed
  2154. * @param rate the audio playback rate
  2155. */
  2156. setPlaybackSpeed(rate: number): void;
  2157. /**
  2158. * Gets the current time of the track
  2159. */
  2160. getCurrentTrackTime(): number;
  2161. }
  2162. }
  2163. declare module BABYLON {
  2164. /**
  2165. * Babylon kinematic character controller pro class (Native Bullet Physics 2.82)
  2166. * @class CharacterController - All rights reserved (c) 2020 Mackey Kinard
  2167. */
  2168. class CharacterController extends BABYLON.ScriptComponent {
  2169. private static MARGIN_FACTOR;
  2170. private _abstractMesh;
  2171. private _avatarRadius;
  2172. private _avatarHeight;
  2173. private _centerOffset;
  2174. private _skinWidth;
  2175. private _stepOffset;
  2176. private _slopeLimit;
  2177. private _capsuleSegments;
  2178. private _minMoveDistance;
  2179. private _isPhysicsReady;
  2180. private _maxCollisions;
  2181. private _useGhostSweepTest;
  2182. private _tmpPositionBuffer;
  2183. private _tmpCollisionContacts;
  2184. updatePosition: boolean;
  2185. getInternalCharacter(): any;
  2186. getAvatarRadius(): number;
  2187. getAvatarHeight(): number;
  2188. getSkinWidth(): number;
  2189. getStepOffset(): number;
  2190. getUseSweepTest(): any;
  2191. getMinMoveDistance(): number;
  2192. setMinMoveDistance(distance: number): void;
  2193. getVerticalVelocity(): number;
  2194. getAddedMargin(): number;
  2195. setAddedMargin(margin: number): void;
  2196. setMaxJumpHeight(maxJumpHeight: number): void;
  2197. setFallingSpeed(fallSpeed: number): void;
  2198. getSlopeLimit(): number;
  2199. setSlopeLimit(slopeRadians: number): void;
  2200. setUpAxis(axis: number): void;
  2201. getGravity(): number;
  2202. setGravity(gravity: number): void;
  2203. isGrounded(): boolean;
  2204. isReady(): boolean;
  2205. canJump(): boolean;
  2206. protected m_character: any;
  2207. protected m_ghostShape: any;
  2208. protected m_ghostObject: any;
  2209. protected m_ghostCollision: any;
  2210. protected m_ghostTransform: any;
  2211. protected m_ghostPosition: any;
  2212. protected m_startPosition: any;
  2213. protected m_startTransform: any;
  2214. protected m_walkDirection: any;
  2215. protected m_warpPosition: any;
  2216. protected m_turningRate: number;
  2217. protected m_moveDeltaX: number;
  2218. protected m_moveDeltaZ: number;
  2219. protected m_physicsEngine: BABYLON.IPhysicsEngine;
  2220. protected m_characterPosition: BABYLON.Vector3;
  2221. protected internalWarp(position: any): void;
  2222. protected internalJump(): void;
  2223. protected internalSetJumpSpeed(speed: number): void;
  2224. protected internalSetWalkDirection(direction: any): void;
  2225. protected internalSetVelocityForTimeInterval(velocity: any, interval: number): void;
  2226. protected awake(): void;
  2227. protected start(): void;
  2228. protected update(): void;
  2229. protected destroy(): void;
  2230. protected awakeMovementState(): void;
  2231. protected startMovementState(): void;
  2232. protected syncMovementState(): void;
  2233. protected updateMovementState(): void;
  2234. protected parseGhostCollisionContacts(): void;
  2235. protected destroyMovementState(): void;
  2236. /** Register handler that is triggered when the transform position has been updated */
  2237. onUpdatePositionObservable: Observable<TransformNode>;
  2238. /** Register handler that is triggered when the a collision contact has entered */
  2239. onCollisionEnterObservable: Observable<AbstractMesh>;
  2240. /** Register handler that is triggered when the a collision contact is active */
  2241. onCollisionStayObservable: Observable<AbstractMesh>;
  2242. /** Register handler that is triggered when the a collision contact has exited */
  2243. onCollisionExitObservable: Observable<AbstractMesh>;
  2244. /** Sets the maximum number of simultaneous contact notfications to dispatch per frame. Defaults value is 4. (Advanved Use Only) */
  2245. setMaxNotifications(max: number): void;
  2246. /** Sets character collision activation state using physics ghost object. (Advanved Use Only) */
  2247. setActivationState(state: number): void;
  2248. /** Gets character collision group filter using physics ghost object. (Advanved Use Only) */
  2249. getCollisionFilterGroup(): number;
  2250. /** Sets character collision group filter using physics ghost object. (Advanved Use Only) */
  2251. setCollisionFilterGroup(group: number): void;
  2252. /** Gets character collision mask filter using physics ghost object. (Advanved Use Only) */
  2253. getCollisionFilterMask(): number;
  2254. /** Sets the character collision mask filter using physics ghost object. (Advanved Use Only) */
  2255. setCollisionFilterMask(mask: number): void;
  2256. /** Gets the chracter contact processing threshold using physics ghost object. (Advanved Use Only) */
  2257. getContactProcessingThreshold(): number;
  2258. /** Sets character contact processing threshold using physics ghost object. (Advanved Use Only) */
  2259. setContactProcessingThreshold(threshold: number): void;
  2260. /** Get the current position of the physics ghost object world transform. (Advanved Use Only) */
  2261. getGhostWorldPosition(): BABYLON.Vector3;
  2262. /** Get the current position of the physics ghost object world transform. (Advanved Use Only) */
  2263. getGhostWorldPositionToRef(result: BABYLON.Vector3): void;
  2264. /** Manually set the position of the physics ghost object world transform. (Advanved Use Only) */
  2265. setGhostWorldPosition(position: BABYLON.Nullable<BABYLON.Vector3>): void;
  2266. /** Sets the kinematic character position to the specified location. */
  2267. set(x: number, y: number, z: number): void;
  2268. /** Translates the kinematic character with the specfied velocity. */
  2269. move(velocity: BABYLON.Vector3): void;
  2270. /** Jumps the kinematic chacracter with the specified speed. */
  2271. jump(speed: number): void;
  2272. /** Warps the kinematic chacracter to the specified position. */
  2273. warp(position: BABYLON.Vector3): void;
  2274. }
  2275. }
  2276. declare module BABYLON {
  2277. /**
  2278. * Babylon navigation agent pro class (Unity Style Navigation Agent System)
  2279. * @class NavigationAgent - All rights reserved (c) 2020 Mackey Kinard
  2280. */
  2281. class NavigationAgent extends BABYLON.ScriptComponent {
  2282. private static TARGET_ANGLE_FACTOR;
  2283. private static ANGULAR_SPEED_RATIO;
  2284. private type;
  2285. private speed;
  2286. private baseOffset;
  2287. private avoidRadius;
  2288. private avoidHeight;
  2289. private acceleration;
  2290. private areaMask;
  2291. private autoRepath;
  2292. private autoBraking;
  2293. private autoTraverseOffMeshLink;
  2294. private avoidancePriority;
  2295. private obstacleAvoidanceType;
  2296. private distanceToTarget;
  2297. private teleporting;
  2298. private moveDirection;
  2299. private resetPosition;
  2300. private lastPosition;
  2301. private distancePosition;
  2302. private currentPosition;
  2303. private currentRotation;
  2304. private currentVelocity;
  2305. private currentWaypoint;
  2306. heightOffset: number;
  2307. angularSpeed: number;
  2308. updatePosition: boolean;
  2309. updateRotation: boolean;
  2310. distanceEpsilon: number;
  2311. velocityEpsilon: number;
  2312. offMeshVelocity: number;
  2313. stoppingDistance: number;
  2314. isReady(): boolean;
  2315. isNavigating(): boolean;
  2316. isTeleporting(): boolean;
  2317. isOnOffMeshLink(): boolean;
  2318. getAgentType(): number;
  2319. getAgentState(): number;
  2320. getAgentIndex(): number;
  2321. getAgentOffset(): number;
  2322. getTargetDistance(): number;
  2323. getCurrentPosition(): BABYLON.Vector3;
  2324. getCurrentRotation(): BABYLON.Quaternion;
  2325. getCurrentVelocity(): BABYLON.Vector3;
  2326. getAgentParameters(): BABYLON.IAgentParameters;
  2327. setAgentParameters(parameters: BABYLON.IAgentParameters): void;
  2328. protected m_agentState: number;
  2329. protected m_agentIndex: number;
  2330. protected m_agentReady: boolean;
  2331. protected m_agentGhost: BABYLON.TransformNode;
  2332. protected m_agentParams: BABYLON.IAgentParameters;
  2333. protected m_agentMovement: BABYLON.Vector3;
  2334. protected m_agentDirection: BABYLON.Vector3;
  2335. protected m_agentQuaternion: BABYLON.Quaternion;
  2336. protected m_agentDestination: BABYLON.Vector3;
  2337. protected awake(): void;
  2338. protected update(): void;
  2339. protected destroy(): void;
  2340. /** Register handler that is triggered when the agent is ready for navigation */
  2341. onReadyObservable: Observable<TransformNode>;
  2342. /** Register handler that is triggered before the navigation update */
  2343. onPreUpdateObservable: Observable<TransformNode>;
  2344. /** Register handler that is triggered after the navigation update */
  2345. onPostUpdateObservable: Observable<TransformNode>;
  2346. /** Register handler that is triggered when the navigation is complete */
  2347. onNavCompleteObservable: Observable<TransformNode>;
  2348. private awakeNavigationAgent;
  2349. private updateNavigationAgent;
  2350. private updateAgentParameters;
  2351. private destroyNavigationAgent;
  2352. /** Move agent relative to current position. */
  2353. move(offset: BABYLON.Vector3, closetPoint?: boolean): void;
  2354. /** Teleport agent to destination point. */
  2355. teleport(destination: BABYLON.Vector3, closetPoint?: boolean): void;
  2356. /** Sets agent current destination point. */
  2357. setDestination(destination: BABYLON.Vector3, closetPoint?: boolean): void;
  2358. /** Gets agent current world space velocity. */
  2359. getAgentVelocity(): BABYLON.Vector3;
  2360. /** Gets agent current world space velocity. */
  2361. getAgentVelocityToRef(result: BABYLON.Vector3): void;
  2362. /** Gets agent current world space position. */
  2363. getAgentPosition(): BABYLON.Vector3;
  2364. /** Gets agent current world space position. */
  2365. getAgentPositionToRef(result: BABYLON.Vector3): void;
  2366. /** Gets agent current waypoint position. */
  2367. getAgentWaypoint(): BABYLON.Vector3;
  2368. /** Gets agent current waypoint position. */
  2369. getAgentWaypointToRef(result: BABYLON.Vector3): void;
  2370. /** Cancel current waypoint path navigation. */
  2371. cancelNavigation(): void;
  2372. }
  2373. /**
  2374. * Recast Detour Crowd Agent States
  2375. */
  2376. enum CrowdAgentState {
  2377. DT_CROWDAGENT_STATE_INVALID = 0,
  2378. DT_CROWDAGENT_STATE_WALKING = 1,
  2379. DT_CROWDAGENT_STATE_OFFMESH = 2
  2380. }
  2381. }
  2382. declare module BABYLON {
  2383. /**
  2384. * Babylon raycast vehicle controller pro class (Native Bullet Physics 2.82)
  2385. * @class RaycastVehicle - All rights reserved (c) 2020 Mackey Kinard
  2386. */
  2387. class RaycastVehicle {
  2388. private _centerMass;
  2389. private _chassisMesh;
  2390. private _tempVectorPos;
  2391. lockedWheelIndexes: number[];
  2392. getInternalVehicle(): any;
  2393. getUpAxis(): number;
  2394. getRightAxis(): number;
  2395. getForwardAxis(): number;
  2396. getForwardVector(): any;
  2397. getNumWheels(): number;
  2398. getWheelInfo(wheel: number): any;
  2399. resetSuspension(): void;
  2400. setPitchControl(pitch: number): void;
  2401. setEngineForce(power: number, wheel: number): void;
  2402. setBrakingForce(brake: number, wheel: number): void;
  2403. getWheelTransform(wheel: number): any;
  2404. updateWheelTransform(wheel: number, interpolate: boolean): void;
  2405. getUserConstraintType(): number;
  2406. setUserConstraintType(userConstraintType: number): void;
  2407. setUserConstraintId(uid: number): void;
  2408. getUserConstraintId(): number;
  2409. getRawCurrentSpeedKph(): number;
  2410. getRawCurrentSpeedMph(): number;
  2411. getAbsCurrentSpeedKph(): number;
  2412. getAbsCurrentSpeedMph(): number;
  2413. getVehicleTuningSystem(): any;
  2414. getChassisWorldTransform(): any;
  2415. protected m_vehicle: any;
  2416. protected m_vehicleTuning: any;
  2417. protected m_vehicleRaycaster: any;
  2418. protected m_vehicleColliders: any[];
  2419. protected m_tempTransform: any;
  2420. protected m_tempPosition: any;
  2421. protected m_wheelDirectionCS0: any;
  2422. protected m_wheelAxleCS: any;
  2423. constructor(entity: BABYLON.AbstractMesh, world: any, center: BABYLON.Vector3, defaultAngularFactor?: BABYLON.Vector3);
  2424. dispose(): void;
  2425. /** Gets the rigidbody raycast vehicle controller for the entity. Note: Wheel collider metadata informaion is required for raycast vehicle control. */
  2426. static GetInstance(scene: BABYLON.Scene, rigidbody: BABYLON.RigidbodyPhysics, defaultAngularFactor?: BABYLON.Vector3): BABYLON.RaycastVehicle;
  2427. /** Gets vehicle enable multi raycast flag using physics vehicle object. (Advanved Use Only) */
  2428. getEnableMultiRaycast(): boolean;
  2429. /** Sets vehicle enable multi raycast flag using physics vehicle object. (Advanved Use Only) */
  2430. setEnableMultiRaycast(flag: boolean): void;
  2431. /** Gets vehicle stable force using physics vehicle object. (Advanved Use Only) */
  2432. getStabilizingForce(): number;
  2433. /** Sets vehicle stable force using physics vehicle object. (Advanved Use Only) */
  2434. setStabilizingForce(force: number): void;
  2435. /** Gets vehicle smooth flying impulse force using physics vehicle object. (Advanved Use Only) */
  2436. getSmoothFlyingImpulse(): number;
  2437. /** Sets vehicle smooth flying impulse using physics vehicle object. (Advanved Use Only) */
  2438. setSmoothFlyingImpulse(impulse: number): void;
  2439. /** Gets vehicle track connection accel force using physics vehicle object. (Advanved Use Only) */
  2440. getTrackConnectionAccel(): number;
  2441. /** Sets vehicle track connection accel force using physics vehicle object. (Advanved Use Only) */
  2442. setTrackConnectionAccel(force: number): void;
  2443. /** Gets vehicle min wheel contact count using physics vehicle object. (Advanved Use Only) */
  2444. getMinimumWheelContacts(): number;
  2445. /** Sets vehicle min wheel contact count using physics vehicle object. (Advanved Use Only) */
  2446. setMinimumWheelContacts(force: number): void;
  2447. /** Gets vehicle interpolate mesh normals flag using physics raycaster object. (Advanved Use Only) */
  2448. getInterpolateNormals(): boolean;
  2449. /** Sets the vehicle interpolate mesh normals using physics raycaster object. (Advanved Use Only) */
  2450. setInterpolateNormals(flag: boolean): void;
  2451. /** Gets vehicle shape testing mode using physics raycaster object. (Advanved Use Only) */
  2452. getShapeTestingMode(): boolean;
  2453. /** Sets the vehicle shape testing mode using physics raycaster object. (Advanved Use Only) */
  2454. setShapeTestingMode(mode: boolean): void;
  2455. /** Gets vehicle shape testing size using physics raycaster object. (Advanved Use Only) */
  2456. getShapeTestingSize(): float;
  2457. /** Sets the vehicle shape testing mode using physics raycaster object. (Advanved Use Only) */
  2458. setShapeTestingSize(size: float): void;
  2459. /** Gets vehicle shape test point count using physics raycaster object. (Advanved Use Only) */
  2460. getShapeTestingCount(): float;
  2461. /** Sets the vehicle shape test point count using physics raycaster object. (Advanved Use Only) */
  2462. setShapeTestingCount(count: float): void;
  2463. /** Gets vehicle sweep penetration amount using physics raycaster object. (Advanved Use Only) */
  2464. getSweepPenetration(): float;
  2465. /** Sets the vehicle sweep penetration amount using physics raycaster object. (Advanved Use Only) */
  2466. setSweepPenetration(amount: float): void;
  2467. /** Gets vehicle collision group filter using physics raycaster object. (Advanved Use Only) */
  2468. getCollisionFilterGroup(): number;
  2469. /** Sets vehicle collision group filter using physics raycaster object. (Advanved Use Only) */
  2470. setCollisionFilterGroup(group: number): void;
  2471. /** Gets vehicle collision mask filter using physics raycaster object. (Advanved Use Only) */
  2472. getCollisionFilterMask(): number;
  2473. /** Sets the vehicle collision mask filter using physics raycaster object. (Advanved Use Only) */
  2474. setCollisionFilterMask(mask: number): void;
  2475. /** Gets the internal wheel index by id string. */
  2476. getWheelIndexByID(id: string): number;
  2477. /** Gets the internal wheel index by name string. */
  2478. getWheelIndexByName(name: string): number;
  2479. /** Gets the internal wheel collider information. */
  2480. getWheelColliderInfo(wheel: number): number;
  2481. /** Sets the internal wheel hub transform mesh by index. Used to rotate and bounce wheels. */
  2482. setWheelTransformMesh(wheel: number, transform: BABYLON.TransformNode): void;
  2483. getVisualSteeringAngle(wheel: number): number;
  2484. setVisualSteeringAngle(angle: number, wheel: number): void;
  2485. getPhysicsSteeringAngle(wheel: number): number;
  2486. setPhysicsSteeringAngle(angle: number, wheel: number): void;
  2487. protected setupWheelInformation(defaultAngularFactor?: BABYLON.Vector3): void;
  2488. protected updateWheelInformation(): void;
  2489. protected lockedWheelInformation(wheel: number): boolean;
  2490. protected deleteWheelInformation(): void;
  2491. }
  2492. }
  2493. declare module BABYLON {
  2494. /**
  2495. * Babylon realtime reflection system pro class (Unity Style Realtime Reflection Probes)
  2496. * @class RealtimeReflection - All rights reserved (c) 2020 Mackey Kinard
  2497. */
  2498. class RealtimeReflection extends BABYLON.ScriptComponent {
  2499. private static SKYBOX_FLAG;
  2500. private renderList;
  2501. private probeList;
  2502. private refreshMode;
  2503. private cullingMask;
  2504. private clearFlags;
  2505. private probeid;
  2506. private useProbeList;
  2507. private includeChildren;
  2508. private resolution;
  2509. private boxPos;
  2510. private boxSize;
  2511. private boxProjection;
  2512. getProbeList(): BABYLON.AbstractMesh[];
  2513. getRenderList(): BABYLON.AbstractMesh[];
  2514. protected awake(): void;
  2515. protected start(): void;
  2516. protected destroy(): void;
  2517. protected awakeRealtimReflections(): void;
  2518. protected startRealtimReflections(): void;
  2519. protected destroyRealtimReflections(): void;
  2520. }
  2521. }
  2522. declare module BABYLON {
  2523. /**
  2524. * Babylon full rigidbody physics pro class (Native Bullet Physics 2.82)
  2525. * @class RigidbodyPhysics - All rights reserved (c) 2020 Mackey Kinard
  2526. */
  2527. class RigidbodyPhysics extends BABYLON.ScriptComponent {
  2528. private static TempAmmoVector;
  2529. private static TempAmmoVectorAux;
  2530. private static TempCenterTransform;
  2531. private _abstractMesh;
  2532. private _isKinematic;
  2533. private _maxCollisions;
  2534. private _isPhysicsReady;
  2535. private _collisionObject;
  2536. private _centerOfMass;
  2537. private _tmpLinearFactor;
  2538. private _tmpAngularFactor;
  2539. private _tmpCenterOfMass;
  2540. private _tmpGravityVector;
  2541. private _tmpCollisionContacts;
  2542. get isKinematic(): boolean;
  2543. get centerOfMass(): BABYLON.Vector3;
  2544. protected m_physicsWorld: any;
  2545. protected m_physicsEngine: BABYLON.IPhysicsEngine;
  2546. protected m_raycastVehicle: any;
  2547. protected awake(): void;
  2548. protected update(): void;
  2549. protected after(): void;
  2550. protected destroy(): void;
  2551. protected awakeRigidbodyState(): void;
  2552. protected updateRigidbodyState(): void;
  2553. protected afterRigidbodyState(): void;
  2554. protected destroyRigidbodyState(): void;
  2555. protected syncronizeVehicleController(): void;
  2556. protected parseBodyCollisionContacts(): void;
  2557. protected resetBodyCollisionContacts(): void;
  2558. /** Register handler that is triggered when the a collision contact has entered */
  2559. onCollisionEnterObservable: Observable<AbstractMesh>;
  2560. /** Register handler that is triggered when the a collision contact is active */
  2561. onCollisionStayObservable: Observable<AbstractMesh>;
  2562. /** Register handler that is triggered when the a collision contact has exited */
  2563. onCollisionExitObservable: Observable<AbstractMesh>;
  2564. /** Sets entity gravity value using physics impostor body. */
  2565. setGravity(gravity: BABYLON.Vector3): void;
  2566. /** Gets entity gravity value using physics impostor body. */
  2567. getGravity(): BABYLON.Nullable<BABYLON.Vector3>;
  2568. /** Gets entity gravity value using physics impostor body. */
  2569. getGravityToRef(result: BABYLON.Vector3): void;
  2570. /** Gets mass of entity using physics impostor. */
  2571. getMass(): number;
  2572. /** Sets mass to entity using physics impostor. */
  2573. setMass(mass: number): void;
  2574. /** Gets entity friction level using physics impostor. */
  2575. getFriction(): number;
  2576. /** Applies friction to entity using physics impostor. */
  2577. setFriction(friction: number): void;
  2578. /** Gets restitution of entity using physics impostor. */
  2579. getRestitution(): number;
  2580. /** Sets restitution to entity using physics impostor. */
  2581. setRestitution(restitution: number): void;
  2582. /** Gets entity linear velocity using physics impostor. */
  2583. getLinearVelocity(): BABYLON.Nullable<BABYLON.Vector3>;
  2584. /** Sets entity linear velocity using physics impostor. */
  2585. setLinearVelocity(velocity: BABYLON.Vector3): void;
  2586. /** Gets entity angular velocity using physics impostor. */
  2587. getAngularVelocity(): BABYLON.Nullable<BABYLON.Vector3>;
  2588. /** Sets entity angular velocity using physics impostor. */
  2589. setAngularVelocity(velocity: BABYLON.Vector3): void;
  2590. /** sets the native physics world transform object using physics impostor body. (Advanved Use Only) */
  2591. /** Gets the native physics world transform object using physics impostor body. (Advanved Use Only) */
  2592. /** Sets the entity world transform position using physics impostor body. (Advanved Use Only) */
  2593. /** Gets the entity world transform position using physics impostor body. (Advanved Use Only) */
  2594. /** Gets the entity world transform position using physics impostor body. (Advanved Use Only) */
  2595. /** Sets the entity world transform position using physics impostor body. (Advanved Use Only) */
  2596. /** Gets the entity world transform rotation using physics impostor body. (Advanved Use Only) */
  2597. /** Gets the entity world transform rotation using physics impostor body. (Advanved Use Only) */
  2598. clearForces(): void;
  2599. applyTorque(torque: BABYLON.Vector3): void;
  2600. applyLocalTorque(torque: BABYLON.Vector3): void;
  2601. applyImpulse(impulse: BABYLON.Vector3, rel_pos: BABYLON.Vector3): void;
  2602. applyCentralImpulse(impulse: BABYLON.Vector3): void;
  2603. applyTorqueImpulse(torque: BABYLON.Vector3): void;
  2604. applyForce(force: BABYLON.Vector3, rel_pos: BABYLON.Vector3): void;
  2605. applyCentralForce(force: BABYLON.Vector3): void;
  2606. applyCentralLocalForce(force: BABYLON.Vector3): void;
  2607. /** gets rigidbody center of mass */
  2608. getCenterOfMassTransform(): BABYLON.Vector3;
  2609. /** Sets rigidbody center of mass */
  2610. setCenterOfMassTransform(center: BABYLON.Vector3): void;
  2611. /** Gets entity linear factor using physics impostor body. */
  2612. getLinearFactor(): BABYLON.Vector3;
  2613. /** Sets entity linear factor using physics impostor body. */
  2614. setLinearFactor(factor: BABYLON.Vector3): void;
  2615. /** Gets entity angular factor using physics impostor body. */
  2616. getAngularFactor(): BABYLON.Vector3;
  2617. /** Sets entity angular factor using physics impostor body. */
  2618. setAngularFactor(factor: BABYLON.Vector3): void;
  2619. /** Gets entity angular damping using physics impostor body. */
  2620. getAngularDamping(): number;
  2621. /** Gets entity linear damping using physics impostor body. */
  2622. getLinearDamping(): number;
  2623. /** Sets entity drag damping using physics impostor body. */
  2624. setDamping(linear: number, angular: number): void;
  2625. /** Sets entity sleeping threshold using physics impostor body. */
  2626. setSleepingThresholds(linear: number, angular: number): void;
  2627. /** Checks if rigidbody has wheel collider metadata for the entity. Note: Wheel collider metadata informaion is required for vehicle control. */
  2628. hasWheelColliders(): boolean;
  2629. /** Sets the maximum number of simultaneous contact notfications to dispatch per frame. Defaults value is 4. (Advanved Use Only) */
  2630. setMaxNotifications(max: number): void;
  2631. /** Sets entity collision activation state using physics impostor body. (Advanved Use Only) */
  2632. setActivationState(state: number): void;
  2633. /** Gets entity collision filter group using physics impostor body. (Advanved Use Only) */
  2634. getCollisionFilterGroup(): number;
  2635. /** Sets entity collision filter group using physics impostor body. (Advanved Use Only) */
  2636. setCollisionFilterGroup(group: number): void;
  2637. /** Gets entity collision filter mask using physics impostor body. (Advanved Use Only) */
  2638. getCollisionFilterMask(): number;
  2639. /** Sets entity collision filter mask using physics impostor body. (Advanved Use Only) */
  2640. setCollisionFilterMask(mask: number): void;
  2641. /** Gets the entity collision shape type using physics impostor body. (Advanved Use Only) */
  2642. getCollisionShapeType(): number;
  2643. /** Gets the entity collision shape margin using physics impostor body. (Advanved Use Only) */
  2644. getCollisionShapeMargin(): number;
  2645. /** Sets entity collision shape margin using physics impostor body. (Advanved Use Only) */
  2646. setCollisionShapeMargin(margin: number): void;
  2647. /** Gets the entity contact processing threshold using physics impostor body. (Advanved Use Only) */
  2648. /** Sets entity contact processing threshold using physics impostor body. (Advanved Use Only) */
  2649. setContactProcessingThreshold(threshold: number): void;
  2650. /** TODO */
  2651. static CreatePhysicsMetadata(mass: number, drag?: number, angularDrag?: number, centerMass?: Vector3): any;
  2652. /** TODO */
  2653. static CreateCollisionMetadata(type: string, trigger?: boolean, convexmesh?: boolean, restitution?: number, dynamicfriction?: number, staticfriction?: number): any;
  2654. /** TODO */
  2655. static CreatePhysicsProperties(mass: number, drag?: number, angularDrag?: number, useGravity?: boolean, isKinematic?: boolean): any;
  2656. /** TODO */
  2657. static SetupPhysicsComponent(scene: BABYLON.Scene, entity: BABYLON.AbstractMesh): void;
  2658. private static ConfigRigidbodyPhysics;
  2659. }
  2660. /**
  2661. * Babylon collision contact info pro class (Native Bullet Physics 2.82)
  2662. * @class CollisionContactInfo - All rights reserved (c) 2020 Mackey Kinard
  2663. */
  2664. class CollisionContactInfo {
  2665. mesh: BABYLON.AbstractMesh;
  2666. state: number;
  2667. reset: boolean;
  2668. }
  2669. }
  2670. declare module BABYLON {
  2671. /**
  2672. * Babylon shuriken particle system pro class (Unity Style Shuriken Particle System)
  2673. * @class ShurikenParticles - All rights reserved (c) 2020 Mackey Kinard
  2674. */
  2675. class ShurikenParticles extends BABYLON.ScriptComponent {
  2676. protected awake(): void;
  2677. protected start(): void;
  2678. protected update(): void;
  2679. protected late(): void;
  2680. protected after(): void;
  2681. protected destroy(): void;
  2682. }
  2683. }
  2684. declare module BABYLON {
  2685. /**
  2686. * Babylon web video player pro class (Unity Style Shuriken Particle System)
  2687. * @class WebVideoPlayer - All rights reserved (c) 2020 Mackey Kinard
  2688. */
  2689. class WebVideoPlayer extends BABYLON.ScriptComponent {
  2690. getVideoMaterial(): BABYLON.StandardMaterial;
  2691. getVideoTexture(): BABYLON.VideoTexture;
  2692. getVideoElement(): HTMLVideoElement;
  2693. getVideoScreen(): BABYLON.AbstractMesh;
  2694. protected m_abstractMesh: BABYLON.AbstractMesh;
  2695. protected m_videoTexture: BABYLON.VideoTexture;
  2696. protected m_videoMaterial: BABYLON.StandardMaterial;
  2697. protected m_diffuseIntensity: number;
  2698. protected awake(): void;
  2699. protected destroy(): void;
  2700. protected awakeWebVideoPlayer(): void;
  2701. protected destroyWebVideoPlayer(): void;
  2702. /** Set web video player source */
  2703. setVideoSource(src: string | string[] | HTMLVideoElement, generateMipMaps?: boolean, invertY?: boolean, samplingMode?: number, settings?: BABYLON.VideoTextureSettings, volume?: number, speed?: number): void;
  2704. }
  2705. }