magic-pixels
    Preparing search index...

    Class Sphere

    A bounding sphere: a center and a radius. A negative radius marks an empty sphere, which is what a new sphere starts as. Unlike a box, a sphere is unchanged by rotation, which makes it the cheap choice for anything that happens in world space: framing a camera, culling, a first pass of picking.

    Operations work in place and return this.

    Index
    center: Vector = ...
    radius: number = -1
    • Transform the sphere by a matrix: the centre like a point, the radius by the largest scale factor of the matrix (the length of its longest column). Exact for uniform scale, a safe overestimate otherwise.

      Parameters

      Returns this

    • Grow the radius, keeping the centre, until the sphere contains point

      Parameters

      Returns this

    • Grow the radius, keeping the centre, until the sphere contains other

      Parameters

      Returns this

    • The sphere around a box: its centre and half its diagonal. Loose for round shapes (up to √3 times the true radius); see BufferGeometry.computeBoundingSphere() for the tight version.

      Parameters

      Returns this