Files

535 B
Raw Permalink Blame History

Test (2).js — getLookBlock() (satır 662)

← Test (2).js · ← Master

function getLookBlock(p, range) {
    var rt = p.rayTrace(range);
    if (!rt || rt.isMissed()) return null;

    var hp = rt.getHitPosition();
    if (!hp) return null;

    var look = p.getLook();
    var x = Math.floor(hp.x - look.x * 0.05);
    var y = Math.floor(hp.y - look.y * 0.05);
    var z = Math.floor(hp.z - look.z * 0.05);
    return { dim: getDim(p), x: x, y: y, z: z };
}