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);
160 const std::string& cachePath,
161 const std::string& cacheName,
163 const std::vector<AtomsPtr<Atoms::AgentGroup>>& agentGroups,
164 std::unordered_map<size_t, size_t>& cacheIdMap,
165 std::set<std::string>& agentTypes,
167 bool useSkinMeshBBox =
false);
173 void blendPose(
size_t numJoints, std::vector<const AtomsCore::Pose*>& posePorts, std::vector<double>& weightPorts,
AtomsCore::Pose& outPose)
const;
176 const std::string&
agentType(
double time,
unsigned int agentId)
const;
203 const std::string&
agentLod(
double time,
unsigned int agentId)
const;
209 const std::vector<int>&
agentIds(
double time)
const;
250 int clampFrame(
int frame)
const;
253 void readData(
FrameData& data,
int frame,
int& m_currentFrame)
const;
255 void readDataKeys(
FrameData& data,
int frame, std::vector<std::string>& keys,
int& m_currentFrame)
const;
257 void readFrameHeaderData(
FrameData& data,
int frame,
int& m_currentFrame)
const;
276 std::vector<std::string> m_agentIdsToLoad;
279 std::string m_cachePath;
282 std::string m_cacheName;
299 std::vector<int> m_emptyIds;
301 std::string m_emptyString;
303 std::vector<std::string> m_emptyStringVector;
Agent.
Definition: Agent.h:44
Container for all agent types.
Definition: AgentTypes.h:20
Definition: AtomsCache.h:22
Definition: AtomsCache.h:18
void loadTime(double time)
Loads the pre/next and current frame given the input time.
const std::string & cachePath() const
Return the cache path.
const std::vector< int > & agentIds(double time) const
Gets agent ids.
void loadNextFrame(int frame)
Loads a cache frame and stores the next frame data (usually used for the next frame during the motion...
void clear()
Clear all the loaded frames.
const std::string & agentLod(double time, unsigned int agentId) const
Get the agent lod.
const std::string & agentType(double time, unsigned int agentId) const
Gets the agent type.
size_t numAgents() const
Get the number of agents.
const std::string & cacheName() const
Return the cache name.
const std::vector< std::string > & agentsVariationsGeometryFilter(double time, unsigned int agentId) const
Get the agent variation geo filter overrides.
bool openCache(const std::string &cachePath, const std::string &cacheName, const std::vector< int > &agents)
Opens a cache.
const std::vector< std::string > & agentsVariationsGeoMatOverride(double time, unsigned int agentId) const
Get the agent variation geo mat overrides.
size_t numAgentsCreated(double time) const
Gets the number of agents created.
int prevFrame() const
Get the previous frame.
void loadAgentMetadata(double time, unsigned int agentId, AtomsCore::MapMetadata &metadata) const
Loads an agent metadata.
void loadFrameHeader(int frame)
Loads a cache frame header and stores the current frame data.
const std::vector< std::string > & agentVariationOverrides(double time, unsigned int agentId) const
Get the agent variation overrides.
int nextFrame() const
Get the next frame.
const AgentTypes & agentTypes() const
Return the local agent types object.
AgentTypes & agentTypes()
Return the local agent types object.
bool openCache(const std::string &cachePath, const std::string &cacheName)
Opens a cache.
void loadAgent(double time, unsigned int agentId, Atoms::Agent &agent) const
Loads all data for an agent.
FrameData & nextFrameData()
Get the next frame data.
int startFrame() const
Get the start frame.
void processMetadata(AtomsCore::MapMetadata &outMetadata, std::vector< const AtomsCore::MapMetadata * > &inMetadatas, const std::vector< double > &inputWeightVector) const
Blends multiple mapmetadata.
void loadNextFrameHeader(int frame)
Loads a cache frame and stores the next frame data (usually used for the next frame during the motion...
const int agentVariationSeed(double time, unsigned int agentId) const
Get the agent variation seed.
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.
void loadAgentBoundingBox(double time, unsigned int agentId, AtomsCore::Box3 &box) const
Loads an agent bbox.
const AtomsCore::Vector3 & agentPosition(double time, unsigned int agentId) const
Gets the agent position.
FrameData & prevFrameData()
Get the previous frame data.
void loadBoundingBox(double time, AtomsCore::Box3 &box) const
Loads bbox.
const std::string & agentVariation(double time, unsigned int agentId) const
Get the agent variation.
void loadPrevFrameHeader(int frame)
Loads a cache frame header and store in the previuos frame (usually used for the previous frame durin...
int currentFrame() const
Get the current frame.
int endFrame() const
Get the end frame.
const AtomsCore::Vector3 & agentVelocity(double time, unsigned int agentId) const
Gets the agent velocity.
const std::vector< int > & agentsCreated(double time) const
Gets the list of agent created.
void setAgentsToLoad(const std::vector< int > &agents)
Sets the agents to be loaded from the cache.
AgentTypePtr loadAgentType(const std::string &agentTypeName, bool asGlobal=true)
Load and get an agent type.
void blendPose(size_t numJoints, std::vector< const AtomsCore::Pose * > &posePorts, std::vector< double > &weightPorts, AtomsCore::Pose &outPose) const
Blends pose.
AtomsCache(const std::string &cachePath, const std::string &cacheName)
Constructor.
const std::vector< int > & agentsDeleted(double time) const
Gets the list of agent deleted.
AtomsCache(const std::string &cachePath, const std::string &cacheName, const std::vector< int > &agents)
Constructor.
FrameData & frameData()
Get the current frame data.
void loadAgentPose(double time, unsigned int agentId, AtomsCore::Pose &pose) const
Loads an agent pose.
int agentSourceGroupId(double time, unsigned int agentId) const
Get the agent source group id.
void loadFrame(int frame)
Loads a cache frame and stores the current frame data.
int agentColorVariation(double time, unsigned int agentId) const
Get the agent variation.
size_t numAgentsDeleted(double time) const
Gets the number of agent deleted.
void loadPrevFrame(int frame)
Loads a cache frame and store in the previous frame (usually used for the previous frame during the m...
Pose class.
Definition: Pose.h:32
AtomsMath::Box3 Box3
Bounding box class.
Definition: AtomsMath.h:74
AtomsMath::Vector3 Vector3
Vector3 class.
Definition: AtomsMath.h:57
Atoms namespace.
Definition: Agent.h:29
AtomsPtr< AgentType > AgentTypePtr
Agent type pointer.
Definition: AgentType.h:17