Files

1.8 KiB
Raw Permalink Blame History

HologramMenu.js — kalkanAktifEt() (satır 308)

← HologramMenu.js · ← Master

Parça 4/5 · önceki · sonraki

                    else if (distZMax >= 0 && distZMax < S) { pushZ = G * (1 - distZMax/S); itilmeli = true; }
                }
                // Y duvarları (tavan/taban)
                if (ex >= minX && ex <= maxX && ez >= minZ && ez <= maxZ)
                {
                    if (distYMin >= 0 && distYMin < S) { pushY = -G * (1 - distYMin/S); itilmeli = true; }
                    else if (distYMax >= 0 && distYMax < S) { pushY = G * (1 - distYMax/S); itilmeli = true; }
                }

                // Köşe/kenar durumu — XZ köşeleri
                if (ey >= minY && ey <= maxY)
                {
                    var nearX = (distXMin < distXMax) ? distXMin : -distXMax;
                    var nearZ = (distZMin < distZMax) ? distZMin : -distZMax;
                    var absNX = Math.abs(nearX);
                    var absNZ = Math.abs(nearZ);

                    if (absNX < S && absNZ < S && absNX > 0 && absNZ > 0)
                    {
                        pushX = (nearX < 0 ? -1 : 1) * G * (1 - absNX/S) * -1;
                        pushZ = (nearZ < 0 ? -1 : 1) * G * (1 - absNZ/S) * -1;
                        itilmeli = true;
                    }
                }
            }

            if (itilmeli)
            {
                var pX = pushX * 0.2; // 25 * 0.2 = 5 motion
                var pY = pushY * 0.2;
                var pZ = pushZ * 0.2;
                
                // Yukarı fırlatmayı biraz güçlendir
                if (Math.abs(pY) < 0.5) pY = 0.5;

                try {
                    // Mevcut hızı ezip tam gücünde şiddetle fırlatır