aboutsummaryrefslogtreecommitdiff
path: root/scene.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene.h')
-rw-r--r--scene.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/scene.h b/scene.h
index 1c6363b..7efb5cd 100644
--- a/scene.h
+++ b/scene.h
@@ -23,16 +23,23 @@ typedef struct {
typedef struct light_s{
vector_t *pos;
- color_t *col;
+ color_t *defuse;
struct light_s *next;
} light_t;
+typedef struct {
+ vector_t color;
+} material_t;
+
// General object structure
typedef struct object_s{
uint8_t type;
struct object_s *next;
+ // Color and light information
+ material_t *m;
+
union {
sphere_t sph;
plane_t pl;
@@ -45,8 +52,10 @@ typedef struct {
light_t *lights;
} space_t;
-object_t *add_sphere(space_t *s, vector_t *c, COORD_T r);
+object_t *add_sphere(space_t *s, vector_t *c, COORD_T r, material_t *m);
object_t *add_plane(space_t *s, vector_t *start, vector_t *dir);
-light_t *add_light(space_t *s, vector_t *pos, color_t *c);
+light_t *add_light(space_t *s, vector_t *pos, color_t *defuse);
+
+void obj_norm_at(object_t *o, vector_t *dest, vector_t *point);
#endif