Skip to content

Commit

Permalink
Merge pull request #2 from BabylonJS/master
Browse files Browse the repository at this point in the history
Merge latest
  • Loading branch information
PolygonalSun authored Jan 14, 2021
2 parents 35ec711 + d3956c5 commit 53bb0fb
Show file tree
Hide file tree
Showing 327 changed files with 76,612 additions and 16,216 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,4 @@ ktx2Decoder/dist/
# Symlinks
inspector/src/sharedUiComponents/**/*
nodeEditor/src/sharedUiComponents/**/*
guiEditor/src/sharedUiComponents/**/*
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@
"runtimeArgs": [
"--enable-unsafe-es3-apis"
]
},
{
"name": "Launch GUI Editor (Chrome)",
"type": "chrome",
"request": "launch",
"url": "http://localhost:1338/guiEditor/public/index-local.html",
"webRoot": "${workspaceRoot}/",
"sourceMaps": true,
"preLaunchTask": "run",
"userDataDir": "${workspaceRoot}/.tempChromeProfileForDebug",
"runtimeArgs": [
"--enable-unsafe-es3-apis"
]
},
{
"name": "Launch Viewer (Chrome)",
Expand Down Expand Up @@ -107,6 +120,20 @@
"--enable-unsafe-es3-apis"
]
},
{
"name": "Launch playground (Chrome Canary)",
"type": "chrome",
"request": "launch",
"url": "http://localhost:1338/Playground/index-local.html",
"webRoot": "${workspaceRoot}/",
"sourceMaps": true,
"preLaunchTask": "run",
"userDataDir": "${workspaceRoot}/.tempChromeCanaryProfileForDebug",
"runtimeExecutable": "C:/Users/alexis/AppData/Local/Google/Chrome SxS/Application/Chrome.exe",
"runtimeArgs": [
"--enable-unsafe-es3-apis"
]
},
{
"name": "Launch playground (Edge)",
"type": "edge",
Expand Down
1 change: 1 addition & 0 deletions Playground/frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<script src="https://preview.babylonjs.com/babylon.js"></script>
<script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>
<script src="https://preview.babylonjs.com/nodeEditor/babylon.nodeEditor.js"></script>
<script src="https://preview.babylonjs.com/guiEditor/babylon.guiEditor.js"></script>
<script src="https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js"></script>
<script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js"></script>
<script src="https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.min.js"></script>
Expand Down
1 change: 1 addition & 0 deletions Playground/full.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<script src="https://preview.babylonjs.com/babylon.js"></script>
<script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>
<script src="https://preview.babylonjs.com/nodeEditor/babylon.nodeEditor.js"></script>
<script src="https://preview.babylonjs.com/guiEditor/babylon.guiEditor.js"></script>
<script src="https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js"></script>
<script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js"></script>
<script src="https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.min.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion Playground/index-local.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
wasmUASTCToRGBA_UNORM: GetAbsoluteUrl("../dist/preview%20release/ktx2Transcoders/uastc_rgba32_unorm.wasm"),
wasmUASTCToRGBA_SRGB: GetAbsoluteUrl("../dist/preview%20release/ktx2Transcoders/uastc_rgba32_srgb.wasm"),
jsMSCTranscoder: GetAbsoluteUrl("../dist/preview%20release/ktx2Transcoders/msc_basis_transcoder.js"),
wasmMSCTranscoder: GetAbsoluteUrl("../dist/preview%20release/ktx2Transcoders/msc_basis_transcoder.wasm")
wasmMSCTranscoder: GetAbsoluteUrl("../dist/preview%20release/ktx2Transcoders/msc_basis_transcoder.wasm"),
wasmZSTDDecoder: GetAbsoluteUrl("../dist/preview%20release/zstddec.wasm"),
};
});
</script>
Expand Down
1 change: 1 addition & 0 deletions Playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>
<script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
<script src="https://preview.babylonjs.com/nodeEditor/babylon.nodeEditor.js"></script>
<script src="https://preview.babylonjs.com/guiEditor/babylon.guiEditor.js"></script>

