/
Access agent data (AtomsUnreal)
Access agent data (AtomsUnreal)
AtomsPtr<Atoms::AgentGroup> agent_group = Cast<AAtomsAgentGroup>(Actor);
//get agent from the agent group
auto& agents = agent_group->agents()
Atoms::Agent* agent = agents[0];
//get agent from the agents pool
agent = Atoms::AgentsPool::instance().agent(0);
// get agent pose object
AtomsCore::Pose& pose = agent->pose();
// get agent type
AtomsPtr<const Atoms::AgentType> agent_type = agent->agentType();
// get he skeleotn
AtomsCore::Skeleton& skeleton = agent_type->skeleton();
// get the pose from the agent
AtomsCore::Poser poser(&agent_type->skeleton());
auto matrices = poser.getAllWorldMatrix(pose);
// get agent metadata
AtomsPtr<AtomsCore::MapMetadata>& agent_metas = agent.metadata();
//get agent group id
int groupId = agent_metas->getTypedEntry<AtomsCore::IntMetadata>("groupId")->get();
// or the faster version
groupId = agent->groupId()->get();
// get agent direction
AtomsCore::Vector3 direction = agent_metas->getTypedEntry<AtomsCore::Vector3Metadata>("direction")->get();
// or the faster version
direction = agent->direction()->get();
// get agent position
AtomsCore::Vector3 position= agent_metas->getTypedEntry<AtomsCore::Vector3Metadata>("position")->get();
// or the faster version
direction = agent->position()->get();
, multiple selections available,
Related content
Writing an Atoms operator (AtomsUnreal)
Writing an Atoms operator (AtomsUnreal)
More like this
Reading the world joint matrices of an agent
Reading the world joint matrices of an agent
More like this
Vex Reference
Vex Reference
More like this
Writing a Metadata Replicator module
Writing a Metadata Replicator module
More like this
State machine debugger data
State machine debugger data
More like this
Writing a behaviour module
Writing a behaviour module
More like this
Copyright © 2017, Toolchefs LTD.