Files

42 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# hollow_purple.js — main() (satır 9)
[← hollow_purple.js](index.md) · [← Master](../../wiki.md)
Parça 5/15 · [önceki](main-4.md) · [sonraki](main-6.md)
```javascript
                    var r  = (stt / ticks) * maxR;
                    var w2 = c2.getWorld();
                    var pts = 22;
                    for (var i = 0; i < pts; i++) {
                        var a  = (i / pts) * Math.PI * 2;
                        var ca = Math.cos(a), sa = Math.sin(a);
                        w2.displayMorph(morph, 2,
                            ox + (rightX * ca + upX * sa) * r,
                            oy + (upY * sa) * r,
                            oz + (rightZ * ca + upZ * sa) * r,
                            a * 57.3, 0, 80, null);
                    }
                });
            })(st);
        }
    }
    // ---------- Blok kayıt + geri yükleme ----------
    var savedBlocks = [];
    var savedMap    = {};
    // Belirli bir küre içindeki blokları yık + kaydet
    function destroySphere(ox, oy, oz, radius) {
        var r2   = radius * radius;
        var scan = Math.ceil(radius);
        for (var bdx = -scan; bdx <= scan; bdx++) {
            for (var bdy = -scan; bdy <= scan; bdy++) {
                for (var bdz = -scan; bdz <= scan; bdz++) {
                    if (bdx*bdx + bdy*bdy + bdz*bdz <= r2) {
                        var bxi = Math.floor(ox) + bdx;
                        var byi = Math.floor(oy) + bdy;
                        var bzi = Math.floor(oz) + bdz;
                        var key = bxi + "," + byi + "," + bzi;
```