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 an Atoms Cache
Reading an Atoms Cache
More like this
Agent type
Agent type
More like this
Writing an Atoms operator
Writing an Atoms operator
More like this
Reading the world joint matrices of an agent
Reading the world joint matrices of an agent
More like this
Writing a Metadata Replicator module
Writing a Metadata Replicator module
More like this
Copyright © 2017, Toolchefs LTD.