core/pac/FmvBounds.cs
public class FmvBounds : Component {
[Property] public Vector3 Size {get; set;}
[Property] public Vector3 Center {get; set;}
public BBox Box => new(Center - Size * 0.5f, Center + Size * 0.5f);
protected override void DrawGizmos() {
Gizmo.Draw.Color = Color.Green;
Gizmo.Draw.LineBBox(Box);
base.DrawGizmos();
}
}
public class FmvBoundsCollection : Component {
public bool Test(Frustum frustrum) {
foreach (var bound in Components.GetAll<FmvBounds>()) {
if (frustrum.IsInside(bound.Box.Transform(bound.WorldTransform), true))
return true;
}
return false;
}
public List<Vector3> GetCorners() {
List<Vector3> result = new();
foreach (var bound in Components.GetAll<FmvBounds>())
foreach (var corner in bound.Box.Corners)
result.Add(corner);
return result;
}
}