but it looks like the rotation is only applied on the box itself and not the collisionbox attached to it…
both the boxes and the collision boxes need to have the same pos, rot, scale parameters
what am I doing wrong?
flattenLight removes the pos, hpr and scale from the model. You are henceforth not applying a rotation to the CollisionBox (and in fact, a CollisionBox is an AABB and can’t have an applied rotation), only the position and scale.
To fix, move the setHpr line to below the flattenLight line.
To be sure, you can call get_tight_bounds on box_n.
But the problem is most likely this:
The 1, 1, 1 there are not scale values for a unit-sized cube; rather, they are the offsets (distances) of the sides of the CollisionBox from its center. So this leads to a total collision-box size of (2, 2, 2). You can check this by printing out its dimensions:
Judging from your screenshot, it’s possible that you might have to change the center position of the collision-box to something like (.5, .5, .5) as well, but I’m not sure.