getDepth method

double getDepth()

Returns the depth of this BVH node in its hierarchy.

Implementation

double getDepth() {
	double depth = 0;
	BVHNode? parent = this.parent;

	while ( parent != null ) {
		parent = parent.parent;
		depth ++;
	}

	return depth;
}