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 the instructions are at 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
  new THREE.BufferAttribute(new Float32Array([
var shipL = new THREE.Mesh(geom,bm);

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(
      let h = r.intersectObject(shipL);
      if (h.length>0&&typeof h[1].object!="undefined"&&h[1].object==ship) {
        ctx.fillStyle = "rgba(255,0,0,0.5)";

but it still didn’t work