Skip to content

Commit 25051bc

Browse files
deltakoshAlex-MSFTryantremRaananWbghgary
authored
Nightly (#8761)
* Expose feature points in BabylonJS as a native extension. * Expose setFeaturePointCloudEnabled in XRSession, and add it to the startup routine for the feature * Add some comments and minor cleanup * Fix some minor spacing issues * Add id to feature point data. * fix indexing of confidence value and ID. * Maintain feature point cloud across frames, signal with our collection every frame. * Change onFeaturePointsUpdatedObservable to signal with a list of updated Ids so that we can keep track what has changed between frames. * Fix doubled size array from doing both a distinct size declaration and .push. * Add in doc describing implementation of FeaturePoints into LibDeclarations. * Cleanup, make exposed array readonly and use private member variable to do internal accounting. * Updating What's new, and move private member variable to unbreak typedoc. * Apply suggestions from code review Co-authored-by: Ryan Tremblay <[email protected]> * Address PR comments. Split feature point updates into added, and updated. * Change setFeaturePointCloudEnabled to trySetFeaturePointEnabled. * Optional entity types array for XR hit-test * Address PR comments. * Make feature names readonly. * Make it so ids do not need to be sequential. * Add option in default pipeline property grid to convert cc to gamma or linear * Nightly * Nightly * Update KHR_materials_variants to latest spec (#8739) * remove reset button for variants * Fix thin instance bounding info computation (#8740) * Nightly * Add some precision to the doc of onMeshLoaded callback / observable (#8743) * Allow enabling the stencil buffer when using CreateScreenshotUsingRenderTarget (#8748) * fix updateOptions issue (#8746) * Optional entity types array for XR hit-test * fix updateOptions issue * linting * remove unneeded character * 4.2.0-alpha.33 * Update sphereBuilder.ts (#8750) * Update sphereBuilder.ts Fix sphereBuilder adding 6 indices to the top and bottom segments of sphere (even there's only 1 triangle) * Update what's new.md (#12) * Update sphereBuilder.ts * Fix linting * expose overlay, add css class * say what say waht say what is new (what is new!) * Update webXREnterExitUI.ts * [XR] Make sure any model will work with the controller loop (#8758) * Optional entity types array for XR hit-test * defensively dealing with missing valueMesh (thou unlikely) * Fix playground examples loading (#8756) * Optional entity types array for XR hit-test * Fix example-loading issues * Flat tangent (#8751) * Flat tangent * Whats new * whats new Co-authored-by: Alejandro Toledo <[email protected]> * [XR] WebXR Hand Tracking - initial support (#8753) * Optional entity types array for XR hit-test * hand tracking declaration * depends on and hand tracking name * defensive * added the hand tracking feature * nuwat * fix non-supporting-system issue * make sure model is disposedif the controller is already disposed * disable pointer selection for hand tracking * new observers, physics config * documentation * linting * code doc * fixing the d.ts issue * extends instead of implements * Fix potential recursive calls (#8757) * nightly * [XR] Setting default values for the XR creation context (#8759) Stencil state is takes from the engine (or overridden) * KTX2 transcoders (#8760) * Fix potential recursive calls * Add the ktx2 transcoders * Nightly * Nightly Co-authored-by: Alex Tran <[email protected]> Co-authored-by: Ryan Tremblay <[email protected]> Co-authored-by: Raanan Weber <[email protected]> Co-authored-by: Gary Hsu <[email protected]> Co-authored-by: Popov72 <[email protected]> Co-authored-by: aWeirdo <[email protected]> Co-authored-by: Alejandro Toledo Martinez <[email protected]> Co-authored-by: Alejandro Toledo <[email protected]>
1 parent b18125e commit 25051bc

38 files changed

+2595
-478
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import * as React from "react";
2-
import { GlobalState } from '../globalState';
2+
import { GlobalState } from "../globalState";
33

44
require("../scss/examples.scss");
55

66
interface IExamplesComponentProps {
77
globalState: GlobalState;
88
}
99

10-
export class ExamplesComponent extends React.Component<IExamplesComponentProps, {filter: string}> {
10+
export class ExamplesComponent extends React.Component<IExamplesComponentProps, { filter: string }> {
1111
private _state = "removed";
1212
private _rootRef: React.RefObject<HTMLDivElement>;
1313
private _scripts: {
@@ -19,13 +19,13 @@ export class ExamplesComponent extends React.Component<IExamplesComponentProps,
1919
PGID: string;
2020
description: string;
2121
}[];
22-
}[];
23-
22+
}[];
23+
2424
public constructor(props: IExamplesComponentProps) {
2525
super(props);
2626
this._loadScripts();
2727

28-
this.state = {filter: ""};
28+
this.state = { filter: "" };
2929
this._rootRef = React.createRef();
3030

3131
this.props.globalState.onExamplesDisplayChangedObservable.add(() => {
@@ -40,18 +40,18 @@ export class ExamplesComponent extends React.Component<IExamplesComponentProps,
4040
this._state = "";
4141
setTimeout(() => {
4242
this._rootRef.current!.classList.add("removed");
43-
}, 200)
43+
}, 200);
4444
}
4545
});
46-
}
46+
}
4747

