Atoms Crowd  7.0.0
ContextSteeringModule.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 
12 namespace AtomsModules
13 {
15  {
16  public:
17 
19 
20  virtual ~ContextSteeringModule();
21 
22  virtual void agentsCreated(const std::vector<Atoms::Agent*>& agents, Atoms::AgentGroup* agentGroup) override;
23 
24  virtual void initFrame(const std::vector<Atoms::Agent*>& agents, Atoms::AgentGroup* agentGroup = nullptr) override;
25 
26  virtual void endFrame(const std::vector<Atoms::Agent*>& agents, Atoms::AgentGroup* agentGroup = nullptr) override;
27 
28  virtual void preFrame(Atoms::AgentGroup* agentGroup = nullptr) override;
29 
30  virtual void draw(Atoms::DrawContext* context, const std::vector<Atoms::Agent*>& agents, Atoms::AgentGroup* agentGroup) override;
31 
32  static void generateSamples(Atoms::Agent* Agent, const int numSamples, const double maxDistance);
33 
34  static Atoms::BehaviourModule* creator(const std::string& parameter);
35 
36  private:
37  struct CachedData
38  {
39  AtomsMath::Vector3 dir;
40  float locomotion;
41  float ignore;
42  };
43 
44  std::vector<CachedData> m_newDirections;
45 
46  };
47 }
48 
49 
Agent group.
Definition: AgentGroup.h:36
Agent.
Definition: Agent.h:44
Behaviour module.
Definition: BehaviourModule.h:32
Definition: DrawContext.h:17
Definition: ContextSteeringModule.h:15
virtual void agentsCreated(const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup) override
Agents Created.
virtual void initFrame(const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr) override
Init frame.
virtual void endFrame(const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr) override
End frame.
virtual void draw(Atoms::DrawContext *context, const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup) override
Draw.
virtual void preFrame(Atoms::AgentGroup *agentGroup=nullptr) override
Pre frame.