diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-27 11:56:48 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-27 11:56:48 +0100 |
commit | 2b35e8f51a3536b62ea21dc82deec1e3b65568f6 (patch) | |
tree | 8245ca8f015634e0aca01e83822b02c869419b5c /src/crepe/system | |
parent | 7f66cd4a9b609f6bf36d005f5e38ef2a57d1c0d3 (diff) |
make format and offset for the cameara relative from the transform gameobject
Diffstat (limited to 'src/crepe/system')
-rw-r--r-- | src/crepe/system/RenderSystem.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp index beed9ce..9a8c1ba 100644 --- a/src/crepe/system/RenderSystem.cpp +++ b/src/crepe/system/RenderSystem.cpp @@ -28,8 +28,11 @@ void RenderSystem::update_camera() { for (Camera & cam : cameras) { if (!cam.active) continue; + const Transform & transform + = mgr.get_components_by_id<Transform>(cam.game_object_id).front().get(); this->context.set_camera(cam); this->curr_cam_ref = &cam; + this->curr_cam_ref->pos = transform.position + this->curr_cam_ref->offset; } } |