erebus

changeset 6:bb006fb96f1b

forgot to add two files
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 24 May 2014 02:22:14 +0300
parents 9621beb22694
children f067148b3494
files liberebus/src/rt.cc liberebus/src/rt.h
diffstat 2 files changed, 27 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/liberebus/src/rt.cc	Sat May 24 02:22:14 2014 +0300
     1.3 @@ -0,0 +1,16 @@
     1.4 +#include "rt.h"
     1.5 +
     1.6 +Color ray_trace(const Ray &ray, const Scene *scn, int iter)
     1.7 +{
     1.8 +	RayHit hit;
     1.9 +	if(!(scn->intersect(ray, &hit))) {
    1.10 +		return Color(0, 0, 0, 0);
    1.11 +	}
    1.12 +
    1.13 +	return shade(hit, iter);
    1.14 +}
    1.15 +
    1.16 +Color shade(const RayHit &hit, int iter)
    1.17 +{
    1.18 +	return Color(1, 0, 0, 1);
    1.19 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/liberebus/src/rt.h	Sat May 24 02:22:14 2014 +0300
     2.3 @@ -0,0 +1,11 @@
     2.4 +#ifndef RT_H_
     2.5 +#define RT_H_
     2.6 +
     2.7 +#include "geomobj.h"
     2.8 +#include "color.h"
     2.9 +#include "scene.h"
    2.10 +
    2.11 +Color ray_trace(const Ray &ray, const Scene *scn, int iter);
    2.12 +Color shade(const RayHit &hit, int iter);
    2.13 +
    2.14 +#endif	// RT_H_