INNER CODE UNIT · JavaScript

heightScale

electronicarts/pbmpm · src/main.js:494

    const heightScale = currentResolution[1]/resolution[1];

    // Geometric mean
    const scaleScale = Math.sqrt(widthScale*heightScale);

    var shapes = json.shapes;
    ui.clearShapes();

    for(var shape of shapes)
    {
        shape.position.x *= widthScale;
        shape.position.y *= heightScale;

        shape.halfSize.x *= scaleScale;
        shape.halfSize.y *= scaleScale;

        shape.radius *= scaleScale;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…