指导在 IWSDK 项目中实现物理模拟、交互物体与碰撞调试。
该技能材料显示其本质是面向 IWSDK 物理系统的实现指南,且被标记为 prompt-only、无密钥、无远程端点,整体风险较低。主要不确定性来自仓库许可未声明、社区采用度低和维护状态未知,属于供应链层面的轻度留意点。
材料明确注明不需要密钥或环境变量;未见 API token、账号凭证或凭证传递/存储说明,凭证泄露与滥用风险低。
材料注明无远程端点,内容也主要是本地物理系统配置与代码示例;未见将用户数据发送到外部服务的描述。
系统检查项为 prompt-only,当前材料表现为文档/示例性质;未见要求安装可执行程序、启动本地进程或申请额外系统执行权限。
未声明需要读取或写入本地文件、数据库、剪贴板或其他敏感资源;示例仅涉及在 IWSDK 项目中配置物理组件,没有过度数据访问迹象。
正面因素是 GitHub 开源且可审计,来源指向 facebook/immersive-web-sdk;但许可证未声明、star 为 0、维护状态未知,说明可用性与持续维护信号偏弱,建议在采纳前核查仓库活跃度与实际内容对应性。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "iwsdk-physics" 技能: 1. 下载 https://raw.githubusercontent.com/facebook/immersive-web-sdk/main/packages/starter-assets/claude-injections/skills/iwsdk-physics/SKILL.md 2. 保存为 ~/.claude/skills/iwsdk-physics/SKILL.md 3. 装好后重载技能,告诉我可以用了
请指导我在 IWSDK 项目里为一个可移动木箱添加物理效果:需要设置刚体、合适的碰撞形状、质量和摩擦参数,并说明每个参数的作用。
给出添加刚体和碰撞体的实现步骤、参数建议及作用说明。
我想在 IWSDK 中创建一个可被玩家抓取、释放后能自然掉落和碰撞的物体,请提供实现思路、关键配置和常见注意事项。
输出可抓取物体的实现方案,包括交互逻辑、物理配置和稳定性建议。
我的 IWSDK 场景里物体会穿过地面,或者碰撞后抖动严重。请帮我系统排查可能原因,并给出修复步骤和调优建议。
提供分步骤的故障排查清单,定位穿模或抖动原因并给出修复方案。
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 |
|---|
…
帮助规划 IWSDK 新功能、系统架构与代码模式,并提供最佳实践建议。
帮助开发者用 iwsdk CLI 测试 XR 交互与面板音频行为是否正常。
用于逐帧调试 WebXR 场景中的物理、动画与实时交互行为。
指导你在 IWSDK 项目中实现深度感知遮挡并排查显示异常问题
使用 iwsdk CLI 测试 Havok 物理系统的重力与刚体行为表现
在 XR 场景中定位并点击目标对象,用于验证按钮与交互元素是否正常工作
在 WebXR 场景中模拟抓取物体,便于交互测试与搬运操作验证。
使用 iwsdk CLI 测试抓取系统的多种交互抓取模式
使用 iwsdk CLI 对比示例场景,测试滑动、瞬转、传送与跳跃移动系统。
帮助你创建、修改、调试并预览 IWSDK 应用中的 PanelUI 界面组件。
使用 iwsdk CLI 对关卡层级、标签与默认灯光配置进行测试验证。
帮助开发者高效开发、调试并优化 IWSDK 的 PanelUI 界面面板。