Documentation - v19.16.0-dev
    Preparing search index...

    The cutting planes of a Scene: what lies behind one of them is cut, neither drawn nor picked (the parts entirely behind not even culled in), except the objects that ignore them (MeshProxy.ignoreCuttingPlanes, SpriteProxy.ignoreCuttingPlanes). Meshes and sprites are cut pixel by pixel.

    A plane is in scene coordinates (those of the objects' matrices), its normal towards the side kept: a point is kept where normal ยท point + constant >= 0 for every plane. What is kept is convex: one plane, several, or a section box (six planes facing in).

    The scene's only writer of its planes, telling nobody: the renderers and the Raycaster read version when they use them. Ask for a frame after a change.

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Parameters

      • maxPlanes: number

        Planes at most: the size of the shaders' plane arrays (the scene's settings.scene.maxCuttingPlanes).

      Returns CuttingPlanesController

    Properties

    maxPlanes: number

    Planes at most: the size of the shaders' plane arrays (the scene's settings.scene.maxCuttingPlanes).

    Accessors

    • get planes(): readonly Plane[]

      The planes, copies of those set: change them through set.

      Returns readonly Plane[]

    • get version(): number

      Changes at each set and clear.

      Returns number

    Methods

    • Removes every plane: nothing is cut.

      Returns void

    • The part of ray (scene coordinates) on the side kept: from target.x to target.y, as distances from its origin (in world units, whatever the length of its direction); from 0 to Infinity without planes.

      Parameters

      • ray: Ray
      • target: Vector2

      Returns boolean

      False when the whole ray is cut (target then meaningless).

    • Cuts by these planes, copied (normalized), in place of the previous ones.

      Parameters

      • planes: readonly Plane[]

      Returns void

      With more than maxPlanes planes, or a plane without a normal (zero length).