import { Rectangle } from '@pixi/math' ; import type { BVHSplitAxis } from './BVHSplitAxis' ; memberof class export class BVHNode { public bounds : Rectangle ; public children : BVHNode [ ] ; public splitAxis : BVHSplitAxis ; public objectOffset : number ; public objectCount : number ; constructor ( ) { member this . bounds = new Rectangle ( ) ; member this . children = new Array ( 2 ) ; member this . splitAxis = null ; member this . objectOffset = 0 ; member this . objectCount = 0 ; } returns { boolean } isLeaf ( ) { return ! this . children [ 0 ] && ! this . children [ 1 ] ; } param { number } offset param { number } objects param { PIXI . Rectangle } bounds resetLeaf ( offset , objects , bounds ) { this . objectOffset = offset ; this . bounds . copyFrom ( bounds ) ; this . children [ 0 ] = this . children [ 1 ] = null ; this . objectCount = objects ; return this ; } param { PIXI . BVHSplitAxis } splitAxis param { PIXI . BVHNode } child0 param { PIXI . BVHNode } child1 resetInterior ( splitAxis , child0 , child1 ) { this . splitAxis = splitAxis ; this . children [ 0 ] = child0 ; this . children [ 1 ] = child1 ; this . bounds . copyFrom ( child0 . bounds ) ; this . bounds . enlarge ( child1 . bounds ) ; return this ; } }