-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathobject.h
More file actions
40 lines (31 loc) · 674 Bytes
/
object.h
File metadata and controls
40 lines (31 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// object.h
// raycast
//
// Created by Liam Westby on 2/19/13.
// Copyright (c) 2013 Liam Westby. All rights reserved.
//
#include "ppm.h"
#ifndef raycast_object_h
#define raycast_object_h
#define SPHERE_TYPE 1
#define PLANE_TYPE 2
#define OBJECTS_COUNT 7
typedef struct {
int type;
union {
struct {
float *center;
float radius;
} sphere;
struct {
float *point;
float *normal;
} plane;
} definition;
float reflectivity;
pixel color;
} object;
object** get_objects();
float object_intersect(object *to_check, float *origin, float *direction);
#endif