-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForce.hpp
35 lines (31 loc) · 840 Bytes
/
Force.hpp
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
#ifndef FORCE_HPP
#define FORCE_HPP
#include <glm/glm.hpp>
#include "cereal/archives/portable_binary.hpp"
#include "Archiver.hpp"
#include "Util.hpp"
struct Force {
enum class Type { Force, Torque };
Id id;
v3 force;
Type t;
bool relative; // motion all relative to actor or absolute
bool affected; // ie. affected by air_res
Force() {}
Force(const Id& id, const v3& force, Type t) :
Force(id,force,t,true,true) {
}
Force(const Id& id, const v3& force, Type t, const bool& relative, const bool& affected) :
id(id),
force(force),
t(t),
relative(relative),
affected(affected)
{
}
template<class Archive>
void serialize(Archive& archive) {
archive(id, force, t, relative, affected);
}
};
#endif