本文整理汇总了C++中AABB3::Encapsulate方法的典型用法代码示例。如果您正苦于以下问题:C++ AABB3::Encapsulate方法的具体用法?C++ AABB3::Encapsulate怎么用?C++ AABB3::Encapsulate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AABB3
的用法示例。
在下文中一共展示了AABB3::Encapsulate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: v
void AABB3::TransformBy(Matrix& matrix)
{
AABB3 bb;
Vector3f v(minVec);
Vector3f w(maxVec);
bb.Encapsulate(matrix.Transform(Vector3f(v.x(),v.y(),v.z())));
bb.Encapsulate(matrix.Transform(Vector3f(w.x(),v.y(),v.z())));
bb.Encapsulate(matrix.Transform(Vector3f(v.x(),w.y(),v.z())));
bb.Encapsulate(matrix.Transform(Vector3f(w.x(),w.y(),v.z())));
bb.Encapsulate(matrix.Transform(Vector3f(v.x(),v.y(),w.z())));
bb.Encapsulate(matrix.Transform(Vector3f(w.x(),v.y(),w.z())));
bb.Encapsulate(matrix.Transform(Vector3f(v.x(),w.y(),w.z())));
bb.Encapsulate(matrix.Transform(Vector3f(w.x(),w.y(),w.z())));
minVec.Set(bb.minVec);
maxVec.Set(bb.maxVec);
}
示例2: GetAgentBoundingBox
AABB3 SoccerBase::GetAgentBoundingBox(const Leaf& base)
{
AABB3 boundingBox;
boost::shared_ptr<Space> parent = base.FindParentSupportingClass<Space>().lock();
if (!parent)
{
base.GetLog()->Error()
<< "(GetAgentBoundingBox) ERROR: can't get parent node.\n";
return boundingBox;
}
/* We can't simply use the GetWorldBoundingBox of the space node, becuase
* (at least currently) it'll return a wrong answer. Currently, the space
* object is always at (0,0,0) which is encapsulated in the result of it's
* GetWorldBoundingBox method call.
*/
Leaf::TLeafList baseNodes;
parent->ListChildrenSupportingClass<BaseNode>(baseNodes);
if (baseNodes.empty())
{
base.GetLog()->Error()
<< "(GetAgentBoundingBox) ERROR: space object doesn't have any"
<< " children of type BaseNode.\n";
}
for (Leaf::TLeafList::iterator i = baseNodes.begin(); i!= baseNodes.end(); ++i)
{
boost::shared_ptr<BaseNode> node = shared_static_cast<BaseNode>(*i);
boundingBox.Encapsulate(node->GetWorldBoundingBox());
}
return boundingBox;
}