hide self skeleton debug rendering in first person

This commit is contained in:
Astazium 2026-07-17 12:55:27 +03:00
parent 73229e34fc
commit ecedc3c436
3 changed files with 9 additions and 5 deletions

View file

@ -275,7 +275,8 @@ void WorldRenderer::renderLines(
auto ctx = pctx.sub(lineBatch.get()); auto ctx = pctx.sub(lineBatch.get());
bool culling = engine.getSettings().graphics.frustumCulling.get(); bool culling = engine.getSettings().graphics.frustumCulling.get();
level.entities->renderDebug( level.entities->renderDebug(
*lineBatch, culling ? frustumCulling.get() : nullptr, ctx *lineBatch, culling ? frustumCulling.get() : nullptr, ctx,
player.currentCamera.get() == player.fpCamera.get() ? player.getEntity() : 0
); );
} }
} }

View file

@ -415,7 +415,7 @@ static void debug_render_skeleton(
} }
void Entities::renderDebug( void Entities::renderDebug(
LineBatch& batch, const Frustum* frustum, const DrawContext& pctx LineBatch& batch, const Frustum* frustum, const DrawContext& pctx, entityid_t fpsEntity
) { ) {
{ {
auto ctx = pctx.sub(&batch); auto ctx = pctx.sub(&batch);
@ -443,12 +443,15 @@ void Entities::renderDebug(
} }
} }
{ {
auto view = registry->view<Transform, rigging::Skeleton>(); auto view = registry->view<EntityId, Transform, rigging::Skeleton>();
auto ctx = pctx.sub(&batch); auto ctx = pctx.sub(&batch);
ctx.setDepthTest(false); ctx.setDepthTest(false);
ctx.setDepthMask(false); ctx.setDepthMask(false);
ctx.setLineWidth(2); ctx.setLineWidth(2);
for (auto [entity, transform, skeleton] : view.each()) { for (auto [entity, eid, transform, skeleton] : view.each()) {
if (eid.uid == fpsEntity) {
continue;
}
auto config = skeleton.config; auto config = skeleton.config;
if (config == nullptr) { if (config == nullptr) {
continue; continue;

View file

@ -58,7 +58,7 @@ public:
void update(float delta); void update(float delta);
void renderDebug( void renderDebug(
LineBatch& batch, const Frustum* frustum, const DrawContext& ctx LineBatch& batch, const Frustum* frustum, const DrawContext& ctx, entityid_t fpsEntity
); );
void render( void render(
const Assets& assets, const Assets& assets,