本文整理汇总了C++中History::stitchCommonHistory方法的典型用法代码示例。如果您正苦于以下问题:C++ History::stitchCommonHistory方法的具体用法?C++ History::stitchCommonHistory怎么用?C++ History::stitchCommonHistory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类History
的用法示例。
在下文中一共展示了History::stitchCommonHistory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkVFS
bool CTCDNarrowPhase::checkVFS(const History &h, VertexFaceStencil vfs, double eta)
{
vector<int> verts;
verts.push_back(vfs.p);
verts.push_back(vfs.q0);
verts.push_back(vfs.q1);
verts.push_back(vfs.q2);
vector<StitchedEntry> sh;
h.stitchCommonHistory(verts, sh);
for(vector<StitchedEntry>::iterator it = sh.begin(); it != sh.end(); ++it)
{
vector<StitchedEntry>::iterator next = it+1;
if(next == sh.end())
break;
// double tinterval = next->time - it->time;
double t;
if(CTCD::vertexFaceCTCD(it->pos[0], it->pos[1], it->pos[2], it->pos[3],
next->pos[0], next->pos[1], next->pos[2], next->pos[3],
eta, t))
{
return true;
}
// Vertex-face edges
for(int edge=0; edge<3; edge++)
{
if(CTCD::vertexEdgeCTCD(it->pos[0], it->pos[1+(edge%3)], it->pos[1+ ((edge+1)%3)],
next->pos[0], next->pos[1+(edge%3)], next->pos[1+ ((edge+1)%3)],
eta, t))
{
return true;
}
}
// Vertex-face vertices
for(int vert=0; vert<3; vert++)
{
if(CTCD::vertexVertexCTCD(it->pos[0], it->pos[1+vert],
next->pos[0], next->pos[1+vert],
eta, t))
{
return true;
}
}
}
return false;
}
示例2: checkEES
bool CTCDNarrowPhase::checkEES(const History &h, EdgeEdgeStencil & ees, double eta)
{
vector<int> verts;
verts.push_back(ees.p0);
verts.push_back(ees.p1);
verts.push_back(ees.q0);
verts.push_back(ees.q1);
vector<StitchedEntry> sh;
h.stitchCommonHistory(verts, sh);
for(vector<StitchedEntry>::iterator it = sh.begin(); it != sh.end(); ++it)
{
vector<StitchedEntry>::iterator next = it+1;
if(next == sh.end())
break;
double t;
if(CTCD::edgeEdgeCTCD(it->pos[0], it->pos[1], it->pos[2], it->pos[3],
next->pos[0], next->pos[1], next->pos[2], next->pos[3],
eta, t))
{
if(record_min_t)
{
ees.min_t = std::min(ees.min_t,t);
}else
{
return true;
}
}
// Edge-edge vertices
if(CTCD::vertexEdgeCTCD(it->pos[0], it->pos[2], it->pos[3], next->pos[0], next->pos[2], next->pos[3], eta, t))
{
if(record_min_t)
{
ees.min_t = std::min(ees.min_t,t);
}else
{
return true;
}
}
if(CTCD::vertexEdgeCTCD(it->pos[1], it->pos[2], it->pos[3], next->pos[1], next->pos[2], next->pos[3], eta, t))
{
if(record_min_t)
{
ees.min_t = std::min(ees.min_t,t);
}else
{
return true;
}
}
if(CTCD::vertexEdgeCTCD(it->pos[2], it->pos[0], it->pos[1], next->pos[2], next->pos[0], next->pos[1], eta, t))
{
if(record_min_t)
{
ees.min_t = std::min(ees.min_t,t);
}else
{
return true;
}
}
if(CTCD::vertexEdgeCTCD(it->pos[3], it->pos[0], it->pos[1], next->pos[3], next->pos[0], next->pos[1], eta, t))
{
if(record_min_t)
{
ees.min_t = std::min(ees.min_t,t);
}else
{
return true;
}
}
// edge vertex-edge vertex
if(CTCD::vertexVertexCTCD(it->pos[0], it->pos[2], next->pos[0], next->pos[2], eta, t))
{
if(record_min_t)
{
ees.min_t = std::min(ees.min_t,t);
}else
{
return true;
}
}
if(CTCD::vertexVertexCTCD(it->pos[0], it->pos[3], next->pos[0], next->pos[3], eta, t))
{
if(record_min_t)
{
ees.min_t = std::min(ees.min_t,t);
}else
{
return true;
}
}
if(CTCD::vertexVertexCTCD(it->pos[1], it->pos[2], next->pos[1], next->pos[2], eta, t))
{
if(record_min_t)
{
ees.min_t = std::min(ees.min_t,t);
}else
{
//.........这里部分代码省略.........