Three.js : add a mesh inside another mesh while keeping position

Sometimes you have a mesh positionned into a scene (a knife that has been trown in my case), and you want to put that mesh into an other mesh (the knife has been planted into a crate). Its position and rotation won't be automatically updated in that process, so the object won't stay at the same place it was before.

That's where this little function comes in handy :

 * Place a mesh inside another + adapt it's position & rotation
 * @param parentMesh = the mesh hosting the other mesh
 * @param childMesh  = the mesh we want to put in the parent
function addMeshInsideAnother(parentMesh, childMesh) {
  // put the child mesh inside the parent mesh
  // place the child mesh inside the parent mesh
  // relatively to where it was in the world
  var pos = childMesh.position.clone();
  // rotate the child mesh inside the parent mesh
  // relatively to it's rotation in the world
  var quat = new THREE.Quaternion();