本文整理汇总了C++中PODVector::Back方法的典型用法代码示例。如果您正苦于以下问题:C++ PODVector::Back方法的具体用法?C++ PODVector::Back怎么用?C++ PODVector::Back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PODVector
的用法示例。
在下文中一共展示了PODVector::Back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddOrMerge
void UIBatch::AddOrMerge(const UIBatch& batch, PODVector<UIBatch>& batches)
{
if (batch.vertexEnd_ == batch.vertexStart_)
return;
if (!batches.Empty() && batches.Back().Merge(batch))
return;
batches.Push(batch);
}
示例2: BuildTreeToEffector
// ----------------------------------------------------------------------------
bool IKSolver::BuildTreeToEffector(IKEffector* effector)
{
/*
* NOTE: This function makes the assumption that the node the effector is
* attached to is -- without a doubt -- in our subtree (by using
* ComponentIsInOurSubtree() first). If this is not the case, the program
* will abort.
*/
/*
* we need to build tree up to the node where this effector was added. Do
* this by following the chain of parent nodes until we hit a node that
* exists in the solver's subtree. Then iterate backwards again and add each
* missing node to the solver's tree.
*/
const Node* iterNode = effector->GetNode();
ik_node_t* ikNode;
PODVector<const Node*> missingNodes;
while ((ikNode = ik_node_find_child(solver_->tree, iterNode->GetID())) == nullptr)
{
missingNodes.Push(iterNode);
iterNode = iterNode->GetParent();
// Assert the assumptions made (described in the beginning of this function)
assert(iterNode != nullptr);
assert (iterNode->HasComponent<IKSolver>() == false || iterNode == node_);
}
while (missingNodes.Size() > 0)
{
iterNode = missingNodes.Back();
missingNodes.Pop();
ik_node_t* ikChildNode = CreateIKNodeFromUrhoNode(iterNode);
ik_node_add_child(ikNode, ikChildNode);
ikNode = ikChildNode;
}
return true;
}
示例3: BuildTreeToEffector
// ----------------------------------------------------------------------------
void IKSolver::BuildTreeToEffector(const Node* node)
{
// Check if the component that was added is an IK effector. If not, then it
// does not concern us.
IKEffector* effector = static_cast<IKEffector*>(node->GetComponent<IKEffector>());
if (effector == NULL || effector->GetType() != IKEffector::GetTypeStatic())
return;
// May need to build tree up to the node where this effector was added. Do
// this by following the chain of parent nodes until we hit a node that
// exists in the solver's tree. Then iterate backwards again and add each
// missing node to the solver's tree.
PODVector<const Node*> missingNodes;
const Node* iterNode = node;
ik_node_t* ikNode = ik_node_find_child(solver_->tree, node->GetID());
while (ikNode == NULL)
{
missingNodes.Push(iterNode);
iterNode = iterNode->GetParent();
ikNode = ik_node_find_child(solver_->tree, iterNode->GetID());
}
while (missingNodes.Size() > 0)
{
iterNode = missingNodes.Back();
missingNodes.Pop();
ik_node_t* ikChildNode = CreateIKNode(iterNode);
ik_node_add_child(ikNode, ikChildNode);
ikNode = ikChildNode;
}
// The tip of the tree is the effector. The solver library has ownership of
// the effector object, but our IKEffector object also needs to know about
// it.
ik_effector_t* ikEffector = ik_effector_create();
ik_node_attach_effector(ikNode, ikEffector); // ownership of effector
effector->SetIKEffector(ikEffector); // "weak" reference to effector
effector->SetIKSolver(this);
effectorList_.Push(effector);
MarkSolverTreeDirty();
}