本文整理汇总了C++中Bounds3f::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ Bounds3f::Add方法的具体用法?C++ Bounds3f::Add怎么用?C++ Bounds3f::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bounds3f
的用法示例。
在下文中一共展示了Bounds3f::Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoBuildWorldTransform_
//----------------------------------------------------------------------------------------------
void IDrawInterface::DoBuildWorldTransform_(const Matrix &WTM)
{
m_WorldMatrixTransform = GetLTM_() * WTM * GetSTM_();
m_Bounds.SetUnvalid(); // invalidate
std::vector<IRenderInterface*> &vecRenderEntities = const_cast<CActor*>(m_pNode->m_pKey)->m_VecRenderEntities;
for (std::vector<IRenderInterface*>::const_iterator iter = vecRenderEntities.begin(); iter != vecRenderEntities.end(); ++iter)
{
(*iter)->SetRWTM(m_WorldMatrixTransform);
Bounds3f BBox = (*iter)->GetRBounds_();
if (BBox.IsValid())
{
const unsigned int BBOX_POINTS = 8;
Vector BoxPoints[BBOX_POINTS] =
{
/*Vector(BBox.bound_min.x, BBox.bound_min.y, BBox.bound_min.z),
Vector(BBox.bound_min.x, BBox.bound_min.y, BBox.bound_max.z),
Vector(BBox.bound_max.x, BBox.bound_min.y, BBox.bound_max.z),
Vector(BBox.bound_max.x, BBox.bound_min.y, BBox.bound_min.z),
Vector(BBox.bound_min.x, BBox.bound_max.y, BBox.bound_min.z),
Vector(BBox.bound_min.x, BBox.bound_max.y, BBox.bound_max.z),
Vector(BBox.bound_max.x, BBox.bound_max.y, BBox.bound_max.z),
Vector(BBox.bound_max.x, BBox.bound_max.y, BBox.bound_min.z),*/
// TODO make homogeneous with exporter tool
Vector(BBox.bound_min.z, BBox.bound_min.y, BBox.bound_min.x),
Vector(BBox.bound_max.z, BBox.bound_min.y, BBox.bound_min.x),
Vector(BBox.bound_max.z, BBox.bound_min.y, BBox.bound_max.x),
Vector(BBox.bound_min.z, BBox.bound_min.y, BBox.bound_max.x),
Vector(BBox.bound_min.z, BBox.bound_max.y, BBox.bound_min.x),
Vector(BBox.bound_max.z, BBox.bound_max.y, BBox.bound_min.x),
Vector(BBox.bound_max.z, BBox.bound_max.y, BBox.bound_max.x),
Vector(BBox.bound_min.z, BBox.bound_max.y, BBox.bound_max.x),
};
Matrix MT = m_WorldMatrixTransform;
MT.t = Vector(0.f, 0.f, 0.f);
Bounds3f tmpBound;
for (int Index = 0; Index < BBOX_POINTS; ++Index)
{
Vector point = transform_coord(BoxPoints[Index], MT);
if (Index == 0)
{
tmpBound.SetBounds(point, point);
continue;
}
tmpBound.Add(point);
}
const Vector bound_min = m_WorldMatrixTransform.t + tmpBound.bound_min;
const Vector bound_max = m_WorldMatrixTransform.t + tmpBound.bound_max;
(*iter)->SetWBounds(Bounds3f(bound_min, bound_max));
if (iter == vecRenderEntities.begin())
{
m_Bounds.SetBounds(bound_min, bound_max);
continue;
}
else
{
m_Bounds.Add(bound_min);
m_Bounds.Add(bound_max);
}
}
}
// invalidate composite bounds
m_CompositeBounds = m_Bounds;
}