tavli

view src/object.h @ 7:f1ecc2439802

hinges
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 26 Jun 2015 05:23:46 +0300
parents b41ceead1708
children a8e26f163f99
line source
1 #ifndef OBJECT_H_
2 #define OBJECT_H_
4 #include "mesh.h"
5 #include "geom.h"
6 #include "vmath/vmath.h"
8 struct Material {
9 Vector3 diffuse;
10 Vector3 specular;
11 float shininess;
12 float alpha;
13 };
15 class Object {
16 private:
17 Mesh *mesh;
18 Matrix4x4 matrix;
19 unsigned int tex;
20 Matrix4x4 tex_matrix;
22 public:
23 Material mtl;
25 Object();
26 ~Object();
28 Matrix4x4 &xform();
29 const Matrix4x4 &xform() const;
31 Matrix4x4 &tex_xform();
32 const Matrix4x4 &tex_xform() const;
34 void set_mesh(Mesh *m);
35 Mesh *get_mesh() const;
37 void set_texture(unsigned int tex);
39 void draw() const;
41 bool intersect(const Ray &ray, HitPoint *hit) const;
42 };
44 #endif // OBJECT_H_