4848
private _loadScripts() {
4949
var xhr = new XMLHttpRequest();
5050

5151
if (this.props.globalState.language === "JS") {
52-
xhr.open('GET', 'https://raw.githubusercontent.com/BabylonJS/Documentation/master/examples/list.json', true);
52+
xhr.open("GET", "https://raw.githubusercontent.com/BabylonJS/Documentation/master/examples/list.json", true);
5353
} else {
54-
xhr.open('GET', 'https://raw.githubusercontent.com/BabylonJS/Documentation/master/examples/list_ts.json', true);
54+
xhr.open("GET", "https://raw.githubusercontent.com/BabylonJS/Documentation/master/examples/list_ts.json", true);
5555
}
5656

5757
xhr.onreadystatechange = () => {
@@ -66,7 +66,7 @@ export class ExamplesComponent extends React.Component<IExamplesComponentProps,
6666
return 1;
6767
});
6868

69-
this._scripts.forEach(s => {
69+
this._scripts.forEach((s) => {
7070
s.samples.sort((a, b) => {
7171
if (a.title < b.title) {
7272
return -1;
@@ -78,12 +78,11 @@ export class ExamplesComponent extends React.Component<IExamplesComponentProps,
7878
this.forceUpdate();
7979
}
8080
}
81-
}
81+
};
8282

8383
xhr.send(null);
8484
}
8585

86-
8786
private _onLoadPG(id: string) {
8887
this.props.globalState.onLoadRequiredObservable.notifyObservers(id);
8988

@@ -101,46 +100,46 @@ export class ExamplesComponent extends React.Component<IExamplesComponentProps,
101100
<div id="examples" className={this._state} ref={this._rootRef}>
102101
<div id="examples-header">Examples</div>
103102
<div id="examples-filter">
104-
<input id="examples-filter-text" type="text" placeholder="Filter examples" value={this.state.filter} onChange={evt => {
105-
this.setState({filter: evt.target.value});
106-
}}/>
103+
<input
104+
id="examples-filter-text"
105+
type="text"
106+
placeholder="Filter examples"
107+
value={this.state.filter}
108+
onChange={(evt) => {
109+
this.setState({ filter: evt.target.value });
110+
}}
111+
/>
107112
</div>
108113
<div id="examples-list">
109-
{
110-
this._scripts.map(s => {
111-
let active = s.samples.filter(ss => {
112-
return !this.state.filter
113-
|| ss.title.toLowerCase().indexOf(this.state.filter.toLowerCase()) !== -1
114-
|| ss.description.toLowerCase().indexOf(this.state.filter.toLowerCase()) !== -1
115-
});
116-
117-
if (active.length === 0) {
118-
return null;
119-
}
114+
{this._scripts.map((s) => {
115+
let active = s.samples.filter((ss) => {
116+
return !this.state.filter || ss.title.toLowerCase().indexOf(this.state.filter.toLowerCase()) !== -1 || ss.description.toLowerCase().indexOf(this.state.filter.toLowerCase()) !== -1;
117+
});
118+
119+
if (active.length === 0) {
120+
return null;
121+
}
120122

121-
return(
122-
<div key={s.title} className="example-category">
123-
<div className="example-category-title">
124-
{s.title}
125-
</div>
126-
{
127-
active.map(ss => {
128-
return (
129-
<div className="example" key={ss.title} onClick={() => this._onLoadPG(ss.PGID)}>
130-
<img src={ss.icon.replace("icons", "https://doc.babylonjs.com/examples/icons")}/>
131-
<div className="example-title">{ss.title}</div>
132-
<div className="example-description">{ss.description}</div>
133-
<a className="example-link" href={ss.doc} target="_blank">Documentation</a>
134-
</div>
135-
)
136-
})
137-
}
138-
</div>
139-
)
140-
})
141-
}
123+
return (
124+
<div key={s.title} className="example-category">
125+
<div className="example-category-title">{s.title}</div>
126+
{active.map((ss) => {
127+
return (
128+
<div className="example" key={ss.title} onClick={() => this._onLoadPG(ss.PGID)}>
129+
<img src={ss.icon.replace("icons", "https://doc.babylonjs.com/examples/icons")} />
130+
<div className="example-title">{ss.title}</div>
131+
<div className="example-description">{ss.description}</div>
132+
<a className="example-link" href={ss.doc} target="_blank">
133+
Documentation
134+
</a>
135+
</div>
136+
);
137+
})}
138+
</div>
139+
);
140+
})}
142141
</div>
143142
</div>
144-
)
143+
);
145144
}
146-
}
145+
}

