2025-12-01 22:28:51 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Physics Editor Plugin
|
|
|
|
|
|
*
|
|
|
|
|
|
* 编辑器版本的物理插件,不包含 WASM 依赖。
|
|
|
|
|
|
* Editor version of physics plugin, without WASM dependencies.
|
|
|
|
|
|
*
|
2025-12-03 22:15:22 +08:00
|
|
|
|
* 用于编辑器中注册插件清单,但不创建运行时模块。
|
2025-12-01 22:28:51 +08:00
|
|
|
|
* 运行时使用 PhysicsPlugin from '@esengine/physics-rapier2d/runtime'
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2025-12-03 22:15:22 +08:00
|
|
|
|
import type { IPlugin, ModuleManifest } from '@esengine/engine-core';
|
2025-12-01 22:28:51 +08:00
|
|
|
|
|
2025-12-03 22:15:22 +08:00
|
|
|
|
const manifest: ModuleManifest = {
|
2025-12-01 22:28:51 +08:00
|
|
|
|
id: '@esengine/physics-rapier2d',
|
2025-12-03 22:15:22 +08:00
|
|
|
|
name: '@esengine/physics-rapier2d',
|
|
|
|
|
|
displayName: 'Physics 2D',
|
2025-12-01 22:28:51 +08:00
|
|
|
|
version: '1.0.0',
|
|
|
|
|
|
description: 'Deterministic 2D physics with Rapier2D',
|
2025-12-03 22:15:22 +08:00
|
|
|
|
category: 'Physics',
|
|
|
|
|
|
isCore: false,
|
|
|
|
|
|
defaultEnabled: false,
|
|
|
|
|
|
isEngineModule: true,
|
2025-12-01 22:28:51 +08:00
|
|
|
|
canContainContent: false,
|
2025-12-03 22:15:22 +08:00
|
|
|
|
requiresWasm: true,
|
|
|
|
|
|
dependencies: ['engine-core'],
|
|
|
|
|
|
exports: {
|
|
|
|
|
|
components: ['Rigidbody2DComponent', 'BoxCollider2DComponent', 'CircleCollider2DComponent'],
|
|
|
|
|
|
systems: ['PhysicsSystem']
|
|
|
|
|
|
}
|
2025-12-01 22:28:51 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 编辑器物理插件(无运行时模块)
|
|
|
|
|
|
* Editor physics plugin (no runtime module)
|
|
|
|
|
|
*
|
|
|
|
|
|
* 编辑器使用此版本注册插件,运行时使用带 WASM 的完整版本。
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const Physics2DPlugin: IPlugin = {
|
2025-12-03 22:15:22 +08:00
|
|
|
|
manifest
|
2025-12-01 22:28:51 +08:00
|
|
|
|
// No runtime module - editor doesn't need physics simulation
|
|
|
|
|
|
};
|