|
Atoms Crowd
4.1.0
|
11 #include <Atoms/Globals.h>
12 #include <Atoms/AgentGroup.h>
13 #include <Atoms/AgentTypes.h>
24 AtomsPtr<AtomsCore::MapMetadata> pose;
25 AtomsPtr<AtomsCore::MapMetadata> metadata;
26 AtomsPtr<AtomsCore::MapMetadata> frame;
27 AtomsPtr<AtomsCore::MapMetadata> header;
38 AtomsCache(
const std::string& cachePath,
const std::string& cacheName);
46 AtomsCache(
const std::string& cachePath,
const std::string& cacheName,
const std::vector<int>& agents);
54 bool openCache(
const std::string& cachePath,
const std::string& cacheName);
60 bool openCache(
const std::string& cachePath,
const std::string& cacheName,
const std::vector<int>& agents);
157 const std::string& cachePath,
158 const std::string& cacheName,
160 const std::vector<AtomsPtr<Atoms::AgentGroup>>& agentGroups,
161 std::unordered_map<size_t, size_t>& cacheIdMap,
162 std::set<std::string>& agentTypes,
164 bool useSkinMeshBBox =
false);
170 void blendPose(
size_t numJoints, std::vector<const AtomsCore::Pose*>& posePorts, std::vector<double>& weightPorts,
AtomsCore::Pose& outPose)
const;
173 const std::string&
agentType(
double time,
unsigned int agentId)
const;
185 const std::string&
agentLod(
double time,
unsigned int agentId)
const;
191 const std::vector<int>&
agentIds(
double time)
const;
233 void readData(
FrameData& data,
int frame,
int& m_currentFrame)
const;
235 void readDataKeys(
FrameData& data,
int frame, std::vector<std::string>& keys,
int& m_currentFrame)
const;
237 void readFrameHeaderData(
FrameData& data,
int frame,
int& m_currentFrame)
const;
256 std::vector<std::string> m_agentIdsToLoad;
259 std::string m_cachePath;
262 std::string m_cacheName;
279 std::vector<int> m_emptyIds;
281 std::string m_emptyString;
const std::vector< int > & agentsCreated(double time) const
Gets the list of agent created.
Definition: AtomsCache.h:22
void clear()
Clear all the loaded frames.
const std::vector< int > & agentIds(double time) const
Gets agent ids.
const std::string & agentVariation(double time, unsigned int agentId) const
Get the agent variation.
size_t numAgents() const
Get the number of agents.
int currentFrame() const
Get the current frame.
const std::vector< int > & agentsDeleted(double time) const
Gets the list of agent deleted.
int nextFrame() const
Get the next frame.
FrameData & frameData()
Get the current frame data.
void loadBoundingBox(double time, AtomsCore::Box3 &box) const
Loads bbox.
void processMetadata(AtomsCore::MapMetadata &outMetadata, std::vector< const AtomsCore::MapMetadata * > &inMetadatas, const std::vector< double > &inputWeightVector) const
Blends multiple mapmetadata.
const AtomsCore::Vector3 & agentVelocity(double time, unsigned int agentId) const
Gets the agent velocity.
void loadNextFrame(int frame)
Loads a cache frame and stores the next frame data (usually used for the next frame during the motion...
void setAgentsToLoad(const std::vector< int > &agents)
Sets the agents to be loaded from the cache.
const std::string & cachePath() const
Return the cache path.
int endFrame() const
Get the end frame.
Definition: AtomsCache.h:18
const std::string & agentLod(double time, unsigned int agentId) const
Get the agent lod.
AtomsMath::Box3 Box3
Bounding box class.
Definition: AtomsMath.h:74
static bool exportCacheFrame(const std::string &cachePath, const std::string &cacheName, long frame, const std::vector< AtomsPtr< Atoms::AgentGroup >> &agentGroups, std::unordered_map< size_t, size_t > &cacheIdMap, std::set< std::string > &agentTypes, size_t tags, bool useSkinMeshBBox=false)
Exports a single frame cache file.
AgentTypes & agentTypes()
Return the local agent types object.
AtomsPtr< AgentType > AgentTypePtr
Agent type pointer.
Definition: AgentType.h:17
Agent.
Definition: Agent.h:38
AgentTypePtr loadAgentType(const std::string &agentTypeName, bool asGlobal=true)
Load and get an agent type.
size_t numAgentsCreated(double time) const
Gets the number of agents created.
AtomsCache(const std::string &cachePath, const std::string &cacheName)
Constructor.
void loadAgentBoundingBox(double time, unsigned int agentId, AtomsCore::Box3 &box) const
Loads an agent bbox.
int startFrame() const
Get the start frame.
void blendPose(size_t numJoints, std::vector< const AtomsCore::Pose * > &posePorts, std::vector< double > &weightPorts, AtomsCore::Pose &outPose) const
Blends pose.
AtomsMath::Vector3 Vector3
Vector3 class.
Definition: AtomsMath.h:57
int agentColorVariation(double time, unsigned int agentId) const
Get the agent variation.
void loadNextFrameHeader(int frame)
Loads a cache frame and stores the next frame data (usually used for the next frame during the motion...
void loadFrameHeader(int frame)
Loads a cache frame header and stores the current frame data.
void loadPrevFrame(int frame)
Loads a cache frame and store in the previous frame (usually used for the previous frame during the m...
FrameData & prevFrameData()
Get the previous frame data.
AtomsCache(const std::string &cachePath, const std::string &cacheName, const std::vector< int > &agents)
Constructor.
FrameData & nextFrameData()
Get the next frame data.
void loadAgentMetadata(double time, unsigned int agentId, AtomsCore::MapMetadata &metadata) const
Loads an agent metadata.
Atoms namespace.
Definition: Agent.h:28
void loadAgent(double time, unsigned int agentId, Atoms::Agent &agent) const
Loads all data for an agent.
Container for all agent types.
Definition: AgentTypes.h:20
size_t numAgentsDeleted(double time) const
Gets the number of agent deleted.
bool openCache(const std::string &cachePath, const std::string &cacheName, const std::vector< int > &agents)
Opens a cache.
void loadFrame(int frame)
Loads a cache frame and stores the current frame data.
const AtomsCore::Vector3 & agentPosition(double time, unsigned int agentId) const
Gets the agent position.
const AgentTypes & agentTypes() const
Return the local agent types object.
Pose class.
Definition: Pose.h:32
void loadAgentPose(double time, unsigned int agentId, AtomsCore::Pose &pose) const
Loads an agent pose.
const std::string & agentType(double time, unsigned int agentId) const
Gets the agent type.
void loadPrevFrameHeader(int frame)
Loads a cache frame header and store in the previuos frame (usually used for the previous frame durin...
bool openCache(const std::string &cachePath, const std::string &cacheName)
Opens a cache.
int prevFrame() const
Get the previous frame.
const std::string & cacheName() const
Return the cache name.