facebook/iwsdk-physics
Guide for implementing physics in IWSDK projects. Use when adding physics simulation, configuring rigid bodies, collision shapes, applying forces, creating grabbable physics objects, or troubleshooting physics behavior.
npx skills add https://github.com/facebook/immersive-web-sdk --skill iwsdk-physics
This skill provides the complete reference and workflow for implementing Havok-powered physics simulation in IWSDK applications. Physics is built on three ECS components (PhysicsBody, PhysicsShape, PhysicsManipulation) orchestrated by the PhysicsSystem.
Enable physics in iwsdk.config.json with the physics feature flag:
{
"scene": "./public/scenes/physics.iwsdk.scene.json",
"world": {
"xr": { "mode": "vr" },
"features": {
"physics": true,
"grabbing": true,
"locomotion": true
}
}
}
Setting physics: true automatically registers PhysicsBody, PhysicsShape, PhysicsManipulation components and the PhysicsSystem at priority -2.
Only enable physics when needed. If no objects require dynamic simulation, omit it to avoid overhead.
Read the one the task needs; each is complete on its own.
PhysicsSystem config, scene JSON → references/tuning-and-config.mdObjects fall through the floor:
PhysicsShape and PhysicsBody with state: PhysicsState.StaticAuto or ConvexHull is selected for the PhysicsShape of static objects, try to change into TriMeshphysics: true is set in iwsdk.config.json world featuresObjects don't move:
state is PhysicsState.Dynamic (not Static or Kinematic)gravityFactor is > 0PhysicsShape and PhysicsBody are added (both are required)Objects are too bouncy or slide too much:
restitution to reduce bouncing (0 = no bounce)friction to reduce sliding (0.8+ for grippy surfaces)Objects move too slowly or feel sluggish:
linearDamping (0 = no air resistance)density is not too high (high density = heavy = resists force)Poor frame rate with many physics objects:
TriMesh only for static objectsAuto to avoid detection overheadGrabbed object doesn't follow hand:
grabbing: true in featuresRayInteractable and a grabbable component (OneHandGrabbable, TwoHandsGrabbable, or DistanceGrabbable)PhysicsManipulation has no effect:
PhysicsBody with an active engine body (_engineBody != 0)PhysicsState.Static for all non-moving objects; static bodies have zero simulation costAuto detection overheadTake facebook/iwsdk-physics from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.