npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iwsdk/xr-input

v0.3.1

Published

WebXR input system with controller and hand tracking support, visual adapters, and input profiles for Three.js applications

Readme

@iwsdk/xr-input

WebXR input system for Three.js applications. Provides controller and hand tracking support with visual adapters, input profiles, and seamless pointer event integration.

Features

  • 🎮 Controller Support - Automatic controller model loading with input profiles
  • Hand Tracking - Full hand skeleton tracking with joint positions
  • 👆 Pointer Events - Integration with @pmndrs/pointer-events for spatial interaction
  • 📋 Input Profiles - Pre-configured profiles for Meta Quest controllers
  • 🎨 Visual Adapters - Animated controller and hand mesh rendering
  • 🔄 Hot-Swapping - Seamless switching between controllers and hands

Installation

npm install @iwsdk/xr-input three

Quick Start

import { XRInputManager } from '@iwsdk/xr-input';
import { PerspectiveCamera, Scene, WebGLRenderer } from 'three';

const scene = new Scene();
const camera = new PerspectiveCamera(75, window.innerWidth / window.innerHeight);
const renderer = new WebGLRenderer({ xr: { enabled: true } });

// Create the input manager
const inputManager = new XRInputManager({
  scene,
  camera,
});

// Add XR origin to scene
scene.add(inputManager.xrOrigin);

// In your render loop
renderer.setAnimationLoop((time, frame) => {
  const delta = /* calculate delta */;

  // Update input manager with XR state
  inputManager.update(renderer.xr, delta, time);

  renderer.render(scene, camera);
});

Accessing Controllers

// Get visual adapters for left/right
const leftAdapter = inputManager.visualAdapters.left.value;
const rightAdapter = inputManager.visualAdapters.right.value;

// Check if using controller or hand
if (leftAdapter?.type === 'controller') {
  // Controller is active
} else if (leftAdapter?.type === 'hand') {
  // Hand tracking is active
}

Gamepad Input

import { StatefulGamepad } from '@iwsdk/xr-input';

// Access gamepads (available after update)
const leftGamepad = inputManager.gamepads.left;
const rightGamepad = inputManager.gamepads.right;

if (rightGamepad) {
  // Button states
  const triggerPressed = rightGamepad.getButtonDown('xr-standard-trigger');
  const gripPressed = rightGamepad.getButtonDown('xr-standard-squeeze');

  // Thumbstick values
  const thumbstick = rightGamepad.getAxes('xr-standard-thumbstick');
  console.log(thumbstick.x, thumbstick.y);

  // Button events (pressed this frame)
  if (rightGamepad.getSelectStart()) {
    console.log('Trigger just pressed');
  }
}

Multi-Pointer System

// Access multi-pointer for spatial interactions
const leftPointer = inputManager.multiPointers.left;
const rightPointer = inputManager.multiPointers.right;

// Pointers integrate with @pmndrs/pointer-events
// They automatically handle ray and grab pointers

XR Origin

The XROrigin provides the tracked reference space:

const xrOrigin = inputManager.xrOrigin;

// Access head position
const headPosition = xrOrigin.head.position;
const headRotation = xrOrigin.head.quaternion;

// Access controller/hand positions via visual adapters
const rightHand = inputManager.visualAdapters.right.value;
if (rightHand) {
  const position = rightHand.getPosition();
  const rotation = rightHand.getQuaternion();
}

Supported Devices

  • Meta Quest 2
  • Meta Quest 3
  • Meta Quest Pro
  • Oculus Quest 1
  • Generic WebXR controllers

Peer Dependencies

  • three >= 0.160.0

Documentation

For more information, visit: https://iwsdk.dev

License

MIT © Meta Platforms, Inc.