Atoms Crowd
7.0.0
MagnetFieldModule.h
1
#pragma once
2
// ===========================================================================
3
// Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
4
//
5
// Use of this software is subject to the terms of the Toolchefs license
6
// agreement provided at the time of installation or download, or which
7
// otherwise accompanies this software in either electronic or hard copy form.
8
// ===========================================================================
9
10
#include <Atoms/BehaviourModule.h>
11
#include <AtomsUtils/Mesh.h>
12
13
14
namespace
AtomsModules
15
{
16
class
MagnetFieldModule
:
public
Atoms::BehaviourModule
17
{
18
public
:
19
20
struct
DebugData
21
{
22
AtomsCore::Vector3
pos;
23
AtomsCore::Vector3
dir;
24
AtomsCore::Vector3
sourcePos;
25
double
force;
26
bool
affected;
27
bool
valid;
28
};
29
30
MagnetFieldModule
();
31
32
~
MagnetFieldModule
();
33
34
void
initSimulation
(
Atoms::AgentGroup
* agentGroup);
35
36
void
initFrame
(
const
std::vector<Atoms::Agent*>& agents,
Atoms::AgentGroup
* agentGroup =
nullptr
);
37
38
void
draw
(
Atoms::DrawContext
* context,
const
std::vector<Atoms::Agent*>& agents,
Atoms::AgentGroup
* agentGroup =
nullptr
);
39
40
static
Atoms::BehaviourModule
* creator(
const
std::string& parameter);
41
42
private
:
43
44
std::vector<DebugData> m_debugData;
45
46
AtomsUtils::Mesh
m_mesh;
47
48
AtomsCore::Matrix
m_meshMatrix;
49
50
AtomsCore::Matrix
m_meshInverseMatrix;
51
52
bool
m_activeDraw;
53
54
bool
m_first;
55
56
};
57
}
58
59
60
Atoms::AgentGroup
Agent group.
Definition:
AgentGroup.h:36
Atoms::BehaviourModule
Behaviour module.
Definition:
BehaviourModule.h:32
Atoms::DrawContext
Definition:
DrawContext.h:17
AtomsModules::MagnetFieldModule
Definition:
MagnetFieldModule.h:17
AtomsModules::MagnetFieldModule::draw
void draw(Atoms::DrawContext *context, const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
Draw.
AtomsModules::MagnetFieldModule::initFrame
void initFrame(const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
Init frame.
AtomsModules::MagnetFieldModule::initSimulation
void initSimulation(Atoms::AgentGroup *agentGroup)
Init simulation.
AtomsUtils::Mesh
Mesh class.
Definition:
Mesh.h:30
AtomsCore::Vector3
AtomsMath::Vector3 Vector3
Vector3 class.
Definition:
AtomsMath.h:57
AtomsCore::Matrix
AtomsMath::Matrix Matrix
Matrix class.
Definition:
AtomsMath.h:63
AtomsModules::MagnetFieldModule::DebugData
Definition:
MagnetFieldModule.h:21
Atoms
Public
AtomsModules
MagnetFieldModule.h