2025-12-01 22:28:51 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Physics 2D Plugin (Complete)
|
|
|
|
|
|
* 完整的 2D 物理插件(运行时 + 编辑器)
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2025-12-03 22:15:22 +08:00
|
|
|
|
import type { IPlugin, ModuleManifest } from '@esengine/editor-core';
|
2025-12-01 22:28:51 +08:00
|
|
|
|
import { PhysicsRuntimeModule } from '@esengine/physics-rapier2d/runtime';
|
|
|
|
|
|
import { physics2DEditorModule } from './Physics2DEditorModule';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2025-12-03 22:15:22 +08:00
|
|
|
|
* Physics 2D 插件清单
|
|
|
|
|
|
* Physics 2D Plugin Manifest
|
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: true,
|
|
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 完整的 Physics 2D 插件(运行时 + 编辑器)
|
|
|
|
|
|
* Complete Physics 2D Plugin (runtime + editor)
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const Physics2DPlugin: IPlugin = {
|
2025-12-03 22:15:22 +08:00
|
|
|
|
manifest,
|
2025-12-01 22:28:51 +08:00
|
|
|
|
runtimeModule: new PhysicsRuntimeModule(),
|
|
|
|
|
|
editorModule: physics2DEditorModule
|
|
|
|
|
|
};
|