public ViewingFrustum(FrustumKind kind, float left, float right, float bottom, float top, float near, float far) { if (left >= right || bottom >= top /*|| far >= near */) throw new ArgumentException ("Invalid frustum dimensions; " + "left >= right or bottom >= top or far >= near."); Kind = kind; Left = left; Right = right; Bottom = bottom; Top = top; Near = near; Far = far; }
public ViewingFrustum(FrustumKind kind, float left, float right, float bottom, float top, float near, float far) { if (left >= right || bottom >= top /*|| far >= near */) { throw new ArgumentException("Invalid frustum dimensions; " + "left >= right or bottom >= top or far >= near."); } Kind = kind; Left = left; Right = right; Bottom = bottom; Top = top; Near = near; Far = far; }
public ViewingFrustum(FrustumKind kind, float width, float height, float near, float far) { if (far >= near) throw new ArgumentException ("Invalid frustum dimensions; far >= near."); Kind = kind; Near = near; Far = far; if (kind == FrustumKind.Perspective) { var max = Math.Max (width, height); Right = width / max; Top = height / max; } else { Right = width * 0.5f; Top = height * 0.5f; } Left = -Right; Bottom = -Top; }
public ViewingFrustum(FrustumKind kind, float width, float height, float near, float far) { if (far >= near) { throw new ArgumentException("Invalid frustum dimensions; far >= near."); } Kind = kind; Near = near; Far = far; if (kind == FrustumKind.Perspective) { var max = Math.Max(width, height); Right = width / max; Top = height / max; } else { Right = width * 0.5f; Top = height * 0.5f; } Left = -Right; Bottom = -Top; }