-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphysics.h
More file actions
50 lines (35 loc) · 769 Bytes
/
physics.h
File metadata and controls
50 lines (35 loc) · 769 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
41
42
43
44
45
46
47
48
49
50
//
// physics.h
// RayThrower
//
// Created by Max Scribner on 4/13/19.
// Copyright © 2019 Max Scribner. All rights reserved.
//
#ifndef physics_h
#define physics_h
#include "vector.h"
#include <stdio.h>
typedef struct object Object;
typedef struct color {
uint8_t r;
uint8_t g;
uint8_t b;
} Color;
typedef struct light {
vec3 position;
vec3 velocity;
} Light;
typedef struct object {
vec3 pos;
vec3 direction;
float radius;
vec3 (*normal)(Object*, vec3);
float (*dist)(Object*, vec3);
Color (*color)(Object*, vec3);
} Object;
extern vec3 (*acceleration_field)(vec3);
Object *update_light(Light*);
extern Object object;
vec3 flat_field(vec3 pos);
vec3 gravity_field(vec3 pos);
#endif /* physics_h */