Class Frustum

All Implemented Interfaces:
PointerInterface

public class Frustum extends Record
A 3D volume delimited by 2D clip planes.

The contents of the `graphene_frustum_t` are private, and should not be
modified directly.

https://ebassi.github.io/graphene/docs/

  • Constructor Details

  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • allocFrustum

      public static Frustum allocFrustum()
      Allocates a new #graphene_frustum_t structure.

      The contents of the returned structure are undefined.
      Returns:
      the newly allocated #graphene_frustum_t structure. Use graphene_frustum_free() to free the resources allocated by this function.
    • containsPoint

      public boolean containsPoint(@Nonnull Point3D point)
      Checks whether a point is inside the volume defined by the given
      #graphene_frustum_t.
      Parameters:
      point - a #graphene_point3d_t
      Returns:
      `true` if the point is inside the frustum
    • equal

      public boolean equal(@Nonnull Frustum b)
      Checks whether the two given #graphene_frustum_t are equal.
      Parameters:
      b - a #graphene_frustum_t
      Returns:
      `true` if the given frustums are equal
    • free

      public void free()
      Frees the resources allocated by graphene_frustum_alloc().
    • init

      public Frustum init(@Nonnull Plane p0, @Nonnull Plane p1, @Nonnull Plane p2, @Nonnull Plane p3, @Nonnull Plane p4, @Nonnull Plane p5)
      Initializes the given #graphene_frustum_t using the provided
      clipping planes.
      Parameters:
      p0 - a clipping plane
      p1 - a clipping plane
      p2 - a clipping plane
      p3 - a clipping plane
      p4 - a clipping plane
      p5 - a clipping plane
      Returns:
      the initialized frustum
    • initFromFrustum

      public Frustum initFromFrustum(@Nonnull Frustum src)
      Initializes the given #graphene_frustum_t using the clipping
      planes of another #graphene_frustum_t.
      Parameters:
      src - a #graphene_frustum_t
      Returns:
      the initialized frustum
    • initFromMatrix

      public Frustum initFromMatrix(@Nonnull Matrix matrix)
      Initializes a #graphene_frustum_t using the given @matrix.
      Parameters:
      matrix - a #graphene_matrix_t
      Returns:
      the initialized frustum
    • intersectsBox

      public boolean intersectsBox(@Nonnull Box box)
      Checks whether the given @box intersects a plane of
      a #graphene_frustum_t.
      Parameters:
      box - a #graphene_box_t
      Returns:
      `true` if the box intersects the frustum
    • intersectsSphere

      public boolean intersectsSphere(@Nonnull Sphere sphere)
      Checks whether the given @sphere intersects a plane of
      a #graphene_frustum_t.
      Parameters:
      sphere - a #graphene_sphere_t
      Returns:
      `true` if the sphere intersects the frustum
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()