Applying rotation to a group which contains multiple children

I’m creating a website, which lets user upload it’s own GLTF models of animals. Model is then added to a a group named AnimalGroup.
AnimalGroup contains:

  • GLTF model (which can be complex and made out of many children (body, 2 eyes, tongue, etc.)
  • RayCastHitbox (BoxGeometry which is the same size as animal and set transparent)
  • some other meshes

Scene can have any number of AnimalGroups.

I managed to do position change by setting AnimalGroup.position.set(x,y,z) and scale by setting AnimalGroup.scale.set(x,y,z) but I cannot figure out rotation.

When I apply rotation by setting AnimalGroup.rotateX(rad) (or Y or Z), animal group is rotating around scene centre, but not around its group centre.

Thanks for any provided help!

I managed to rotate object the correct way.
Instead of rotating AnimalGroup, which holds GLTF model, RaycastHitBox and other helper meshes, I looped through children and applied rotation to each one.

            for (const child of AnimalGroup.children) {
                child.scale.set(
                    scaleX, 
                    scaleY, 
                    scaleZ)

                child.rotation.set(
                    THREE.MathUtils.degToRad(rotX), 
                    THREE.MathUtils.degToRad(rotY), 
                    THREE.MathUtils.degToRad(rotZ))
             
            }