Fire into the room.
Follow the official XR ball-shooter loop: controller select events mark the firing gesture, an instanced ball receives position and velocity, and Rapier advances the shared room simulation.
Preparing WebGLRenderer, RapierPhysics, instanced balls, and XR session entry point...
- mode
- -
- physics
- -
- controllers
- -
- active balls
- -
- shots
- -
- capacity
- -
- physics ticks
- -
- events
- -
- draws
- -
- frames
- -
Connect a virtual controller, hold selectstart to fire, and selectend to stop the firing loop.
The event log records controller lifecycle, firing gestures, and room reset actions.
await RapierPhysics()create a gravity worldphysics.addScene(scene)register userData.physicssetMeshPosition(spheres, ...)place an instance bodysetMeshVelocity(spheres, ...)launch the ballinstanceMatrix.needsUpdateupload simulated transformsThe official addon maps BoxGeometry, IcosahedronGeometry, and InstancedMesh bodies into Rapier colliders. The local harness uses the same firing and physics ownership boundary, with a labeled kinematic fallback if the external addon cannot load.
Desktop controls verify event-to-velocity mapping and the instanced room simulation; physical controller pose, Rapier CDN availability, and immersive frame timing still require a headset-capable session.
This study follows the official WebGLRenderer ball-shooter example. The XR button is a real session entry point; desktop controller paths are explicitly simulated.