Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
RayTracer
*.tga
*.gch
*.out
*.o

/bazel-*
1 change: 1 addition & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
workspace(name = "raytracer")
7 changes: 4 additions & 3 deletions src/BSP.cpp → raytracer/BSP.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "BSP.h"
#include <limits>
#include "Object.h"

#include "BSP.h"
#include "Intersection.h"
#include "objects/Object.h"

using namespace std;

Expand All @@ -18,7 +19,7 @@ void BSP::build() {
}

// For debugging.
if (true) {
if (false) {
for (int i = 0; i < depth; i++) {
cout << "\t";
}
Expand Down
File renamed without changes.
110 changes: 110 additions & 0 deletions raytracer/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
package(default_visibility = ["//visibility:public"])

cc_binary(
name = "raytracer",
srcs = [
"main.cpp",
],
deps = [
":lib",
],
)

cc_library(
name = "lib",
srcs = ["RayTracer.cpp"],
hdrs = ["RayTracer.h"],
deps = [
":bsp",
":camera",
":image",
":light",
":vector",
"//raytracer/materials",
"//raytracer/materials:normal_map",
"//raytracer/objects",
],
)


cc_library(
name = "boundaries",
srcs = ["Boundaries.cpp"],
hdrs = ["Boundaries.h"],
deps = [
":ray",
":vector",
],
)

cc_library(
name = "bsp",
srcs = ["BSP.cpp"],
hdrs = ["BSP.h"],
deps = [
":boundaries",
":intersection",
"//raytracer/objects:object",
],
)

cc_library(
name = "camera",
srcs = ["Camera.cpp"],
hdrs = ["Camera.h"],
deps = [
":vector",
],
)

cc_library(
name = "color",
srcs = ["Color.cpp"],
hdrs = ["Color.h"],
)

cc_library(
name = "image",
srcs = ["Image.cpp"],
hdrs = ["Image.h"],
deps = [
":color",
],
)

cc_library(
name = "intersection",
srcs = ["Intersection.cpp"],
hdrs = ["Intersection.h"],
deps = [
":color",
":ray",
":vector",
"//raytracer/objects:object",
"//raytracer/materials:material",
],
)

cc_library(
name = "light",
srcs = ["Light.cpp"],
hdrs = ["Light.h"],
deps = [
":vector",
],
)

cc_library(
name = "ray",
srcs = ["Ray.cpp"],
hdrs = ["Ray.h"],
deps = [
":vector",
],
)

cc_library(
name = "vector",
srcs = ["Vector.cpp"],
hdrs = ["Vector.h"],
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/Intersection.h → raytracer/Intersection.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#define __INTERSECTION_H__

#include <limits>
#include "Vector.h"
#include "Object.h"
#include "Color.h"
#include "Ray.h"
#include "Material.h"
#include "Vector.h"
#include "materials/Material.h"
#include "objects/Object.h"

class Intersection {
public:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading