Created
January 3, 2017 18:50
-
-
Save define-private-public/009e6317d1f67718eedfc413d2ede568 to your computer and use it in GitHub Desktop.
Peter Shirley Ray Tracing Mini-Books (in Nim); a code snippet that drove me nuts
This file contains 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
method hit*(ry: rotate_y, r: ray, t_min, t_max: float, rec: var hit_record): bool= | |
# I thought this was copying the vec3 data, but it wasn't. It was copying the pointer... | |
var | |
origin = r.origin() | |
direction = r.direction() | |
# origin and direction are modified after this which caused the issue... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment