Class FrustumMixin

java.lang.Object
foundry.veil.mixin.client.pipeline.FrustumMixin
All Implemented Interfaces:
CullFrustum

public abstract class FrustumMixin extends Object implements CullFrustum
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract boolean
    cubeInFrustum(double d, double e, double f, double g, double h, double i)
     
    org.joml.Matrix4fc
     
    org.joml.Vector4fc[]
     
    org.joml.Vector3dc
     
    org.joml.Vector3fc
     
    abstract boolean
    isVisible(net.minecraft.world.phys.AABB aABB)
     
    void
    offsetToFullyIncludeCameraCube(int $$0, org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable<net.minecraft.client.renderer.culling.Frustum> cir)
     
    boolean
    testAab(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
    Test whether the given axis-aligned box is partly or completely within or outside of the frustum defined by this frustum culler.
    boolean
    testAab(net.minecraft.world.phys.AABB aabb)
    Test whether the given axis-aligned box is partly or completely within or outside of the frustum defined by this frustum culler.
    boolean
    testLineSegment(double aX, double aY, double aZ, double bX, double bY, double bZ)
    Test whether the given line segment, defined by the end points (aX, aY, aZ) and (bX, bY, bZ), is partly or completely within the frustum defined by this frustum culler.
    boolean
    testPlaneXY(double minX, double minY, double maxX, double maxY)
    Test whether the given XY-plane (at Z = 0) is partly or completely within or outside of the frustum defined by this frustum culler.
    boolean
    testPlaneXZ(double minX, float minZ, float maxX, float maxZ)
    Test whether the given XZ-plane (at Y = 0) is partly or completely within or outside of the frustum defined by this frustum culler.
    boolean
    testPoint(double x, double y, double z)
    Test whether the given point (x, y, z) is within the frustum defined by this frustum culler.
    boolean
    testSphere(double x, double y, double z, float r)
    Test whether the given sphere is partly or completely within or outside of the frustum defined by this frustum culler.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface foundry.veil.api.client.render.CullFrustum

    testAab, testAab, testLineSegment, testLineSegment, testPlaneXY, testPlaneXY, testPoint, testPoint, testPoint, testSphere, testSphere
  • Constructor Details

    • FrustumMixin

      public FrustumMixin()
  • Method Details

    • isVisible

      public abstract boolean isVisible(net.minecraft.world.phys.AABB aABB)
    • cubeInFrustum

      protected abstract boolean cubeInFrustum(double d, double e, double f, double g, double h, double i)
    • offsetToFullyIncludeCameraCube

      public void offsetToFullyIncludeCameraCube(int $$0, org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable<net.minecraft.client.renderer.culling.Frustum> cir)
    • testPoint

      public boolean testPoint(double x, double y, double z)
      Description copied from interface: CullFrustum
      Test whether the given point (x, y, z) is within the frustum defined by this frustum culler.
      Specified by:
      testPoint in interface CullFrustum
      Parameters:
      x - the x-coordinate of the point
      y - the y-coordinate of the point
      z - the z-coordinate of the point
      Returns:
      true if the given point is inside the frustum; false otherwise
    • testSphere

      public boolean testSphere(double x, double y, double z, float r)
      Description copied from interface: CullFrustum
      Test whether the given sphere is partly or completely within or outside of the frustum defined by this frustum culler.

      The algorithm implemented by this method is conservative. This means that in certain circumstances a false positive can occur, when the method returns true for spheres that do not intersect the frustum. See iquilezles.org for an examination of this problem.

      Specified by:
      testSphere in interface CullFrustum
      Parameters:
      x - the x-coordinate of the sphere's center
      y - the y-coordinate of the sphere's center
      z - the z-coordinate of the sphere's center
      r - the sphere's radius
      Returns:
      true if the given sphere is partly or completely inside the frustum; false otherwise
    • testAab

      public boolean testAab(net.minecraft.world.phys.AABB aabb)
      Description copied from interface: CullFrustum
      Test whether the given axis-aligned box is partly or completely within or outside of the frustum defined by this frustum culler. The box is specified via its min and max corner coordinates.

      The algorithm implemented by this method is conservative. This means that in certain circumstances a false positive can occur, when the method returns true for boxes that do not intersect the frustum. See iquilezles.org for an examination of this problem.

      Specified by:
      testAab in interface CullFrustum
      Parameters:
      aabb - the axis-aligned box
      Returns:
      true if the axis-aligned box is completely or partly inside of the frustum; false otherwise
    • testAab

      public boolean testAab(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
      Description copied from interface: CullFrustum
      Test whether the given axis-aligned box is partly or completely within or outside of the frustum defined by this frustum culler. The box is specified via its min and max corner coordinates.

      The algorithm implemented by this method is conservative. This means that in certain circumstances a false positive can occur, when the method returns true for boxes that do not intersect the frustum. See iquilezles.org for an examination of this problem.

      Reference: Efficient View Frustum Culling

      Specified by:
      testAab in interface CullFrustum
      Parameters:
      minX - the x-coordinate of the minimum corner
      minY - the y-coordinate of the minimum corner
      minZ - the z-coordinate of the minimum corner
      maxX - the x-coordinate of the maximum corner
      maxY - the y-coordinate of the maximum corner
      maxZ - the z-coordinate of the maximum corner
      Returns:
      true if the axis-aligned box is completely or partly inside of the frustum; false otherwise
    • testPlaneXY

      public boolean testPlaneXY(double minX, double minY, double maxX, double maxY)
      Description copied from interface: CullFrustum
      Test whether the given XY-plane (at Z = 0) is partly or completely within or outside of the frustum defined by this frustum culler. The plane is specified via its min and max corner coordinates.

      The algorithm implemented by this method is conservative. This means that in certain circumstances a false positive can occur, when the method returns true for planes that do not intersect the frustum. See iquilezles.org for an examination of this problem.

      Reference: Efficient View Frustum Culling

      Specified by:
      testPlaneXY in interface CullFrustum
      Parameters:
      minX - the x-coordinate of the minimum corner
      minY - the y-coordinate of the minimum corner
      maxX - the x-coordinate of the maximum corner
      maxY - the y-coordinate of the maximum corner
      Returns:
      true if the XY-plane is completely or partly inside of the frustum; false otherwise
    • testPlaneXZ

      public boolean testPlaneXZ(double minX, float minZ, float maxX, float maxZ)
      Description copied from interface: CullFrustum
      Test whether the given XZ-plane (at Y = 0) is partly or completely within or outside of the frustum defined by this frustum culler. The plane is specified via its min and max corner coordinates.

      The algorithm implemented by this method is conservative. This means that in certain circumstances a false positive can occur, when the method returns true for planes that do not intersect the frustum. See iquilezles.org for an examination of this problem.

      Reference: Efficient View Frustum Culling

      Specified by:
      testPlaneXZ in interface CullFrustum
      Parameters:
      minX - the x-coordinate of the minimum corner
      minZ - the z-coordinate of the minimum corner
      maxX - the x-coordinate of the maximum corner
      maxZ - the z-coordinate of the maximum corner
      Returns:
      true if the XZ-plane is completely or partly inside of the frustum; false otherwise
    • testLineSegment

      public boolean testLineSegment(double aX, double aY, double aZ, double bX, double bY, double bZ)
      Description copied from interface: CullFrustum
      Test whether the given line segment, defined by the end points (aX, aY, aZ) and (bX, bY, bZ), is partly or completely within the frustum defined by this frustum culler.
      Specified by:
      testLineSegment in interface CullFrustum
      Parameters:
      aX - the x coordinate of the line segment's first end point
      aY - the y coordinate of the line segment's first end point
      aZ - the z coordinate of the line segment's first end point
      bX - the x coordinate of the line segment's second end point
      bY - the y coordinate of the line segment's second end point
      bZ - the z coordinate of the line segment's second end point
      Returns:
      true if the given line segment is partly or completely inside the frustum; false otherwise
    • getPlanes

      public org.joml.Vector4fc[] getPlanes()
      Specified by:
      getPlanes in interface CullFrustum
      Returns:
      The data for each plane in the frustum
    • getPosition

      public org.joml.Vector3dc getPosition()
      Specified by:
      getPosition in interface CullFrustum
      Returns:
      The position of the camera
    • getModelViewProjectionMatrix

      public org.joml.Matrix4fc getModelViewProjectionMatrix()
      Specified by:
      getModelViewProjectionMatrix in interface CullFrustum
      Returns:
      The matrix used to create this frustum
    • getViewVector

      public org.joml.Vector3fc getViewVector()
      Specified by:
      getViewVector in interface CullFrustum
      Returns:
      The direction of the camera frustum