mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
hide self skeleton debug rendering in first person
This commit is contained in:
parent
73229e34fc
commit
ecedc3c436
3 changed files with 9 additions and 5 deletions
|
|
@ -275,7 +275,8 @@ void WorldRenderer::renderLines(
|
|||
auto ctx = pctx.sub(lineBatch.get());
|
||||
bool culling = engine.getSettings().graphics.frustumCulling.get();
|
||||
level.entities->renderDebug(
|
||||
*lineBatch, culling ? frustumCulling.get() : nullptr, ctx
|
||||
*lineBatch, culling ? frustumCulling.get() : nullptr, ctx,
|
||||
player.currentCamera.get() == player.fpCamera.get() ? player.getEntity() : 0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -415,7 +415,7 @@ static void debug_render_skeleton(
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
@ -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);
|
||||
ctx.setDepthTest(false);
|
||||
ctx.setDepthMask(false);
|
||||
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;
|
||||
if (config == nullptr) {
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public:
|
|||
void update(float delta);
|
||||
|
||||
void renderDebug(
|
||||
LineBatch& batch, const Frustum* frustum, const DrawContext& ctx
|
||||
LineBatch& batch, const Frustum* frustum, const DrawContext& ctx, entityid_t fpsEntity
|
||||
);
|
||||
void render(
|
||||
const Assets& assets,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue