Skip to content

Instantly share code, notes, and snippets.

@Balletie
Created July 21, 2014 13:25
Show Gist options
  • Save Balletie/f9283bf78310a05824b1 to your computer and use it in GitHub Desktop.
Save Balletie/f9283bf78310a05824b1 to your computer and use it in GitHub Desktop.
5 unsigned char
6 intersect(
7 __const float4 origin,
8 float4 dir,
9 shape shape)
10 {
11 float4 trans_origin = origin - shape.sphere.origin;
12 //float a = 0;
13 float a = dot(dir, dir);
14 //float b = 0;
15 float b = 2 * dot(dir, dir);
16 float c = 0;
17 //float c = dot(trans_origin, trans_origin) - dot(shape.sphere.radius, shape.sphere.radius);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment