mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
cf180d57d9
* * do not run phy system in editor * support center of phy shape * fix setWorldPosition() bug * add interface pullTransform() for sync dynamic phy body's transform
20 lines
365 B
TypeScript
20 lines
365 B
TypeScript
import { PhysicsWorld } from './world';
|
|
|
|
export class PhysicsSystem {
|
|
private _world: PhysicsWorld;
|
|
|
|
constructor() {
|
|
this._world = new PhysicsWorld();
|
|
}
|
|
|
|
public update(deltaTime: number) {
|
|
if (CC_EDITOR) {
|
|
return;
|
|
}
|
|
this._world.step(deltaTime);
|
|
}
|
|
|
|
get world() {
|
|
return this._world;
|
|
}
|
|
} |