BT5-Dev #72: 점프 ascending 통과 일관성 (jumpAscentTimer)
PD 질문 (2026-05-08): "발판 방향 통과 시 밀려나는 현상. 깔끔하게 통과 또는 통과 X (착지) 둘 중 하나로" 진단: - ascending 판정: velocity.y > 0.01f (mask OFF Layer 16 통과) - 정점 영역 (velocity.y ≈ 0): 1~2 frame 동안 조건 X → standingOnPlatform 검사 활성 - = 발판 영역 진입 + footHit 검출 → mask ON 짧은 충돌 → 밀려남 (jitter) 정정 (BT72): - jumpAscentTimer 신규 (JUMP_ASCENT_DURATION = 0.4초) - PrepareToJump → Jumping 시 Timer 활성 (Drop-Through 점프 X — dropThroughTimer 영역으로 처리) - Update에 매 frame Timer 감소 - isJumpingThrough 조건에 jumpAscentTimer > 0f 추가 - = 점프 시작 후 0.4초 mask 강제 OFF → ascending·정점 일관 통과 - 0.4초 후 또는 descending velocity.y < -0.01 → standingOnPlatform 검사 활성 → 발판 위 착지 효과: - 발판 방향 점프 = 깔끔 통과 (정점 영역 밀려남 X) - 발판 위 떨어지면 착지 (descending standingOnPlatform 검사) - 일반 점프·Drop-Through·전진 점프 영역 그대로 후속 의무: - PD Refresh+Play 시각 검증 (발판 통과 일관성) - 정합 시 BT72 영역 영구 채택
This commit is contained in:
parent
dd44085c3b
commit
06e92a8732
|
|
@ -46,6 +46,10 @@ namespace Platformer.Mechanics
|
||||||
private float dropThroughTimer = 0f; // 활성 시간 동안 Layer 16 mask 강제 OFF
|
private float dropThroughTimer = 0f; // 활성 시간 동안 Layer 16 mask 강제 OFF
|
||||||
private const float DROP_THROUGH_DURATION = 0.3f; // Drop-Through 활성 지속 시간 (초)
|
private const float DROP_THROUGH_DURATION = 0.3f; // Drop-Through 활성 지속 시간 (초)
|
||||||
private bool dropThroughJump = false; // 본 frame Drop-Through 점프 발동 여부 (velocity.y 처리 분기)
|
private bool dropThroughJump = false; // 본 frame Drop-Through 점프 발동 여부 (velocity.y 처리 분기)
|
||||||
|
|
||||||
|
// BT72 — 점프 ascending 통과 일관성 (PD 질문 2026-05-08): 정점 영역 jitter 차단
|
||||||
|
private float jumpAscentTimer = 0f;
|
||||||
|
private const float JUMP_ASCENT_DURATION = 0.4f; // 점프 시작 후 mask OFF 보장 시간 (정점 영역 jitter 차단)
|
||||||
/*internal new*/ public Collider2D collider2d;
|
/*internal new*/ public Collider2D collider2d;
|
||||||
/*internal new*/ public AudioSource audioSource;
|
/*internal new*/ public AudioSource audioSource;
|
||||||
public Health health;
|
public Health health;
|
||||||
|
|
@ -178,6 +182,8 @@ namespace Platformer.Mechanics
|
||||||
|
|
||||||
// BT69 — Drop-Through Timer 감소 (Layer 16 mask 강제 OFF 지속 시간)
|
// BT69 — Drop-Through Timer 감소 (Layer 16 mask 강제 OFF 지속 시간)
|
||||||
if (dropThroughTimer > 0f) dropThroughTimer -= Time.deltaTime;
|
if (dropThroughTimer > 0f) dropThroughTimer -= Time.deltaTime;
|
||||||
|
// BT72 — Jump Ascent Timer 감소 (점프 ascending 통과 일관성)
|
||||||
|
if (jumpAscentTimer > 0f) jumpAscentTimer -= Time.deltaTime;
|
||||||
UpdateJumpState();
|
UpdateJumpState();
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
|
|
@ -198,6 +204,8 @@ namespace Platformer.Mechanics
|
||||||
jumpState = JumpState.Jumping;
|
jumpState = JumpState.Jumping;
|
||||||
jump = true;
|
jump = true;
|
||||||
stopJump = false;
|
stopJump = false;
|
||||||
|
// BT72 — 점프 ascending 통과 일관성: Drop-Through 점프(velocity.y<0)는 Timer 활성 X (이미 dropThroughTimer 영역)
|
||||||
|
if (!dropThroughJump) jumpAscentTimer = JUMP_ASCENT_DURATION;
|
||||||
// BT41 — PrepareToJump frame 영역 즉시 contactFilter Layer 16 mask OFF (다음 ComputeVelocity 영역 velocity.y 적용 영역 영역 frame 영역 발판 영역 충돌 차단)
|
// BT41 — PrepareToJump frame 영역 즉시 contactFilter Layer 16 mask OFF (다음 ComputeVelocity 영역 velocity.y 적용 영역 영역 frame 영역 발판 영역 충돌 차단)
|
||||||
{
|
{
|
||||||
int baseMaskJump = Physics2D.GetLayerCollisionMask(gameObject.layer);
|
int baseMaskJump = Physics2D.GetLayerCollisionMask(gameObject.layer);
|
||||||
|
|
@ -234,9 +242,11 @@ namespace Platformer.Mechanics
|
||||||
|
|
||||||
// BT5-Dev #43 — IsGrounded 영역 폐기 (frame 0 미설정 → 떨어짐). footHit 단독 + 점프 영역 OFF 강제
|
// BT5-Dev #43 — IsGrounded 영역 폐기 (frame 0 미설정 → 떨어짐). footHit 단독 + 점프 영역 OFF 강제
|
||||||
// BT69 — Drop-Through Timer 활성 시 Layer 16 mask 강제 OFF (Down + Jump 입력 발판 통과)
|
// BT69 — Drop-Through Timer 활성 시 Layer 16 mask 강제 OFF (Down + Jump 입력 발판 통과)
|
||||||
|
// BT72 — Jump Ascent Timer 활성 시 mask 강제 OFF (정점 영역 jitter 차단·점프 통과 일관성)
|
||||||
bool isJumpingThrough = jumpState == JumpState.Jumping
|
bool isJumpingThrough = jumpState == JumpState.Jumping
|
||||||
|| (jumpState == JumpState.InFlight && velocity.y > 0.01f)
|
|| (jumpState == JumpState.InFlight && velocity.y > 0.01f)
|
||||||
|| dropThroughTimer > 0f;
|
|| dropThroughTimer > 0f
|
||||||
|
|| jumpAscentTimer > 0f;
|
||||||
|
|
||||||
bool standingOnPlatform = false;
|
bool standingOnPlatform = false;
|
||||||
if (collider2d != null && !isJumpingThrough)
|
if (collider2d != null && !isJumpingThrough)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue