gl3n.frustum

Note: this module is not completly tested! Use with special care, results might be wrong.

  • Declaration

    OUTSIDE
    INSIDE
    INTERSECT

    Used as flag to indicate if the object intersects with the frustum.

  • Declaration

    struct Frustum;

    • Declaration

      LEFT
      RIGHT
      BOTTOM
      TOP
      NEAR
      FAR

      Used to access the planes array.

    • Declaration

      Plane[6] planes;

      Holds all 6 planes of the frustum.

    • Declaration

      pure nothrow @safe this(mat4 mvp);

      Constructs the frustum from a model-view-projection matrix.

      Parameters

      mat4 mvp

      a model-view-projection matrix

    • Declaration

      pure nothrow @safe this(Plane[6] planes);

      Constructs the frustum from 6 planes.

      Parameters

      Plane[6] planes

      the 6 frustum planes in the order: left, right, bottom, top, near, far.

    • Declaration

      const pure nothrow @safe int intersects(AABB aabb);

      Checks if the aabb intersects with the frustum. Returns OUTSIDE (= 0), INSIDE (= 1) or INTERSECT (= 2).

    • Declaration

      const bool opBinaryRight(string s : "in")(AABB aabb);

      Returns true if the aabb intersects with the frustum or is inside it.