Implement physics simulation, interactions, and collision debugging in IWSDK projects.
The material indicates this is essentially an implementation guide for the IWSDK physics system and is classified as prompt-only, with no keys and no remote endpoints, so overall risk is low. The main uncertainty is on the supply-chain side: no declared license, low adoption, and unknown maintenance status.
The material explicitly states that no keys or environment variables are required; no API tokens, account credentials, or credential handling/storage are described, so credential leakage or misuse risk is low.
No remote endpoints are declared, and the content is primarily local physics-system configuration and code examples; there is no indication of sending user data to external services.
The system classifies it as prompt-only, and the material appears to be documentation/example content; there is no requirement to install executables, launch local processes, or request elevated code-execution permissions.
There is no declared need to read or write local files, databases, clipboard data, or other sensitive resources; the examples only cover configuring physics components in an IWSDK project, with no sign of excessive data access.
A positive factor is that it is open source on GitHub and auditable, with the source pointing to facebook/immersive-web-sdk; however, the license is undeclared, stars are 0, and maintenance status is unknown, so usability and long-term maintenance signals are weak. Verify repository activity and that the content actually matches the published material before adoption.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "iwsdk-physics" skill from askskill: 1. Download https://raw.githubusercontent.com/facebook/immersive-web-sdk/main/packages/starter-assets/claude-injections/skills/iwsdk-physics/SKILL.md 2. Save it as ~/.claude/skills/iwsdk-physics/SKILL.md 3. Reload skills and tell me it's ready
Guide me in adding physics to a movable wooden crate in an IWSDK project: set up a rigid body, suitable collision shape, mass, and friction, and explain what each parameter does.
Step-by-step setup instructions with recommended parameters and explanations for each setting.
I want to create an object in IWSDK that players can grab, release, and have it fall and collide naturally. Provide the implementation approach, key settings, and common pitfalls.
An implementation plan for a grabbable object, including interaction logic, physics setup, and stability tips.
In my IWSDK scene, objects pass through the floor or jitter badly after collisions. Help me systematically diagnose possible causes and provide fixes and tuning recommendations.
A step-by-step troubleshooting checklist to identify clipping or jitter causes and fix them.
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 World.create with the physics feature flag:
import { World, SessionMode } from '@iwsdk/core';
const world = await World.create(container, {
xr: { sessionMode: SessionMode.ImmersiveVR },
features: {
physics: true,
grabbing: true, // Required if physics objects should be grabbable
locomotion: true, // Requires collision geometry in the scene
},
level: './glxf/Composition.glxf',
});
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.
Defines the motion behavior of a physics entity. Import from @iwsdk/core.
import { PhysicsBody, PhysicsState } from '@iwsdk/core';
entity.addComponent(PhysicsBody, {
state: PhysicsState.Dynamic,
linearDamping: 0.0,
angularDamping: 0.0,
gravityFactor: 1.0,
centerOfMass: [Infinity, Infinity, Infinity], // Infinity = auto-compute from shape
});
Properties:
| Property | Type | Default | Description |
|---|---|---|---|
state | PhysicsState | Dynamic | Motion type (see below) |
linearDamping | Float32 | 0.0 | Air resistance for translation (0 = none, 1 = heavy) |
angularDamping | Float32 | 0.0 | Air resistance for rotation |
gravityFactor | Float32 | 1.0 | Gravity multiplier (0 = floating, 2 = double gravity) |
centerOfMass | Vec3 | [Infinity, Infinity, Infinity] | Override center of mass; Infinity = auto-compute |
Read-only properties (updated each frame by PhysicsSystem):
| Property | Type | Description |
|---|---|---|
_linearVelocity | Vec3 | Current linear velocity |
_angularVelocity | Vec3 | Current angular velocity |
PhysicsState.Static; // Immovable (walls, floors). Zero simulation cost.
PhysicsState.Dynamic; // Fully simulated. Responds to forces, gravity, collisions.
PhysicsState.Kinematic; // Programmatically moved. Pushes dynamic bodies but is not affected by them.
When to use each:
Defines the collision geometry and material properties. Both PhysicsShape and PhysicsBody are required for physics simulation.
import { PhysicsShape, PhysicsShapeType } from '@iwsdk/core';
entity.addComponent(PhysicsShape, {
shape: PhysicsShapeType.Auto,
dimensions: [0, 0, 0],
density: 1.0,
restitution: 0.0,
friction: 0.5,
});
Properties:
| Property | Type | Default | Description |
|---|
…
Test XR session lifecycle and mode transitions to verify behavior and debug state issues.
Build, debug, and refine IWSDK PanelUI panels more efficiently.
Test multiple grab interaction modes with the iwsdk CLI.
Test XR interactions, panels, and audio behavior with the iwsdk CLI.
Debug WebXR real-time behavior frame by frame with pause, snapshots, and diffs.
Plan IWSDK features, architecture, and code patterns with best-practice guidance.
Test Havok physics behaviors with the iwsdk CLI against example scenes.
Simulate grabbing objects in WebXR scenes for interaction testing and movement validation.
Implement depth sensing occlusion in IWSDK and troubleshoot rendering issues.
Test slide, snap turn, teleport, and jump locomotion with iwsdk CLI.
Create, modify, debug, and preview PanelUI components in IWSDK apps.
Test level hierarchy, tags, and lighting setup with the iwsdk CLI.