Added makefile

This commit is contained in:
Martin committed 2024-11-14 18:02:32 +01:00
1 parent 1974d7bcc0
commit ed3adbd4c4
16 files changed
+38 -1

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
#pragma once
#include <cuda_runtime.h>
#include <cmath>
#include "linalg/linalg.h"
struct Sphere {
Vec3 center;
double radius;
Vec3 color;
__device__ bool intersect(const Vec3& rayOrigin, const Vec3& rayDir, double& t) const {
Vec3 oc = rayOrigin - center;
double b = oc.dot(rayDir);
double c = oc.dot(oc) - radius * radius;
double h = b * b - c;
if (h < 0.0) return false;
h = sqrt(h);
t = -b - h;
return true;
}
};
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.