Atoms Crowd  7.0.0
SyncOperator.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 <AtomsGraph/Ports.h>
11 #include <Atoms/Globals.h>
12 #include <Atoms/Graph/Operator.h>
13 #include <AtomsUtils/Mesh.h>
14 
15 namespace Atoms
16 {
17  class ATOMS_EXPORT SyncOperator : public Operator
18  {
19  public:
20 
21  NODE_STANDARD_MEMBERS
22 
23  SyncOperator();
24 
25  virtual ~SyncOperator();
26 
27  bool compute(const AtomsGraph::ComputeData* computeData);
28 
29  void reset();
30 
31  inline void setParentAgent(Agent* parent) { m_parentAgent = parent; }
32 
33  inline Agent* parentAgent() { return m_parentAgent; }
34 
35  inline AtomsGraph::LongPort* jointPort() { return m_agentJointPort; }
36 
37  inline AtomsGraph::LongPort* parentJointPort() { return m_parentAgentJointPort; }
38 
39  inline AtomsGraph::BooleanPort* keepClipOffsetPort() { return m_keepOffsetPort; }
40 
41  inline AtomsGraph::VectorPort* translationOffsetPort() { return m_offsetTranslationPort; }
42 
43  inline AtomsGraph::QuaternionPort* rotationOffsetPort() { return m_offsetRotationPort; }
44 
45  inline AtomsGraph::VectorPort* scaleOffsetPort() { return m_offsetScalePort; }
46 
47  inline AtomsGraph::BooleanPort* useParentScalePort() { return m_useParentScalePort; }
48 
49  inline AtomsGraph::BooleanPort* useTranslationWorldSpaceOffsetPort() { return m_translationWorldSpaceOffsetPort; }
50 
51  void setupDefaultPose();
52 
53  private:
54 
55  AtomsGraph::PosePort* m_inPose;
56 
57  AtomsGraph::LongPort* m_agentJointPort;
58 
59  AtomsGraph::LongPort* m_parentAgentJointPort;
60 
61  AtomsGraph::BooleanPort* m_keepOffsetPort;
62 
63  AtomsGraph::BooleanPort* m_translationWorldSpaceOffsetPort;
64 
65  AtomsGraph::VectorPort* m_offsetTranslationPort;
66 
67  AtomsGraph::QuaternionPort* m_offsetRotationPort;
68 
69  AtomsGraph::VectorPort* m_offsetScalePort;
70 
71  AtomsGraph::BooleanPort* m_useParentScalePort;
72 
73  AtomsGraph::DoublePort* m_timePort;
74 
75  AtomsMath::Matrix m_worldLocalOffset;
76 
77  std::vector<unsigned short> m_parentJointIds;
78 
79  AtomsCore::Pose m_agentFullPose;
80 
81  Agent* m_parentAgent;
82 
83  bool m_first;
84  };
85 }
Agent.
Definition: Agent.h:44
Operator node.
Definition: Operator.h:26
Definition: SyncOperator.h:18
bool compute(const AtomsGraph::ComputeData *computeData)
Compute function.
void reset()
Operator reset function.
Pose class.
Definition: Pose.h:32
Definition: Node.h:21
Generic node port class.
Definition: PortTemplate.h:24
Atoms namespace.
Definition: Agent.h:29