How to raycast on an object in local coordinates

Here’s some background:
Before I read 3D game programming for kids I knew JavaScript, html5 canvas 2d drawing and some three.js.

I’m making a space-shooter game (located at https://black-galaxy-2.glitch.me/ the instructions are at https://black-galaxy-2.glitch.me/i.html). I am using a raycaster for the collision detection between the lasers and the ships. The raycaster casts for each laser from the last position of the laser to the current position of the laser. But it’s not working for lasers shot at the player’s ship because it is in local coordinates so their can be animation were the ship is rotated slightly more than the camera when turning. I tried changing the local coordinates (the variable name is shipL) to a simple mesh:

var bmv = new THREE.MeshBasicMaterial({visible: false}); //material is intended to be used later on other invisible meshes
var geom = new THREE.BufferGeometry();//buffer geometry because it uses less memory
geom.addAttribute(
  'position',
  new THREE.BufferAttribute(new Float32Array([
    0,0,0,
    0,0.1,0,
    0.1,0,0
  ]),3));
var shipL = new THREE.Mesh(geom,bm);
scene.add(shipL);

then in the update method for lasers (note there is an if statement that checks if the laser was shot from an enemy ship):

  let r = new THREE.Raycaster(
        this.lastPos,
        this.position.clone().normalize()
      );
      let h = r.intersectObject(shipL);
      if (h.length>0&&typeof h[1].object!="undefined"&&h[1].object==ship) {
        health-=20;
        ctx.fillStyle = "rgba(255,0,0,0.5)";
        ctx.fillRect(0,0,width,height);
        this.die()
      }

but it still didn’t work