Skip to content

Commit b6a8c52

Browse files
authored
Merge pull request #5 from EtherealEngine/ir-1827-separate-physics-world-per-scene
ir-1827-separate-physics-world-per-scene
2 parents f5f7185 + ecfaf8b commit b6a8c52

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)