mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-07 03:52:41 +08:00
22 lines
450 B
TypeScript
22 lines
450 B
TypeScript
import { PhysicsWorldBase } from '../../physics/api';
|
|
import { createPhysicsWorld } from '../../physics/instance';
|
|
|
|
export class PhysicsSystem {
|
|
private _world: PhysicsWorldBase;
|
|
|
|
constructor () {
|
|
this._world = createPhysicsWorld();
|
|
}
|
|
|
|
public update (deltaTime: number) {
|
|
if (CC_EDITOR) {
|
|
return;
|
|
}
|
|
this._world.step(deltaTime);
|
|
}
|
|
|
|
get world () {
|
|
return this._world;
|
|
}
|
|
}
|