### Component Kit Button Example (uikitml) Source: https://developers.meta.com/horizon/documentation/web/iwsdk-guide-spatial-ui Shows an example of using a Button component from an installed component kit. This demonstrates integrating pre-built UI elements into the uikitml structure. ```uikitml ``` -------------------------------- ### Running the Physics Example Project (Shell) Source: https://developers.meta.com/horizon/documentation/web/iwsdk-guide-physics Commands to navigate to, install dependencies for, and run the physics example project within the SDK. This requires Node.js and pnpm. The example demonstrates basic physics setup, dynamic object creation, and force application. ```shell cd examples/physics pnpm install pnpm dev ``` -------------------------------- ### Complete Interactive Setup with Grabbing and Locomotion Source: https://developers.meta.com/horizon/documentation/web/iwsdk-guide-built-in-interactions This comprehensive example integrates both object grabbing and locomotion setup into an existing starter application. It demonstrates how to enable core features like `grabbing` and `locomotion` in `World.create` and subsequently configure specific environment and grabbable objects. It also shows adding `LocomotionEnvironment` for walkable surfaces and `DistanceGrabbable` and `OneHandGrabbable` for different object interaction types. ```javascript // Update your src/index.ts with these additions: import { AssetManager, AssetManifest, AssetType, EnvironmentType, Interactable, LocomotionEnvironment, OneHandGrabbable, DistanceGrabbable, SessionMode, World, } from "@iwsdk/core"; // ... existing assets and World.create setup with features enabled ... World.create(/* ... */, { features: { grabbing: true, locomotion: true, // ...other features }, }).then((world) => { // ... existing camera and environment setup ... // Make environment walkable const { scene: envMesh } = AssetManager.getGLTF("environmentDesk"); envMesh.rotateY(Math.PI); envMesh.position.set(0, -0.1, 0); world .createTransformEntity(envMesh) .addComponent(LocomotionEnvironment, { type: EnvironmentType.STATIC }); // Make plant grabbable at distance const { scene: plantMesh } = AssetManager.getGLTF("plantSansevieria"); plantMesh.position.set(1.2, 0.85, -1.8); world .createTransformEntity(plantMesh) .addComponent(Interactable) .addComponent(DistanceGrabbable); // Make robot grabbable with one hand const { scene: robotMesh } = AssetManager.getGLTF("robot"); robotMesh.position.set(-1.2, 0.95, -1.8); robotMesh.scale.setScalar(0.5); world .createTransformEntity(robotMesh) .addComponent(Interactable) .addComponent(OneHandGrabbable); // ... rest of your existing setup }); ``` -------------------------------- ### Install Project Dependencies Source: https://developers.meta.com/horizon/documentation/web/webxr-first-steps This command installs all the necessary project dependencies listed in the 'package.json' file. This step is crucial after cloning the repository to ensure all required libraries are available for development. ```bash npm install ``` -------------------------------- ### Language Choice for WebXR Project Setup Source: https://developers.meta.com/horizon/documentation/web/iwsdk-guide-project-setup When setting up your WebXR project, you can choose between TypeScript and JavaScript. TypeScript offers type safety and better IDE support, recommended for most projects, while JavaScript is simpler for quick prototypes. The setup tool will guide you to select your preferred language. ```bash Which language do you want to use? ❯ TypeScript JavaScript ``` -------------------------------- ### Initialize Locomotion System and Environments (JavaScript) Source: https://developers.meta.com/horizon/documentation/web/iwsdk-concept-locomotion Quick start guide for enabling locomotion systems and marking level geometry as walkable. This involves registering the LocomotionSystem with configuration and adding LocomotionEnvironment components to entities. It supports static and kinematic environments for different use cases. ```javascript import { World } from '@iwsdk/core'; import { LocomotionSystem, LocomotionEnvironment, } from '@iwsdk/core/locomotion'; import { EnvironmentType } from '@iwsdk/locomotor'; // 1) Enable locomotion systems world.registerSystem(LocomotionSystem, { configData: { slidingSpeed: 5, turningMethod: 1, // Snap turningAngle: 45, rayGravity: -0.4, useWorker: true, }, }); // 2) Mark your level as walkable const level = world.createTransformEntity(gltf.scene); level.addComponent(LocomotionEnvironment, { type: EnvironmentType.STATIC }); // Optional: moving platform const platform = world.createTransformEntity(platformMesh); platform.addComponent(LocomotionEnvironment, { type: EnvironmentType.KINEMATIC, }); ``` -------------------------------- ### Android Signing Key Configuration Example Source: https://developers.meta.com/horizon/documentation/web/pwa-packaging Example of the interactive prompts for configuring signing key information when initializing a Bubblewrap project. It specifies the key store location and key name, or allows Bubblewrap to create a new keystore. ```bash Signing key information (5/5) Please, enter information about the key store containing the keys that will be used to sign the application. If a key store does not exist on the provided path, Bubblewrap will prompt for the creation of a new keystore. - Key store location: The location of the key store in the file system. - Key name: The alias used on the key. Read more about Android signing keys at: https://developer.android.com/studio/publish/app-signing ? Key store location: /YOUR_PATH/android.keystore ? Key name: android ``` -------------------------------- ### Request WebXR Session in A-Frame Source: https://developers.meta.com/horizon/documentation/web/pwa-webxr This example shows how to initiate an immersive WebXR session using A-Frame. It adds an event listener to the scene to call `enterVR()` once the scene is ready, ensuring the PWA launches directly into VR. ```html ``` -------------------------------- ### Verify Node.js and npm Installation Source: https://developers.meta.com/horizon/documentation/web/webxr-first-steps This code block shows the commands to check the installed versions of Node.js and npm. It specifies that Node.js version '20.x' or later and npm version '10.x' or later are required for the tutorial. ```bash node -v npm -v ``` -------------------------------- ### Basic UIKitML Structure for a Panel with Text and Button Source: https://developers.meta.com/horizon/documentation/web/iwsdk-guide-spatial-ui Demonstrates the fundamental HTML-like syntax of UIKitML for creating a UI panel. It includes a div element styled as a panel with specific dimensions and background color, a text element with styling, and a button. This serves as a foundational example for UI layout and element inclusion. ```uikitml