00001 00005 #include "Primitive.h" 00006 #include "HitRecord.h" 00007 #include "Material.h" 00008 #include "Ray.h" 00009 #include "Vector.h" 00010 00011 Primitive::Primitive(Material* matl) 00012 : matl(matl) 00013 { 00014 } 00015 00016 Primitive::~Primitive() 00017 { 00018 } 00019 00020 void Primitive::preprocess() 00021 { 00022 matl->preprocess(); 00023 } 00024 00025 void Primitive::computeUVW(Vector& uvw, const RenderContext& context, 00026 const Ray& ray, const HitRecord& hit) const 00027 { 00028 Point hitpos = ray.origin()+ray.direction()*hit.minT(); 00029 uvw = Vector(hitpos); 00030 }