Subversion Repositories gelsvn

Rev

Rev 349 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
353 awk 1
#ifndef __PATHTRACER_MESH__H__
2
#define __PATHTRACER_MESH__H__
349 awk 3
 
353 awk 4
#include "luminaire.h"
5
#include "material.h"
349 awk 6
 
7
namespace Geometry { class TriMesh; class IndexedFaceSet; }
8
 
9
class mesh : public luminaire
10
{
11
public:
12
    //ctor
13
    mesh(void);
14
    mesh(const std::string&);
15
    ~mesh(void);
16
 
17
    //geometry
18
    const Geometry::TriMesh& get_trimesh(void) const;
19
    void set_trimesh(const Geometry::TriMesh&);
20
    const CGLA::Vec3f& triangle_normal(size_t i) const;
21
 
22
    //material
23
    const material* get_material(void) const;
24
    void set_material(const material*);
25
 
26
    //exitance (W/m2) (assuming diffuse emission)
27
    CGLA::Vec3f exitance(void) const;
28
    void set_exitance(const CGLA::Vec3f&);
29
 
30
    //sampling of mesh luminaire
31
    bool sample(const ray&, const hit_info&, CGLA::Vec3f& L, 
32
        CGLA::Vec3f& w) const;
33
 
34
protected:
35
    Geometry::TriMesh* msh_;
36
    std::vector<CGLA::Vec3f> triangle_normals_;
37
    Geometry::IndexedFaceSet* tangents_;
38
    const material* mat_;
39
    CGLA::Vec3f exitance_;
40
};
41
 
42
#endif
43
 
44
//02566 framework, Anders Wang Kristensen, awk@imm.dtu.dk, 2007