I'm working on a 3d space game and currently I'm trying to get mounted equipment on the player ship.
To test this I made 2 hardpoints on the ship model (basically untextured boxes, to get the coordinates.
Now, I can get the 2 testwise equipped weapons to move with the ship in terms of position, but it's not clear to me how to rotate the with the ship when turning.
Both the ship and the weapons are represented as entities in an ECS, with position and rotation components (among others), with the weapon entities also having an Offset component which basically represents the position of its hardpoint in model space.
Rotatiing an object around its own origin is pretty easy, but how do I rotate the weapons with the ship while keeping their position relative to it, so that they stay at their hardpoints?