Skip to content

Commit 7c1ba03

Browse files
zjm-metameta-codesync[bot]
authored andcommitted
fix(core): guard PhysicsSystem against unregistered Grabbed component.
Summary: T270858631 called out a bug that Physics System checks Grabbed component during its runtime which caused unnecessary bundling with the Grabbing System. This diff fixed the issue by checking if the Grabbed component is registered before checking its value. Reviewed By: cabanier Differential Revision: D105058171 fbshipit-source-id: 94a47e01486bda690ae79d730f862ff77927dd36
1 parent febf5a7 commit 7c1ba03

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/core/src/physics/physics-system.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export class PhysicsSystem extends createSystem(
181181
const position = entity.object3D.position;
182182
const quaternion = entity.object3D.quaternion;
183183

184-
if (entity.hasComponent(Grabbed)) {
184+
if (Grabbed.bitmask && entity.hasComponent(Grabbed)) {
185185
this.havok.HP_Body_SetTargetQTransform(
186186
[BigInt(engineBody)],
187187
[

0 commit comments

Comments
 (0)