/// <summary> /// </summary> /// <param name="frustumPlanes"> /// </param> /// <param name="selection"> /// </param> /// <param name="allowDuplicate"> /// </param> public virtual void select(Array <Plane> frustumPlanes, SmartArray <T> selection, bool allowDuplicate = false) { if (BoundingBox.IsInFrustum(this._boundingVectors, frustumPlanes)) { if (this.blocks != null) { for (var index = 0; index < this.blocks.Length; index++) { var block = this.blocks[index]; block.select(frustumPlanes, selection, allowDuplicate); } return; } if (allowDuplicate) { selection.Append(this.entries); } else { selection.concatWithNoDuplicate(this.entries); } } }
/// <summary> /// </summary> /// <param name="sphereCenter"> /// </param> /// <param name="sphereRadius"> /// </param> /// <param name="selection"> /// </param> /// <param name="allowDuplicate"> /// </param> public virtual void intersects(Vector3 sphereCenter, double sphereRadius, SmartArray <T> selection, bool allowDuplicate = false) { if (BoundingBox.IntersectsSphere(this._minPoint, this._maxPoint, sphereCenter, sphereRadius)) { if (this.blocks != null) { for (var index = 0; index < this.blocks.Length; index++) { var block = this.blocks[index]; block.intersects(sphereCenter, sphereRadius, selection, allowDuplicate); } return; } if (allowDuplicate) { selection.Append(this.entries); } else { selection.concatWithNoDuplicate(this.entries); } } }