Atoms Crowd  7.0.0
Atoms::AtomsClothCache Class Reference

Public Member Functions

 AtomsClothCache ()
 Constructor.
 
 AtomsClothCache (const std::string &cachePath, const std::string &cacheName)
 Constructor.
 
 AtomsClothCache (const std::string &cachePath, const std::string &cacheName, const std::vector< int > &agents)
 Constructor.
 
 ~AtomsClothCache ()
 Destructor.
 
bool openCache (const std::string &cachePath, const std::string &cacheName)
 Opens a cache. More...
 
bool openCache (const std::string &cachePath, const std::string &cacheName, const std::vector< int > &agents)
 Opens a cache. More...
 
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 motion blur computation)
 
void loadFrame (int frame)
 Loads a cache frame and stores the current frame data. More...
 
void loadNextFrame (int frame)
 Loads a cache frame and stores the next frame data (usually used for the next frame during the motion blur computation)
 
int startFrame () const
 Get the start frame.
 
int endFrame () const
 Get the end frame.
 
int currentFrame () const
 Get the current frame.
 
int prevFrame () const
 Get the previous frame.
 
int nextFrame () const
 Get the next frame.
 
AtomsPtr< AtomsCore::MapMetadata > & prevFrameData ()
 Get the previous frame data.
 
AtomsPtr< AtomsCore::MapMetadata > & frameData ()
 Get the current frame data.
 
AtomsPtr< AtomsCore::MapMetadata > & nextFrameData ()
 Get the next frame data.
 
void loadBoundingBox (double time, AtomsCore::Box3 &box) const
 Loads bbox. More...
 
void loadAgentClothBoundingBox (double time, unsigned int agentId, AtomsCore::Box3 &box) const
 Loads an agent bbox. More...
 
void loadAgentClothMeshBoundingBox (double time, unsigned int agentId, const std::string &meshName, AtomsCore::Box3 &box) const
 Loads an agent bbox. More...
 
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. More...
 
std::string getAgentClothMeshStackOrder (double time, unsigned int agentId, const std::string &meshName) const
 Get cloth mesh stack order. More...
 
bool hasAgentClothMesh (double time, unsigned int agentId, const std::string &meshName) const
 Check if a mesh for an egent exist inside the cache. More...
 
void clear ()
 Clear all the loaded frames.
 
std::vector< int > agentIds (double time) const
 Gets agent ids.
 
std::vector< std::string > agentClothMeshNames (double time, unsigned int agentId) const
 Gets agent cloth mesh names.
 
size_t numAgents (double time) const
 Gets the number of agents created.
 
void setAgentsToLoad (const std::vector< int > &agents)
 
const std::string & cacheName () const
 
const std::string & cachePath () const
 

Static Public Member Functions

static void processPoints (std::vector< AtomsCore::Vector3 > &outPoints, std::vector< const std::vector< AtomsCore::Vector3 > * > &inPoints, const std::vector< double > &inputWeightVector)
 Blends multiple mapmetadata.
 
static void processNormals (std::vector< AtomsCore::Vector3 > &outNormals, std::vector< const std::vector< AtomsCore::Vector3 > * > &inNormals, const std::vector< double > &inputWeightVector)
 

Member Function Documentation

◆ getAgentClothMeshStackOrder()

std::string Atoms::AtomsClothCache::getAgentClothMeshStackOrder ( double  time,
unsigned int  agentId,
const std::string &  meshName 
) const

Get cloth mesh stack order.

It returns "first" or "last" or an empty string if there is no data

Parameters
timeCache frame, this is must always be a value between the prev, current and next frame. You should load the correct frames before calling this function
agentIdCache agent id
meshNameMesh name

◆ hasAgentClothMesh()

bool Atoms::AtomsClothCache::hasAgentClothMesh ( double  time,
unsigned int  agentId,
const std::string &  meshName 
) const

Check if a mesh for an egent exist inside the cache.

Parameters
timeCache frame, this is must always be a value between the prev, current and next frame. You should load the correct frames before calling this function
agentIdCache agent id
meshNameMesh name

◆ loadAgentClothBoundingBox()

void Atoms::AtomsClothCache::loadAgentClothBoundingBox ( double  time,
unsigned int  agentId,
AtomsCore::Box3 box 
) const

Loads an agent bbox.

Parameters
timeCache frame, this is must always be a value between the prev, current and next frame. You should load the correct frames before calling this function
agentIdCache agent id
boxBBox loaded

◆ loadAgentClothMesh()

void Atoms::AtomsClothCache::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.

Parameters
timeCache frame, this is must always be a value between the prev, current and next frame. You should load the correct frames before calling this function
agentIdCache agent id
meshNameMesh name
pointsOut mesh points
normalsOut mesh normals

◆ loadAgentClothMeshBoundingBox()

void Atoms::AtomsClothCache::loadAgentClothMeshBoundingBox ( double  time,
unsigned int  agentId,
const std::string &  meshName,
AtomsCore::Box3 box 
) const

Loads an agent bbox.

Parameters
timeCache frame, this is must always be a value between the prev, current and next frame. You should load the correct frames before calling this function
agentIdCache agent id
meshNameMesh name
boxBBox loaded

◆ loadBoundingBox()

void Atoms::AtomsClothCache::loadBoundingBox ( double  time,
AtomsCore::Box3 box 
) const

Loads bbox.

Parameters
timeCache frame, this is must always be a value between the prev, current and next frame. You should load the correct frames before calling this function
boxBBox loaded

◆ loadFrame()

void Atoms::AtomsClothCache::loadFrame ( int  frame)

Loads a cache frame and stores the current frame data.

If a frame was already loaded then the old frame data is moved to the previous frame slot

◆ openCache() [1/2]

bool Atoms::AtomsClothCache::openCache ( const std::string &  cachePath,
const std::string &  cacheName 
)

Opens a cache.

Only the header is loaded

◆ openCache() [2/2]

bool Atoms::AtomsClothCache::openCache ( const std::string &  cachePath,
const std::string &  cacheName,
const std::vector< int > &  agents 
)

Opens a cache.

Only the header is loaded

Parameters
agentsAgents ids, it loads only those agents from the cache

The documentation for this class was generated from the following file: