Entity rotation matrix


I am trying to add GLSL dynamic lights to OpenArena and am struggling a little. Even though the ligths work at the moment correctly, the Entities are not lit properly. My best guess (and from visuals I have) is that I would need to include the entity’s rotation in the GLSL calculations but so far have failed in finding where in the engine is this information stored. To be more precise, I would need to read out entity’s rotation matrix at its drawing time.

Hope I’m posting in the right place and someone can help me out with this?