INNER CODE UNIT · JavaScript

max

MageStudio/Mage · src/physics/index.js:330

                let max = [-Infinity, -Infinity, -Infinity];

                for (let i = 0; i < source.length; i += 3) {
                    const x = source[i] * worldScale.x;
                    const y = source[i + 1] * worldScale.y;
                    const z = source[i + 2] * worldScale.z;
                    points[i] = x;
                    points[i + 1] = y;
                    points[i + 2] = z;

                    min = [Math.min(min[0], x), Math.min(min[1], y), Math.min(min[2], z)];
                    max = [Math.max(max[0], x), Math.max(max[1], y), Math.max(max[2], z)];
                }

                // A hull needs at least a tetrahedron; anything less cannot be
                // built and would otherwise degrade silently into a unit box.
                if (points.length < 12) return null;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…