Playground/src/tools/loadManager.ts

+24-18
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
import { GlobalState } from '../globalState';
2-
import { Utilities } from './utilities';
1+
import { GlobalState } from "../globalState";
2+
import { Utilities } from "./utilities";
33

44
export class LoadManager {
55
private _previousHash = "";
66

7-
public constructor(public globalState: GlobalState) {
8-
// Check the url to prepopulate data
7+
public constructor(public globalState: GlobalState) {
8+
// Check the url to prepopulate data
99
this._checkHash();
1010
window.addEventListener("hashchange", () => this._checkHash());
1111

12-
globalState.onLoadRequiredObservable.add(id => {
12+
globalState.onLoadRequiredObservable.add((id) => {
1313
globalState.onDisplayWaitRingObservable.notifyObservers(true);
1414
this._loadPlayground(id);
1515
});
1616
}
1717

1818
private _cleanHash() {
19-
var substr = location.hash[1]==='#' ? 2 : 1
19+
var substr = location.hash[1] === "#" ? 2 : 1;
2020
var splits = decodeURIComponent(location.hash.substr(substr)).split("#");
2121

2222
if (splits.length > 2) {
2323
splits.splice(2, splits.length - 2);
2424
}
2525

2626
location.hash = splits.join("#");
27-
};
27+
}
2828

2929
private _checkHash() {
3030
let pgHash = "";
31-
if (location.search && (!location.pathname || location.pathname === '/') && !location.hash) {
31+
if (location.search && (!location.pathname || location.pathname === "/") && !location.hash) {
3232
var query = Utilities.ParseQuery();
3333
if (query.pg) {
34-
pgHash = "#" + query.pg + "#" + (query.revision || "0")
34+
pgHash = "#" + query.pg + "#" + (query.revision || "0");
3535
}
3636
} else if (location.hash) {
3737
if (this._previousHash !== location.hash) {
@@ -52,27 +52,27 @@ export class LoadManager {
5252
if (pgHash) {
5353
var match = pgHash.match(/^(#[A-Za-z\d]*)(%23)([\d]+)$/);
5454
if (match) {
55-
pgHash = match[1] + '#' + match[3];
55+
pgHash = match[1] + "#" + match[3];
5656
parent.location.hash = pgHash;
5757
}
5858
this._previousHash = pgHash;
5959
this._loadPlayground(pgHash.substr(1));
60-
}
60+
}
6161
}
6262

63-
private _loadPlayground(id: string) {
63+
private _loadPlayground(id: string) {
6464
this.globalState.loadingCodeInProgress = true;
6565
try {
6666
var xmlHttp = new XMLHttpRequest();
6767
xmlHttp.onreadystatechange = () => {
6868
if (xmlHttp.readyState === 4) {
6969
if (xmlHttp.status === 200) {
70-
7170
if (xmlHttp.responseText.indexOf("class Playground") !== -1) {
7271
if (this.globalState.language === "JS") {
7372
Utilities.SwitchLanguage("TS", this.globalState);
7473
}
75-
} else { // If we're loading JS content and it's TS page
74+
} else {
75+
// If we're loading JS content and it's TS page
7676
if (this.globalState.language === "TS") {
7777
Utilities.SwitchLanguage("JS", this.globalState);
7878
}
@@ -100,20 +100,26 @@ export class LoadManager {
100100
}
101101

102102
this.globalState.onCodeLoaded.notifyObservers(JSON.parse(snippet.jsonPayload).code.toString());
103-
103+
104104
this.globalState.onMetadataUpdatedObservable.notifyObservers();
105105
}
106106
}
107+
};
108+
109+
if (id[0] === "#") {
110+
id = id.substr(1);
107111
}
108112

109113
this.globalState.currentSnippetToken = id.split("#")[0];
110-
if (!id.split("#")[1]) id += "#0";
114+
if (!id.split("#")[1]) {
115+
id += "#0";
116+
}
111117

112-
xmlHttp.open("GET", this.globalState.SnippetServerUrl + "/" + id.replace("#", "/"));
118+
xmlHttp.open("GET", this.globalState.SnippetServerUrl + "/" + id.replace(/#/g, "/"));
113119
xmlHttp.send();
114120
} catch (e) {
115121
this.globalState.loadingCodeInProgress = false;
116122
this.globalState.onCodeLoaded.notifyObservers("");
117123
}
118124
}
119-
}
125+
}

dist/ktx2Transcoders/msc_basis_transcoder.js

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
394 KB
Binary file not shown.

dist/ktx2Transcoders/uastc_astc.wasm

13.3 KB
Binary file not shown.

dist/ktx2Transcoders/uastc_bc7.wasm

17.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)