Skip to content

Commit

Permalink
Merge pull request #1559 from INEEDSSD/LayaAir_3.1
Browse files Browse the repository at this point in the history
fix: Fixed the problem of reuse of physical component collider.
  • Loading branch information
lirongf authored Jul 26, 2024
2 parents 2af4ef3 + 5acea3c commit 1131666
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/layaAir/laya/Physics3D/Bullet/btPhysicsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,18 @@ export class btPhysicsManager implements IPhysicsManager {
bt.btGImpactCollisionAlgorithm_RegisterAlgorithm(this._btDispatcher);//注册算法
this.initPhysicsCapable(); // 初始化物理能力
}
setActiveCollider(collider: ICollider, value: boolean): void {
setActiveCollider(collider: btCollider, value: boolean): void {
collider.active = value;
if (value) {
collider._physicsManager = this;
} else {
collider._physicsManager = null;
}
}
sphereQuery?(pos: Vector3, radius: number, result: ICollider[], collisionmask: number): void {
throw new Error("Method not implemented.");
}



/**
* @internal
Expand Down
7 changes: 6 additions & 1 deletion src/layaAir/laya/Physics3D/PhysX/pxPhysicsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,13 @@ export class pxPhysicsManager implements IPhysicsManager {
}
this.fixedTime = physicsSettings.fixedTimeStep;
}
setActiveCollider(collider: ICollider, value: boolean): void {
setActiveCollider(collider: pxCollider, value: boolean): void {
collider.active = value;
if (value) {
collider._physicsManager = this;
} else {
collider._physicsManager = null;
}
}
enableDebugDrawer?(value: boolean): void {
throw new Error("Method not implemented.");
Expand Down

0 comments on commit 1131666

Please sign in to comment.