11 #include <Atoms/Globals.h>
12 #include <Atoms/AgentGroup.h>
36 AtomsClothCache(
const std::string& cachePath,
const std::string& cacheName,
const std::vector<int>& agents);
44 bool openCache(
const std::string& cachePath,
const std::string& cacheName);
50 bool openCache(
const std::string& cachePath,
const std::string& cacheName,
const std::vector<int>& agents);
122 unsigned int agentId,
123 const std::string& meshName,
124 std::vector<AtomsCore::Vector3>& points,
125 std::vector<AtomsCore::Vector3>& normals
135 unsigned int agentId,
136 const std::string& meshName
151 static void processPoints(std::vector<AtomsCore::Vector3>& outPoints, std::vector<
const std::vector<AtomsCore::Vector3>*> &inPoints,
const std::vector<double> &inputWeightVector);
153 static void processNormals(std::vector<AtomsCore::Vector3>& outNormals, std::vector<
const std::vector<AtomsCore::Vector3>*> &inNormals,
const std::vector<double> &inputWeightVector);
164 void setAgentsToLoad(
const std::vector<int>& agents);
166 const std::string& cacheName()
const;
168 const std::string& cachePath()
const;
172 int clampFrame(
int frame)
const;
175 void readData(AtomsPtr<AtomsCore::MapMetadata>& data,
int frame,
int& m_currentFrame);
177 void readDataKeys(AtomsPtr<AtomsCore::MapMetadata>& data,
int frame, std::vector<std::string>& keys,
int& m_currentFrame);
185 AtomsPtr<AtomsCore::MapMetadata> m_prevFrameData;
188 AtomsPtr<AtomsCore::MapMetadata> m_currentFrameData;
191 AtomsPtr<AtomsCore::MapMetadata> m_nextFrameData;
193 std::vector<std::string> m_agentIdsToLoad;
196 std::string m_cachePath;
199 std::string m_cacheName;
Definition: AtomsClothCache.h:17
AtomsClothCache(const std::string &cachePath, const std::string &cacheName, const std::vector< int > &agents)
Constructor.
AtomsPtr< AtomsCore::MapMetadata > & nextFrameData()
Get the next frame data.
int prevFrame() const
Get the previous frame.
void loadAgentClothMeshBoundingBox(double time, unsigned int agentId, const std::string &meshName, AtomsCore::Box3 &box) const
Loads an agent bbox.
bool openCache(const std::string &cachePath, const std::string &cacheName)
Opens a cache.
std::vector< int > agentIds(double time) const
Gets agent ids.
void loadFrame(int frame)
Loads a cache frame and stores the current frame data.
int endFrame() const
Get the end frame.
static void processPoints(std::vector< AtomsCore::Vector3 > &outPoints, std::vector< const std::vector< AtomsCore::Vector3 > * > &inPoints, const std::vector< double > &inputWeightVector)
Blends multiple mapmetadata.
void loadNextFrame(int frame)
Loads a cache frame and stores the next frame data (usually used for the next frame during the motion...
bool hasAgentClothMesh(double time, unsigned int agentId, const std::string &meshName) const
Check if a mesh for an egent exist inside the cache.
std::string getAgentClothMeshStackOrder(double time, unsigned int agentId, const std::string &meshName) const
Get cloth mesh stack order.
~AtomsClothCache()
Destructor.
int currentFrame() const
Get the current frame.
void loadBoundingBox(double time, AtomsCore::Box3 &box) const
Loads bbox.
AtomsClothCache(const std::string &cachePath, const std::string &cacheName)
Constructor.
int nextFrame() const
Get the next frame.
bool openCache(const std::string &cachePath, const std::string &cacheName, const std::vector< int > &agents)
Opens a cache.
void loadAgentClothMesh(double time, unsigned int agentId, const std::string &meshName, std::vector< AtomsCore::Vector3 > &points, std::vector< AtomsCore::Vector3 > &normals) const
Loads all data for an agent.
AtomsClothCache()
Constructor.
int startFrame() const
Get the start frame.
void clear()
Clear all the loaded frames.
AtomsPtr< AtomsCore::MapMetadata > & prevFrameData()
Get the previous frame data.
std::vector< std::string > agentClothMeshNames(double time, unsigned int agentId) const
Gets agent cloth mesh names.
void loadTime(double time)
Loads the pre/next and current frame given the input time.
void loadPrevFrame(int frame)
Loads a cache frame and store in the previous frame (usually used for the previous frame during the m...
size_t numAgents(double time) const
Gets the number of agents created.
void loadAgentClothBoundingBox(double time, unsigned int agentId, AtomsCore::Box3 &box) const
Loads an agent bbox.
AtomsPtr< AtomsCore::MapMetadata > & frameData()
Get the current frame data.
AtomsMath::Box3 Box3
Bounding box class.
Definition: AtomsMath.h:74
Atoms namespace.
Definition: Agent.h:29