本文整理汇总了C++中CAABBox::setMinMax方法的典型用法代码示例。如果您正苦于以下问题:C++ CAABBox::setMinMax方法的具体用法?C++ CAABBox::setMinMax怎么用?C++ CAABBox::setMinMax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAABBox
的用法示例。
在下文中一共展示了CAABBox::setMinMax方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transformAABBox
//==========================================================================
CAABBox CAABBox::transformAABBox(const CMatrix &mat, const CAABBox &box)
{
// TODO : optimize this a bit if possible...
CAABBox result;
/* OMG. Old code was false!!
if we have ht= M * h
then CVector(-ht.x, ht.y, ht.z) != M * CVector(-h.x, h.y, h.z) !!!!
*/
// compute corners.
CVector p[8];
CVector min= box.getMin();
CVector max= box.getMax();
p[0].set(min.x, min.y, min.z);
p[1].set(max.x, min.y, min.z);
p[2].set(min.x, max.y, min.z);
p[3].set(max.x, max.y, min.z);
p[4].set(min.x, min.y, max.z);
p[5].set(max.x, min.y, max.z);
p[6].set(min.x, max.y, max.z);
p[7].set(max.x, max.y, max.z);
CVector tmp;
min = max = mat * p[0];
// transform corners.
for(uint i=1;i<8;i++)
{
tmp= mat * p[i];
min.minof(min, tmp);
max.maxof(max, tmp);
}
result.setMinMax(min, max);
return result;
}
示例2: computeAABBoxUnion
CAABBox CAABBox::computeAABBoxUnion(const CAABBox &b1, const CAABBox &b2)
{
CAABBox result;
CVector min, max;
CVector min1 = b1.getMin()
,max1 = b1.getMax()
,min2 = b2.getMin()
,max2 = b2.getMax();
max.maxof(max1, max2);
min.minof(min1, min2);
result.setMinMax(min, max);
return result;
}
示例3: CVector
CAABBox getZoneBBoxById(uint16 id)
{
CAABBox bbox;
uint x, y;
const float zdim = 160.0f;
x = id%256;
y = id/256;
bbox.setMinMax(CVector(zdim*x, -zdim*(y+1), -10000.0f),
CVector(zdim*(x+1), -zdim*y, +10000.0f));
return bbox;
}
示例4: mirrorPhysiqueSelection
//.........这里部分代码省略.........
// no vertices? abort
if(vertCount==0)
return true;
// **** Mark all Input vertices
for(i=0;i<vertIn.size();i++)
{
nlassert(vertIn[i]<vertCount);
tempVertex[vertIn[i]].Input= true;
}
// **** Build the output vertices
std::vector<uint> vertOut;
vertOut.reserve(tempVertex.size());
// Build the in bbox
CAABBox bbox;
bbox.setCenter(tempVertex[vertIn[0]].Pos);
for(i=0;i<vertIn.size();i++)
{
bbox.extend(tempVertex[vertIn[i]].Pos);
}
bbox.setHalfSize(bbox.getHalfSize()+CVector(threshold, threshold, threshold));
// mirror in X
CVector vMin= bbox.getMin();
CVector vMax= bbox.getMax();
vMin.x= -vMin.x;
vMax.x= -vMax.x;
std::swap(vMin.x, vMax.x);
bbox.setMinMax(vMin, vMax);
// get all out vertices in the mirrored bbox.
for(i=0;i<tempVertex.size();i++)
{
if(bbox.include(tempVertex[i].Pos))
{
vertOut.push_back(i);
}
}
// **** Build the skin information
// Get the skin modifier
Modifier* skin=getModifier (&node, PHYSIQUE_CLASS_ID);
// Found it ?
ok= false;
if (skin)
{
// Get a com_skin2 interface
IPhysiqueExport *physiqueInterface=(IPhysiqueExport *)skin->GetInterface (I_PHYINTERFACE);
// Found com_skin2 ?
if (physiqueInterface)
{
// Get local data
IPhyContextExport *localData= physiqueInterface->GetContextInterface(&node);
// Found ?
if (localData)
{
// Use rigid export