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 {
17  {
18  public:
19 
20  struct DebugData
21  {
24  AtomsCore::Vector3 sourcePos;
25  double force;
26  bool affected;
27  bool valid;
28  };
29 
31 
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 
Agent group.
Definition: AgentGroup.h:36
Behaviour module.
Definition: BehaviourModule.h:32
Definition: DrawContext.h:17
Definition: MagnetFieldModule.h:17
void draw(Atoms::DrawContext *context, const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
Draw.
void initFrame(const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
Init frame.
void initSimulation(Atoms::AgentGroup *agentGroup)
Init simulation.
Mesh class.
Definition: Mesh.h:30
AtomsMath::Vector3 Vector3
Vector3 class.
Definition: AtomsMath.h:57
AtomsMath::Matrix Matrix
Matrix class.
Definition: AtomsMath.h:63
Definition: MagnetFieldModule.h:21