-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject.h
More file actions
37 lines (31 loc) · 843 Bytes
/
Copy pathobject.h
File metadata and controls
37 lines (31 loc) · 843 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
//
// Created by ryousuke kaga on 2023/10/26.
//
#ifndef RAY_TRACER_IN_C_OBJECT_H
#define RAY_TRACER_IN_C_OBJECT_H
#include "matrix.h"
#include "material.h"
#include "transformation.h"
enum object_type_name {
EMPTY_OBJECT,
SPHERE,
PLANE,
CUBE,
CYLINDER,
GROUP
};
typedef struct object_s {
enum object_type_name type_name;
matrix_t origin_transform;
matrix_t direction_transform;
material_t material;
struct object_s* parent;
void* data;
} object_t;
void object_init(object_t* object);
void object_translate(object_t* object, tuple_t translation);
void object_scale(object_t* object, tuple_t scale);
void object_rotate_x(object_t* object, double rad);
void object_rotate_y(object_t* object, double rad);
void object_rotate_z(object_t* object, double rad);
#endif //RAY_TRACER_IN_C_OBJECT_H