Skip to content

Commit c969c2e

Browse files
deltakoshAlex-MSFTryantrembghgaryRaananW
authored
Nightly (#8742)
* 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. * 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 Co-authored-by: Alex Tran <[email protected]> Co-authored-by: Ryan Tremblay <[email protected]> Co-authored-by: Gary Hsu <[email protected]> Co-authored-by: Raanan Weber <[email protected]> Co-authored-by: Popov72 <[email protected]>
1 parent 6fdb8c8 commit c969c2e

35 files changed

+1182
-169
lines changed

dist/preview release/babylon.d.ts

+103-15
Original file line numberDiff line numberDiff line change
@@ -47090,31 +47090,35 @@ declare module BABYLON {
4709047090
/**
4709147091
* The name of the anchor system feature
4709247092
*/
47093-
static ANCHOR_SYSTEM: string;
47093+
static readonly ANCHOR_SYSTEM: string;
4709447094
/**
4709547095
* The name of the background remover feature
4709647096
*/
47097-
static BACKGROUND_REMOVER: string;
47097+
static readonly BACKGROUND_REMOVER: string;
4709847098
/**
4709947099
* The name of the hit test feature
4710047100
*/
47101-
static HIT_TEST: string;
47101+
static readonly HIT_TEST: string;
4710247102
/**
4710347103
* physics impostors for xr controllers feature
4710447104
*/
47105-
static PHYSICS_CONTROLLERS: string;
47105+
static readonly PHYSICS_CONTROLLERS: string;
4710647106
/**
4710747107
* The name of the plane detection feature
4710847108
*/
47109-
static PLANE_DETECTION: string;
47109+
static readonly PLANE_DETECTION: string;
4711047110
/**
4711147111
* The name of the pointer selection feature
4711247112
*/
47113-
static POINTER_SELECTION: string;
47113+
static readonly POINTER_SELECTION: string;
4711447114
/**
4711547115
* The name of the teleportation feature
4711647116
*/
47117-
static TELEPORTATION: string;
47117+
static readonly TELEPORTATION: string;
47118+
/**
47119+
* The name of the feature points feature.
47120+
*/
47121+
static readonly FEATURE_POINTS: string;
4711847122
}
4711947123
/**
4712047124
* Defining the constructor of a feature. Used to register the modules.
@@ -48827,7 +48831,7 @@ declare module BABYLON {
4882748831
/**
4882848832
* The module's name
4882948833
*/
48830-
static readonly Name: string;
48834+
static readonly Name: string;
4883148835
/**
4883248836
* The (Babylon) version of this module.
4883348837
* This is an integer representing the implementation version.
@@ -49354,7 +49358,7 @@ declare module BABYLON {
4935449358
/**
4935549359
* The module's name
4935649360
*/
49357-
static readonly Name: string;
49361+
static readonly Name: string;
4935849362
/**
4935949363
* The (Babylon) version of this module.
4936049364
* This is an integer representing the implementation version.
@@ -74123,7 +74127,7 @@ declare module BABYLON {
7412374127
/**
7412474128
* The module's name
7412574129
*/
74126-
static readonly Name: string;
74130+
static readonly Name: string;
7412774131
/**
7412874132
* The (Babylon) version of this module.
7412974133
* This is an integer representing the implementation version.
@@ -74265,7 +74269,7 @@ declare module BABYLON {
7426574269
/**
7426674270
* The module's name
7426774271
*/
74268-
static readonly Name: string;
74272+
static readonly Name: string;
7426974273
/**
7427074274
* The (Babylon) version of this module.
7427174275
* This is an integer representing the implementation version.
@@ -74367,7 +74371,7 @@ declare module BABYLON {
7436774371
/**
7436874372
* The module's name
7436974373
*/
74370-
static readonly Name: string;
74374+
static readonly Name: string;
7437174375
/**
7437274376
* The (Babylon) version of this module.
7437374377
* This is an integer representing the implementation version.
@@ -74498,7 +74502,7 @@ declare module BABYLON {
7449874502
/**
7449974503
* The module's name
7450074504
*/
74501-
static readonly Name: string;
74505+
static readonly Name: string;
7450274506
/**
7450374507
* The (Babylon) version of this module.
7450474508
* This is an integer representing the implementation version.
@@ -74584,7 +74588,7 @@ declare module BABYLON {
7458474588
/**
7458574589
* The module's name
7458674590
*/
74587-
static readonly Name: string;
74591+
static readonly Name: string;
7458874592
/**
7458974593
* The (Babylon) version of this module.
7459074594
* This is an integer representing the implementation version.
@@ -74714,7 +74718,7 @@ declare module BABYLON {
7471474718
/**
7471574719
* The module's name
7471674720
*/
74717-
static readonly Name: string;
74721+
static readonly Name: string;
7471874722
/**
7471974723
* The (Babylon) version of this module.
7472074724
* This is an integer representing the implementation version.
@@ -74781,6 +74785,79 @@ declare module BABYLON {
7478174785
private _detachController;
7478274786
}
7478374787
}
74788+
declare module BABYLON {
74789+
/**
74790+
* A babylon interface for a "WebXR" feature point.
74791+
* Represents the position and confidence value of a given feature point.
74792+
*/
74793+
export interface IWebXRFeaturePoint {
74794+
/**
74795+
* Represents the position of the feature point in world space.
74796+
*/
74797+
position: Vector3;
74798+
/**
74799+
* Represents the confidence value of the feature point in world space. 0 being least confident, and 1 being most confident.
74800+
*/
74801+
confidenceValue: number;
74802+
}
74803+
/**
74804+
* The feature point system is used to detect feature points from real world geometry.
74805+
* This feature is currently experimental and only supported on BabylonNative, and should not be used in the browser.
74806+
* The newly introduced API can be seen in webxr.nativeextensions.d.ts and described in FeaturePoints.md.
74807+
*/
74808+
export class WebXRFeaturePointSystem extends WebXRAbstractFeature {
74809+
private _enabled;
74810+
private _featurePointCloud;
74811+
/**
74812+
* The module's name
74813+
*/
74814+
static readonly Name: string;
74815+
/**
74816+
* The (Babylon) version of this module.
74817+
* This is an integer representing the implementation version.
74818+
* This number does not correspond to the WebXR specs version
74819+
*/
74820+
static readonly Version: number;
74821+
/**
74822+
* Observers registered here will be executed whenever new feature points are added (on XRFrame while the session is tracking).
74823+
* Will notify the observers about which feature points have been added.
74824+
*/
74825+
readonly onFeaturePointsAddedObservable: Observable<number[]>;
74826+
/**
74827+
* Observers registered here will be executed whenever a feature point has been updated (on XRFrame while the session is tracking).
74828+
* Will notify the observers about which feature points have been updated.
74829+
*/
74830+
readonly onFeaturePointsUpdatedObservable: Observable<number[]>;
74831+
/**
74832+
* The current feature point cloud maintained across frames.
74833+
*/
74834+
get featurePointCloud(): Array<IWebXRFeaturePoint>;
74835+
/**
74836+
* construct the feature point system
74837+
* @param _xrSessionManager an instance of xr Session manager
74838+
*/
74839+
constructor(_xrSessionManager: WebXRSessionManager);
74840+
/**
74841+
* Detach this feature.
74842+
* Will usually be called by the features manager
74843+
*
74844+
* @returns true if successful.
74845+
*/
74846+
detach(): boolean;
74847+
/**
74848+
* Dispose this feature and all of the resources attached
74849+
*/
74850+
dispose(): void;
74851+
/**
74852+
* On receiving a new XR frame if this feature is attached notify observers new feature point data is available.
74853+
*/
74854+
protected _onXRFrame(frame: XRFrame): void;
74855+
/**
74856+
* Initializes the feature. If the feature point feature is not available for this environment do not mark the feature as enabled.
74857+
*/
74858+
private _init;
74859+
}
74860+
}
7478474861
declare module BABYLON {
7478574862
/**
7478674863
* The motion controller class for all microsoft mixed reality controllers
@@ -75747,4 +75824,15 @@ interface XRPlane {
7574775824
planeSpace: XRSpace;
7574875825
polygon: Array<DOMPointReadOnly>;
7574975826
lastChangedTime: number;
75827+
}
75828+
// This file contains native only extensions for WebXR These APIs are not supported in the browser yet.
75829+
// They are intended for use with either Babylon Native https://github.com/BabylonJS/BabylonNative or
75830+
// Babylon React Native: https://github.com/BabylonJS/BabylonReactNative
75831+
75832+
interface XRSession {
75833+
trySetFeaturePointCloudEnabled(enabled: boolean): boolean;
75834+
}
75835+
75836+
interface XRFrame {
75837+
featurePointCloud? : Array<number>;
7575075838
}

dist/preview release/babylon.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)