www.pudn.com > simpleraytracer_v1_0.zip > object.h


/*===================================================================


digital liberation front 2002

_______ ______ _______
/______/\ |______| /\______\
| \ \ | | / / |
| \| | | |/ |
|_____ \ | |_ / ______|
____| | | |_|| |_____
|____| |________||____|




Code by Nicholas Chapman[/ Ono-Sendai]
nickamy@paradise.net.nz

You may use this code for any non-commercial project,
as long as you do not remove this description.

You may not use this code for any commercial project.
====================================================================*/
#ifndef __OBJECT_H__
#define __OBJECT_H__

#include "material.h"
class Geometry;
class Vec3;
class World;

/*===================================================================
Object
------
basically a (material, geometry) pair
====================================================================*/
class Object
{
public:

//deletes 'geometry' on destruction
Object(const Material&amt; material, Geometry* geometry);
~Object();


const Material&amt; getMaterial() const { return material; }
//Material&amt; getMaterial(){ return material; }


Geometry&amt; getGeometry(){ return *geometry; }



//get the colour of the ray that is known to hit this object
void getColourForRay(const Vec3&amt; intersect_pos, const Vec3&amt; unit_raydir,
World&amt; world, Colour&amt; addlighting_out) const;


private:
Material material;//material of the object
Geometry* geometry;//shape of the object

};



#endif //__OBJECT_H__