first person rendering bugfix
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-04-15 18:21:39 -04:00
parent f25e64fd1c
commit c085e34dbb
3 changed files with 21 additions and 1 deletions

View File

@ -1492,6 +1492,7 @@ Fix first person tree animation not nullchecking
Fix yoga not applying on item drop window creation Fix yoga not applying on item drop window creation
Fix client not destroying item on remove from inventory Fix client not destroying item on remove from inventory
Tests for above bugs Tests for above bugs
Fix rendering 3rd person model-attached entities drawing when in first person

View File

@ -279,6 +279,11 @@ public class MainContentPipeline implements RenderPipeline {
entity == Globals.playerEntity && entity == Globals.playerEntity &&
!Globals.controlHandler.cameraIsThirdPerson() !Globals.controlHandler.cameraIsThirdPerson()
) || ) ||
(
!Globals.controlHandler.cameraIsThirdPerson() &&
AttachUtils.getParent(entity) != null &&
AttachUtils.getParent(entity) == Globals.playerEntity
) ||
//don't draw items if they're attached to viewmodel //don't draw items if they're attached to viewmodel
( (

View File

@ -10,6 +10,7 @@ import electrosphere.entity.Entity;
import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityDataStrings;
import electrosphere.entity.EntityTags; import electrosphere.entity.EntityTags;
import electrosphere.entity.EntityUtils; import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.attach.AttachUtils;
import electrosphere.renderer.OpenGLState; import electrosphere.renderer.OpenGLState;
import electrosphere.renderer.RenderPipelineState; import electrosphere.renderer.RenderPipelineState;
import electrosphere.renderer.RenderingEngine; import electrosphere.renderer.RenderingEngine;
@ -114,9 +115,22 @@ public class NormalsForOutlinePipeline implements RenderPipeline {
entity == Globals.firstPersonEntity || entity == Globals.firstPersonEntity ||
//don't draw third person view if camera is first person //don't draw third person view if camera is first person
(
entity == Globals.playerEntity &&
!Globals.controlHandler.cameraIsThirdPerson()
) ||
( (
!Globals.controlHandler.cameraIsThirdPerson() && !Globals.controlHandler.cameraIsThirdPerson() &&
entity == Globals.playerEntity AttachUtils.getParent(entity) != null &&
AttachUtils.getParent(entity) == Globals.playerEntity
) ||
//don't draw items if they're attached to viewmodel
(
Globals.firstPersonEntity != null &&
!Globals.controlHandler.cameraIsThirdPerson() &&
AttachUtils.hasParent(entity) &&
AttachUtils.getParent(entity) == Globals.firstPersonEntity
) )
; ;
} }