Class RayCaster

java.lang.Object
com.soulfiremc.server.renderer.RayCaster

public final class RayCaster extends Object
Performs ray casting operations for the software renderer. Uses DDA voxel traversal for blocks and ray-AABB intersection for entities.
  • Method Details

    • castRay

      public static int castRay(RenderContext ctx, double dirX, double dirY, double dirZ)
      Casts a single ray and returns the resulting pixel color.
      Parameters:
      ctx - The render context containing all necessary data
      dirX - Normalized ray direction X
      dirY - Normalized ray direction Y
      dirZ - Normalized ray direction Z
      Returns:
      The ARGB color for this ray
    • fastInvSqrt

      public static double fastInvSqrt(double x)
      Fast inverse square root (Quake III style, but with double precision).