fix PhysX Physics costs some time even there is not physics node in scene #11382 (#11396)

Co-authored-by: zhanling <zhanling@cocos.com>
This commit is contained in:
Ling Zhan
2022-06-08 13:38:56 +08:00
committed by GitHub
parent 549108d018
commit 47d1138fbb
+1
View File
@@ -69,6 +69,7 @@ export class PhysXWorld extends PhysXInstance implements IPhysicsWorld {
}
step (deltaTime: number, _timeSinceLastCalled?: number, _maxSubStep = 0): void {
if (this.wrappedBodies.length === 0) return;
this._simulate(deltaTime);
if (!PX.MULTI_THREAD) {
this._fetchResults();