How to sync player's cannon-es body with VR headset position?

Hello all. I’m in the process of designing a threejs-based webxr engine for simple VR games. Right now, I’m working on implementing physics with cannon-es, but I’m struggling to figure out how to sync the player’s physics body with their headset position.

Right now, each frame the following code is run:

    const pos = Camera.getWorldPosition(new THREE.Vector3()).toArray();
    const head = pos[1] + 0.1;
    if (pos[1] !== 0) {
      if (!Player.PhysicalObj) {
        Player.PhysicalObj = new Objects.PPill({
          radius: 0.25,
          mass: 60,
          height: head,
          offsetPos: [0, head / 2, 0],
          fixedRotation: true
        });
        World.addBody(Player.PhysicalObj);
      }

      Player.PhysicalObj.position.set(pos[0], Player.PhysicalObj.position.y, pos[2]);
    }

First, it creates the player’s PhysicalObj (a pill shape) from a premade function. After that, it simply moves the PhysicalObj’s x and z positions to the camera’s world position. I think this works for when the player is just walking around in real life, but will cause major issues down the line with player movement.

This is the function that each Entity has to sync its VisualObj with its PhysicalObj (if applicable):

    Sync(cameraPos) {
     if (!this.PhysicalObj) return;
     this.VisualObj.position.copy(this.PhysicalObj.position);
     this.VisualObj.quaternion.copy(this.PhysicalObj.quaternion);

      if (this.isPlayer) {
       const vec = new THREE.Vector3(cameraPos.x, 0, cameraPos.z);
       this.VisualObj.position.sub(vec);
     }
   }

If the Entity in question is Player, then it offsets itself by the camera’s local position, to prevent a feedback loop (because Camera is a child of Player.VisualObj).

My question is this: Is there a better way to move the player’s PhysicalObj to the camera’s position, rather than teleporting? Would applying the force / impulse necessary to get the body to the camera’s world position, or even changing its velocity to get it there, work better? I think it’s important that the PhysicalObj follow the camera’s worldposition, so the player can’t clip through walls by walking around in real life.

Any help would be much appreciated, I’ve been stuck on this for quite a while. Thanks in advance!