Skip to content

Commit ecfaf8b

Browse files
committed
ir-1827-separate-physics-world-per-scene
1 parent f5f7185 commit ecfaf8b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/BasicSystem.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ const BasicObject = ({ entityUUID }: { entityUUID: EntityUUID }) => {
105105
const angle = Math.random() * Math.PI * 2
106106
const direction = new Vector3(Math.sin(angle), 0, Math.cos(angle))
107107
const velocity = 0.025 + Math.random() * 0.01
108-
Physics.applyImpulse(entity, direction.multiplyScalar(velocity))
108+
const world = Physics.getWorld(entity)!
109+
Physics.applyImpulse(world, entity, direction.multiplyScalar(velocity))
109110
}, [entity])
110111

111112
return null

0 commit comments

Comments
 (0)