It works great thanks John! It was so simple. Everything I tried was much more complex.
And another thing: when the mesh rotates anticlockwise, rotation.y's value get's reversed negative values. For example Math.PI/2*3 is -Math.PI/2. Essentially it's the same thing.
Would it be possible for the rotation.y's value in this case to not be reversed?

https://playground.babylonjs.com/#M6HJ3P#13
I managed to do something like what I had in mind but I still need to achieve this using a pointLight and not a spotLight.
Plus, could anyone tell how to soften the shadow's edges?

I still can't get it to work in my scene:
var shadowGenerator = new BABYLON.ShadowGenerator(1024, playerLight);
for(i = 0; i < scene.meshes.length; i++){
if(scene.meshes[i].name != "sphere"){
scene.meshes[i].receiveShadows = true;
}
}
shadowGenerator.addShadowCaster(wallsFinal);
shadowGenerator.bias = 0.0017;
light.shadowMaxZ = 100;
light.shadowMinZ = 0.0001;
and this when I add all the meshes as shadowCasters:
The only kind of light that works surprisingly well is a spotlight, just like wingnut's example but that's not what I'm looking for: