Class RayCaster
java.lang.Object
com.soulfiremc.server.renderer.RayCaster
Performs ray casting operations for the software renderer.
Uses DDA voxel traversal for blocks and ray-AABB intersection for entities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intcastRay(RenderContext ctx, double dirX, double dirY, double dirZ) Casts a single ray and returns the resulting pixel color.static doublefastInvSqrt(double x) Fast inverse square root (Quake III style, but with double precision).
-
Method Details
-
castRay
Casts a single ray and returns the resulting pixel color.- Parameters:
ctx- The render context containing all necessary datadirX- Normalized ray direction XdirY- Normalized ray direction YdirZ- 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).
-