Skip to content

Commit

Permalink
hand tracking attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
Saffo, David committed Feb 5, 2024
1 parent 7c351a1 commit f1fabb4
Show file tree
Hide file tree
Showing 4 changed files with 806 additions and 802 deletions.
22 changes: 13 additions & 9 deletions anu-examples/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//Contains the styles for our page, currently setting body,app div, and canvas to 100% h&w
import './style.css'
import * as BABYLON from "@babylonjs/core";
// import { WebXRGenericHandController } from '@babylonjs/core';

//Import all of babylonjs, you most likely want to import individual methods as needed
import {scatterplot3D } from './examples/ScatterPlots/Scatterplot3D';
Expand Down Expand Up @@ -99,16 +100,19 @@ let scene = scenes[urlParams.get('example')](babylonEngine);
const env = scene.createDefaultEnvironment();
env.setMainColor(BABYLON.Color3.FromHexString('#0e0e17'));

const xr = await scene.createDefaultXRExperienceAsync({
// uiOptions: {
// sessionMode: 'immersive-vr'
// },
floorMeshes: [env.ground]
});
// xr.baseExperience.featuresManager.enableFeature(BABYLON.WebXRFeatureName.HAND_TRACKING, "latest", {
// xrInput: xr.input
// });
var defaultXRExperience = await scene.createDefaultXRExperienceAsync( { floorMeshes: [env.ground]} );
const featureManager = await defaultXRExperience.baseExperience.featuresManager;

if (!featureManager) {
throw Error("no base experience", featureManager)
} else {
console.log(featureManager)
defaultXRExperience.baseExperience.featuresManager.enableFeature(BABYLON.WebXRFeatureName.HAND_TRACKING, "latest", {
xrInput: defaultXRExperience.input
});
}



//Render the scene we created
babylonEngine.runRenderLoop(() => {
Expand Down
6 changes: 3 additions & 3 deletions docs/.vitepress/cache/deps/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"hash": "904fec8c",
"browserHash": "a87ac864",
"hash": "0f0d4fbc",
"browserHash": "1f29e8c6",
"optimized": {
"vue": {
"src": "../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "dcca7233",
"fileHash": "b17c9f1e",
"needsInterop": false
}
},
Expand Down
1,578 changes: 789 additions & 789 deletions docs/public/assets/index.085db560.js → docs/public/assets/index.c8cae16f.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/public/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>AnuJS Visualization Examples</title>


<script type="module" crossorigin src="/anu/assets/index.085db560.js"></script>
<script type="module" crossorigin src="/anu/assets/index.c8cae16f.js"></script>
<link rel="stylesheet" href="/anu/assets/index.176030ad.css">
</head>
<body>
Expand Down

0 comments on commit f1fabb4

Please sign in to comment.