10 #include <Atoms/Globals.h>
11 #include <Atoms/AgentType.h>
12 #include <AtomsCore/Pose.h>
13 #include <AtomsCore/Metadata/MapMetadata.h>
14 #include <AtomsCore/Metadata/Vector3Metadata.h>
15 #include <AtomsCore/Metadata/IntMetadata.h>
16 #include <AtomsCore/Metadata/BoolMetadata.h>
17 #include <AtomsCore/Metadata/DoubleMetadata.h>
18 #include <AtomsCore/Metadata/StringMetadata.h>
19 #include <AtomsCore/Metadata/MatrixArrayMetadata.h>
20 #include <AtomsCore/Metadata/QuaternionMetadata.h>
21 #include <AtomsCore/Metadata/FloatArrayMetadata.h>
22 #include <AtomsCore/Metadata/Vector3ArrayMetadata.h>
23 #include <AtomsCore/Serialiser.h>
24 #include <Atoms/Graph/AgentBehaviourNetwork.h>
25 #include <Atoms/ContextSteering.h>
127 inline AtomsCore::Rand48& random();
133 inline size_t profileTime()
const;
136 inline size_t profileThreadId()
const;
139 inline void setProfileThreadBatch(
size_t value);
142 inline size_t profileThreadBatch()
const;
154 void transform(
const AtomsMath::Matrix& transformMatrix,
bool affectPosition =
true,
bool affectDirection =
true,
bool affectGroundHeight =
true);
160 inline const bool hasValidContextSteeringData()
const;
162 void initializeMetadataPointers();
164 void setNavigationData(AtomsPtr<AgentNavigationData>& data);
166 void removeNavigationData();
168 AtomsPtr<AgentNavigationData>& navigationData();
172 AtomsPtr<AtomsCore::IntMetadata>& groupId();
173 AtomsPtr<AtomsCore::StringMetadata>& groupIdStr();
174 AtomsPtr<AtomsCore::IntMetadata>& id();
175 AtomsPtr<AtomsCore::Vector3Metadata>& position();
176 AtomsPtr<AtomsCore::Vector3Metadata>& scale();
177 AtomsPtr<AtomsCore::QuaternionMetadata>& rotation();
178 AtomsPtr<AtomsCore::Vector3Metadata>& direction();
179 AtomsPtr<AtomsCore::Vector3Metadata>& prevDirection();
180 AtomsPtr<AtomsCore::Vector3Metadata>& up();
181 AtomsPtr<AtomsCore::Vector3Metadata>& velocity();
182 AtomsPtr<AtomsCore::Vector3Metadata>& gravity();
183 AtomsPtr<AtomsCore::DoubleMetadata>& birth();
184 AtomsPtr<AtomsCore::IntMetadata>& state();
185 AtomsPtr<AtomsCore::IntMetadata>& currentState();
186 AtomsPtr<AtomsCore::IntMetadata>& active();
187 AtomsPtr<AtomsCore::DoubleMetadata>& frameRate();
188 AtomsPtr<AtomsCore::DoubleMetadata>& frameRateOverride();
189 AtomsPtr<AtomsCore::BoolMetadata>& disableIk();
190 AtomsPtr<AtomsCore::BoolMetadata>& disableFootLock();
191 AtomsPtr<AtomsCore::IntMetadata>& syncLevel();
192 AtomsPtr<AtomsCore::IntMetadata>& animationMode();
193 AtomsPtr<AtomsCore::Metadata>& animState();
194 AtomsPtr<AtomsCore::BoolMetadata>& forceClipTransition();
195 AtomsPtr<AtomsCore::BoolMetadata>& visible();
196 AtomsPtr<AtomsCore::DoubleMetadata>& linearVelocity();
197 AtomsPtr<AtomsCore::DoubleMetadata>& angularVelocity();
198 AtomsPtr<AtomsCore::DoubleMetadata>& frameAngularVelocity();
199 AtomsPtr<AtomsCore::BoolMetadata>& locomotionActive();
200 AtomsPtr<AtomsCore::Vector3Metadata>& velocityOverride();
201 AtomsPtr<AtomsCore::BoolMetadata>& useVelocityOverride();
203 AtomsPtr<AtomsCore::IntMetadata>& _atypeid();
204 AtomsPtr<AtomsCore::BoolMetadata>& _culled();
205 AtomsPtr<AtomsCore::MatrixArrayMetadata>& _wm();
206 AtomsPtr<AtomsCore::DoubleMetadata>& maxSimDistance(
double defaultValue);
207 AtomsPtr<AtomsCore::FloatArrayMetadata>& perInstanceMetadata();
209 AtomsPtr<AtomsCore::IntMetadata>& minLod();
210 AtomsPtr<AtomsCore::Vector3Metadata>& _navtp();
211 AtomsPtr<AtomsCore::Vector3ArrayMetadata>& _navfp();
212 AtomsPtr<AtomsCore::Vector3Metadata>& previousPos();
214 AtomsPtr<const AtomsCore::IntMetadata> groupId()
const;
215 AtomsPtr<const AtomsCore::StringMetadata> groupIdStr()
const;
216 AtomsPtr<const AtomsCore::IntMetadata> id()
const;
217 AtomsPtr<const AtomsCore::Vector3Metadata> position()
const;
218 AtomsPtr<const AtomsCore::Vector3Metadata> scale()
const;
219 AtomsPtr<const AtomsCore::QuaternionMetadata> rotation()
const;
220 AtomsPtr<const AtomsCore::Vector3Metadata> direction()
const;
221 AtomsPtr<const AtomsCore::Vector3Metadata> prevDirection()
const;
222 AtomsPtr<const AtomsCore::Vector3Metadata> up()
const;
223 AtomsPtr<const AtomsCore::Vector3Metadata> velocity()
const;
224 AtomsPtr<const AtomsCore::Vector3Metadata> gravity()
const;
225 AtomsPtr<const AtomsCore::DoubleMetadata> birth()
const;
226 AtomsPtr<const AtomsCore::IntMetadata> state()
const;
227 AtomsPtr<const AtomsCore::IntMetadata> currentState()
const;
228 AtomsPtr<const AtomsCore::IntMetadata> active()
const;
229 AtomsPtr<const AtomsCore::DoubleMetadata> frameRate()
const;
230 AtomsPtr<const AtomsCore::DoubleMetadata> frameRateOverride()
const;
231 AtomsPtr<const AtomsCore::BoolMetadata> disableIk()
const;
232 AtomsPtr<const AtomsCore::BoolMetadata> disableFootLock()
const;
233 AtomsPtr<const AtomsCore::IntMetadata> syncLevel()
const;
234 AtomsPtr<const AtomsCore::IntMetadata> animationMode()
const;
235 AtomsPtr<const AtomsCore::Metadata> animState()
const;
236 AtomsPtr<const AtomsCore::BoolMetadata> forceClipTransition()
const;
237 AtomsPtr<const AtomsCore::BoolMetadata> visible()
const;
238 AtomsPtr<const AtomsCore::DoubleMetadata> linearVelocity()
const;
239 AtomsPtr<const AtomsCore::DoubleMetadata> angularVelocity()
const;
240 AtomsPtr<const AtomsCore::DoubleMetadata> frameAngularVelocity()
const;
241 AtomsPtr<const AtomsCore::BoolMetadata> locomotionActive()
const;
242 AtomsPtr<const AtomsCore::Vector3Metadata> velocityOverride()
const;
243 AtomsPtr<const AtomsCore::BoolMetadata> useVelocityOverride()
const;
244 AtomsPtr<const AtomsCore::Vector3Metadata> _navtp()
const;
245 AtomsPtr<const AtomsCore::Vector3ArrayMetadata> _navfp()
const;
249 AtomsPtr<AtomsCore::IntMetadata> m_groupIdPtr;
250 AtomsPtr<AtomsCore::StringMetadata> m_groupIdStrPtr;
251 AtomsPtr<AtomsCore::IntMetadata> m_idPtr;
252 AtomsPtr<AtomsCore::Vector3Metadata> m_positionPtr;
253 AtomsPtr<AtomsCore::Vector3Metadata> m_scalePtr;
254 AtomsPtr<AtomsCore::QuaternionMetadata> m_rotationPtr;
255 AtomsPtr<AtomsCore::Vector3Metadata> m_directionPtr;
256 AtomsPtr<AtomsCore::Vector3Metadata> m_prevDirectionPtr;
257 AtomsPtr<AtomsCore::Vector3Metadata> m_upPtr;
258 AtomsPtr<AtomsCore::Vector3Metadata> m_velocityPtr;
259 AtomsPtr<AtomsCore::Vector3Metadata> m_gravityPtr;
260 AtomsPtr<AtomsCore::DoubleMetadata> m_birthPtr;
261 AtomsPtr<AtomsCore::IntMetadata> m_statePtr;
262 AtomsPtr<AtomsCore::IntMetadata> m_currentStatePtr;
263 AtomsPtr<AtomsCore::IntMetadata> m_activePtr;
264 AtomsPtr<AtomsCore::DoubleMetadata> m_frameRatePtr;
265 AtomsPtr<AtomsCore::DoubleMetadata> m_frameRateOverridePtr;
266 AtomsPtr<AtomsCore::BoolMetadata> m_disableIkPtr;
267 AtomsPtr<AtomsCore::BoolMetadata> m_disableFootLockPtr;
268 AtomsPtr<AtomsCore::IntMetadata> m_syncLevelPtr;
269 AtomsPtr<AtomsCore::IntMetadata> m_animationModePtr;
270 AtomsPtr<AtomsCore::Metadata> m_animStatePtr;
271 AtomsPtr<AtomsCore::BoolMetadata> m_forceClipTransitionPtr;
272 AtomsPtr<AtomsCore::BoolMetadata> m_visiblePtr;
273 AtomsPtr<AtomsCore::DoubleMetadata> m_linearVelocityPtr;
274 AtomsPtr<AtomsCore::DoubleMetadata> m_angularVelocityPtr;
275 AtomsPtr<AtomsCore::DoubleMetadata> m_frameAngularVelocity;
276 AtomsPtr<AtomsCore::BoolMetadata> m_locomotionActivePtr;
277 AtomsPtr<AtomsCore::Vector3Metadata> m_velocityOverridePtr;
278 AtomsPtr<AtomsCore::BoolMetadata> m_useVelocityOverridePtr;
280 AtomsPtr<AtomsCore::IntMetadata> m_atypeidPtr;
281 AtomsPtr<AtomsCore::BoolMetadata> m_culledPtr;
282 AtomsPtr<AtomsCore::MatrixArrayMetadata> m_wmPtr;
283 AtomsPtr<AtomsCore::DoubleMetadata> m_maxSimDistancePtr;
284 AtomsPtr<AtomsCore::FloatArrayMetadata> m_perInstanceMetadata;
286 AtomsPtr<AtomsCore::IntMetadata> m_minLod;
287 AtomsPtr<AtomsCore::Vector3Metadata> m_navtpPtr;
288 AtomsPtr<AtomsCore::Vector3ArrayMetadata> m_navfpPtr;
289 AtomsPtr<AgentNavigationData> m_navData;
290 AtomsPtr<AtomsCore::Vector3Metadata> m_previousPosPtr;
323 AtomsCore::Rand48 m_random;
326 size_t m_profileTime;
329 size_t m_profileThreadId;
332 size_t m_profileThreadBatch;
336 std::unique_ptr<ContextSteeringData> m_contextSteering;
349 #include "Agent.impl.h"
Agent behaviour network.
Definition: AgentBehaviourNetwork.h:29
Agent.
Definition: Agent.h:44
void computeBoundingBox()
Computes the agent bounding box.
void computeMeshBoundingBox()
Compute the bounding box using the skinned meshes.
void lock()
lock the agent mutex
void reset()
Reset the agent.
size_t memSize() const
Gets the memory size of this agent.
void transform(const AtomsMath::Matrix &transformMatrix, bool affectPosition=true, bool affectDirection=true, bool affectGroundHeight=true)
Transform the agent by the given matrix.
void unlock()
unlock the agent mutex
std::mutex & mutex()
Agent mutex.
void setAgentType(AgentTypeCPtr agentType)
Sets the agent type.
void computePose(double simTime=0.0)
Computes the agent pose.
Agents pool.
Definition: AgentsPool.h:24
Definition: ContextSteering.h:16
Archive class.
Definition: Serialiser.h:29
Pose class.
Definition: Pose.h:32
AtomsCore namespace.
Definition: Agent.h:344
AtomsMath::Box3 Box3
Bounding box class.
Definition: AtomsMath.h:74
Atoms namespace.
Definition: Agent.h:29
AtomsPtr< const AgentType > AgentTypeCPtr
Agent type const pointer.
Definition: AgentType.h:21