<!-- Extensions -->
<script
Expand Down
1 change: 1 addition & 0 deletions Playground/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var Versions = {
"https://preview.babylonjs.com/gui/babylon.gui.min.js",
"https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js",
"https://preview.babylonjs.com/nodeEditor/babylon.nodeEditor.js",
"https://preview.babylonjs.com/guiEditor/babylon.guiEditor.js",
"https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js",
"https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js",
"https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.min.js",
Expand Down
50 changes: 21 additions & 29 deletions Playground/libs/babylon.manager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ declare module BABYLON {
static GetTransformNode(scene: BABYLON.Scene, name: string): BABYLON.TransformNode;
/** Gets the specified transform node by id from scene. */
static GetTransformNodeByID(scene: BABYLON.Scene, id: string): BABYLON.TransformNode;
/** Gets the transform node child detail mesh. */
static GetTransformDetailMesh(transform: TransformNode): BABYLON.AbstractMesh;
/** Gets the transform node primitive meshes. */
static GetPrimitiveMeshes(transform: TransformNode): BABYLON.AbstractMesh[];
/** Gets the specified transform node primary layer index. */
Expand Down Expand Up @@ -1475,19 +1477,19 @@ declare module BABYLON {
/** Set animation target property */
static SetAnimationTargetProperty(animation: BABYLON.Animation, property: string): void;
/** Gets the float "result" as the sampled key frame value for the specfied animation track. */
static SampleAnimationFloat(animation: BABYLON.Animation, frame: number): number;
static SampleAnimationFloat(animation: BABYLON.Animation, time: number): number;
/** Set the passed vector2 "result" as the sampled key frame value for the specfied animation track. */
static SampleAnimationVector2(animation: BABYLON.Animation, frame: number): BABYLON.Vector2;
static SampleAnimationVector2(animation: BABYLON.Animation, time: number): BABYLON.Vector2;
/** Set the passed vector3 "result" as the sampled key frame value for the specfied animation track. */
static SampleAnimationVector3(animation: BABYLON.Animation, frame: number): BABYLON.Vector3;
static SampleAnimationVector3(animation: BABYLON.Animation, time: number): BABYLON.Vector3;
/** Set the passed quaternion "result" as the sampled key frame value for the specfied animation track. */
static SampleAnimationQuaternion(animation: BABYLON.Animation, frame: number): BABYLON.Quaternion;
static SampleAnimationQuaternion(animation: BABYLON.Animation, time: number): BABYLON.Quaternion;
/** Set the passed matrix "result" as the sampled key frame value for the specfied animation track. */
static SampleAnimationMatrix(animation: BABYLON.Animation, frame: number): BABYLON.Matrix;
static SampleAnimationMatrix(animation: BABYLON.Animation, time: number): BABYLON.Matrix;
/** Creates a targeted float animation for tweening. */
static CreateFloatAnimation(name: string, targetProperty: string, startValue: number, endValue: number, frameRate?: number, loopMode?: number): BABYLON.Animation;
static CreateTweenAnimation(name: string, targetProperty: string, startValue: number, endValue: number, frameRate?: number, loopMode?: number): BABYLON.Animation;
/** Gets the last key frame index value. */
static GetLastKeyFrameIndex(animation: BABYLON.Animation): number;
static GetLastKeyFrameValue(animation: BABYLON.Animation): number;
/** Private internal frame interpolation helper */
private static InterpolateAnimation;
/** Initialize default shader material properties */
Expand Down Expand Up @@ -2293,20 +2295,24 @@ declare module BABYLON {
heightOffset: number;
angularSpeed: number;
updatePosition: boolean;
updateRotation: boolean;
distanceEpsilon: number;
velocityEpsilon: number;
offMeshVelocity: number;
stoppingDistance: number;
isReady(): boolean;
isNavigating(): boolean;
isOnOffMeshLink(): boolean;
getAgentType(): number;
getAgentState(): number;
getAgentIndex(): number;
getAgentRadius(): number;
getAgentHeight(): number;
getAgentSpeed(): number;
getAgentOffset(): number;
getTargetDistance(): number;
getAgentParameters(): BABYLON.IAgentParameters;
setAgentParameters(parameters: BABYLON.IAgentParameters): void;
protected m_agentState: number;
protected m_agentIndex: number;
protected m_agentReady: boolean;
protected m_agentGhost: BABYLON.TransformNode;
protected m_agentParams: BABYLON.IAgentParameters;
protected m_agentRotation: BABYLON.Quaternion;
Expand All @@ -2315,8 +2321,10 @@ declare module BABYLON {
protected m_agentQuaternion: BABYLON.Quaternion;
protected m_agentDestination: BABYLON.Vector3;
protected awake(): void;
protected update(): void;
protected late(): void;
protected destroy(): void;
/** Register handler that is triggered when the agent is ready for navigation */
onReadyObservable: Observable<TransformNode>;
/** Register handler that is triggered before the navigation update */
onPreUpdateObservable: Observable<TransformNode>;
/** Register handler that is triggered after the navigation update */
Expand All @@ -2325,13 +2333,14 @@ declare module BABYLON {
onNavCompleteObservable: Observable<TransformNode>;
private awakeNavigationAgent;
private updateNavigationAgent;
private updateAgentParameters;
private destroyNavigationAgent;
/** Move agent relative to current position. */
move(offset: BABYLON.Vector3, closetPoint?: boolean): void;
/** Teleport agent to destination point. */
teleport(destination: BABYLON.Vector3, closetPoint?: boolean): void;
/** Sets agent current destination point. */
setDestination(destination: BABYLON.Vector3, closetPoint?: boolean, resetAgent?: boolean): void;
setDestination(destination: BABYLON.Vector3, closetPoint?: boolean): void;
/** Gets agent current world space velocity. */
getAgentVelocity(): BABYLON.Vector3;
/** Gets agent current world space velocity. */
Expand Down Expand Up @@ -2662,23 +2671,6 @@ declare module BABYLON {
}
}

declare module BABYLON {
/**
* Babylon window socket controller pro class (Socket.IO)
* @class SocketController - All rights reserved (c) 2020 Mackey Kinard
*/
class SocketController {
/** Registers an handler for window socket connect event */
static RegisterOnSocketConnect(func: () => void): void;
/** Registers an handler for window socket disconnect event */
static RegisterOnSocketDisconnect(func: () => void): void;
/** Connects a window state socket */
static ConnectWindowSocket(connection: string): SocketIOClient.Socket;
/** Get the window state socket */
static GetWindowSocket(): SocketIOClient.Socket;
}
}

declare module BABYLON {
/**
* Babylon web video player pro class (Unity Style Shuriken Particle System)
Expand Down
22 changes: 11 additions & 11 deletions Playground/libs/babylon.manager.js

Large diffs are not rendered by default.

Binary file added Playground/scenes/cubeMorph_8target.glb
Binary file not shown.
4 changes: 4 additions & 0 deletions Playground/src/components/commandBarComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export class CommandBarComponent extends React.Component<ICommandBarComponentPro
let activeVersion = Utilities.ReadStringFromStore("version", "Latest");
let activeEngineVersion = Utilities.ReadStringFromStore("engineVersion", "WebGL2");

if (location.href.indexOf("webgpu") !== -1 && !!navigator.gpu) {
activeEngineVersion = "WebGPU";
}

var versionOptions = Object.keys(Versions).map(key => {
return {
label: key,
Expand Down
61 changes: 59 additions & 2 deletions Tools/Config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"serializers",
"gui",
"inspector",
"nodeEditor"
"nodeEditor",
"guiEditor"
],
"es6modules": [
"core",
Expand All @@ -60,7 +61,8 @@
"gui",
"inspector",
"viewer",
"nodeEditor"
"nodeEditor",
"guiEditor"
],
"apps": [
"playground",
Expand Down Expand Up @@ -651,6 +653,61 @@
}
}
},
"guiEditor": {
"libraries": [
{
"output": "babylon.guiEditor.js",
"entry": "./legacy/legacy.ts"
}
],
"build": {
"ignoreInWorkerMode": true,
"ignoreInTestMode": true,
"mainFolder": "./guiEditor/",
"uncheckedLintImports": [
"react",
"react-dom",
"dagre",
"re-resizable",
"glTF",
"file-saver"
],
"sharedUiComponents": "src/sharedUiComponents/",
"umd": {
"packageName": "babylonjs-gui-editor",
"webpackRoot": "GUIEDITOR",
"processDeclaration": {
"filename": "babylon.guiEditor.module.d.ts",
"moduleName": "GUIEDITOR",
"importsToRemove": [],
"classMap": {
"babylonjs": "BABYLON",
"react": "React",
"@babylonjs/core": "BABYLON",
"@fortawesome": false,
"react-contextmenu": false
}
}
},
"es6": {
"webpackBuild": true,
"buildDependencies": [
"node_modules/re-resizable/lib/index.es5.js",
"Tools/**/*"
],
"packageName": "@babylonjs/gui-editor",
"readme": "dist/preview release/guiEditor/readme-es6.md",
"packagesFiles": [
"babylon.guiEditor.max.js",
"babylon.guiEditor.max.js.map",
"babylon.guiEditor.module.d.ts",
"readme.md"
],
"typings": "babylon.guiEditor.module.d.ts",
"index": "babylon.guiEditor.max.js"
}
}
},
"ktx2Decoder": {
"tempFileName": "babylon.ktx2Decoder.js",
"distFile": "/dist/preview release/babylon.ktx2Decoder.js",
Expand Down
3 changes: 1 addition & 2 deletions Viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@
"base64-image-loader": "^1.2.1",
"base64-inline-loader": "^1.1.1",
"deepmerge": "~2.1.1",
"handlebars": "^4.5.1",
"handlebars": "^4.7.6",
"html-loader": "^0.5.5",
"json-loader": "^0.5.7",
"ts-loader": "^4.4.0",
"uglifyjs-webpack-plugin": "^1.2.2",
"webpack": "^4.29.3",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.1.14"
Expand Down
2 changes: 1 addition & 1 deletion Viewer/src/templating/templateManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ export class Template {
selector = this.parent.tagName;
}
let binding = functionToFire.bind(this, selector);
this.parent.addEventListener(eventName, functionToFire.bind(this, selector), false);
this.parent.addEventListener(eventName, binding, false);
this._registeredEvents.push({
htmlElement: this.parent,
eventName: eventName,
Expand Down
6 changes: 4 additions & 2 deletions Viewer/tests/validation/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ function init() {
wasmUASTCToRGBA_UNORM: GetAbsoluteUrl("../../dist/preview%20release/ktx2Transcoders/uastc_rgba32_unorm.wasm"),
wasmUASTCToRGBA_SRGB: GetAbsoluteUrl("../../dist/preview%20release/ktx2Transcoders/uastc_rgba32_srgb.wasm"),
jsMSCTranscoder: GetAbsoluteUrl("../../dist/preview%20release/ktx2Transcoders/msc_basis_transcoder.js"),
wasmMSCTranscoder: GetAbsoluteUrl("../../dist/preview%20release/ktx2Transcoders/msc_basis_transcoder.wasm")
wasmMSCTranscoder: GetAbsoluteUrl("../../dist/preview%20release/ktx2Transcoders/msc_basis_transcoder.wasm"),
wasmZSTDDecoder: GetAbsoluteUrl("../../dist/preview%20release/zstddec.wasm"),
};

BABYLON.KhronosTextureContainer2.URLConfig = {
Expand All @@ -330,7 +331,8 @@ function init() {
wasmUASTCToRGBA_UNORM: GetAbsoluteUrl("../../dist/preview%20release/ktx2Transcoders/uastc_rgba32_unorm.wasm"),
wasmUASTCToRGBA_SRGB: GetAbsoluteUrl("../../dist/preview%20release/ktx2Transcoders/uastc_rgba32_srgb.wasm"),
jsMSCTranscoder: GetAbsoluteUrl("../../dist/preview%20release/ktx2Transcoders/msc_basis_transcoder.js"),
wasmMSCTranscoder: GetAbsoluteUrl("../../dist/preview%20release/ktx2Transcoders/msc_basis_transcoder.wasm")
wasmMSCTranscoder: GetAbsoluteUrl("../../dist/preview%20release/ktx2Transcoders/msc_basis_transcoder.wasm"),
wasmZSTDDecoder: GetAbsoluteUrl("../../dist/preview%20release/zstddec.wasm"),
};

viewerElement = document.createElement("babylon");
Expand Down
Loading

0 comments on commit 53bb0fb

Please sign in to comment.