This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// From 'A Fast Voxel Traversal Algorithm for Ray Tracing' | |
/// by Amanatides and Woo | |
/// http://www.cse.yorku.ca/~amana/research/grid.pdf | |
/// </summary> | |
private static void Trace(Vector3 origin, Vector3 direction, float maxDistance) | |
{ | |
//Initialization | |
int x = Mathf.FloorToInt(origin.x); | |
int y = Mathf.FloorToInt(origin.y); |