-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhysics.cpp
More file actions
57 lines (50 loc) · 2.12 KB
/
Physics.cpp
File metadata and controls
57 lines (50 loc) · 2.12 KB
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
51
52
53
54
55
56
57
///
/// Langulus::Module::Physics
/// Copyright (c) 2017 Dimo Markov <team@langulus.com>
/// Part of the Langulus framework, see https://langulus.com
///
/// SPDX-License-Identifier: GPL-3.0-or-later
///
#include "Physics.hpp"
#include <Langulus/Math/Normal.hpp>
#include <Langulus/Math/Primitives.hpp>
#include <Langulus/Math/Angle.hpp>
#include <Langulus/Math/SimplexNoise.hpp>
#include <Langulus/Math/Config.hpp>
LANGULUS_DEFINE_MODULE(
Euclidean::Physics, 9, "Physics",
"Euclidean physics module, implementing spatiality", "",
Euclidean::Physics, Euclidean::World, Euclidean::Instance
)
using namespace Euclidean;
/// Module construction
/// @param runtime - the runtime that owns the module
/// @param descriptor - instructions for configuring the module
Physics::Physics(Runtime* runtime, const Many&)
: Resolvable {this}
, Module {runtime} {
VERBOSE_PHYSICS("Initializing...");
Math::RegisterVectors();
Math::RegisterRanges();
Math::RegisterNormals();
Math::RegisterPrimitives();
Math::RegisterAngles();
VERBOSE_PHYSICS("Initialized");
}
/// First stage destruction
void Physics::Teardown() {
mWorlds.Teardown();
}
/// Module update routine
/// @param dt - time from last update
bool Physics::Update(Time) {
LANGULUS(PROFILE);
for (auto& world : mWorlds)
world.Update();
return true;
}
/// Create/Destroy worlds
/// @param verb - the creation/destruction verb
void Physics::Create(Verb& verb) {
mWorlds.Create(this, verb);
}