本文整理汇总了C++中nlmisc::CAABBox::getHalfSize方法的典型用法代码示例。如果您正苦于以下问题:C++ CAABBox::getHalfSize方法的具体用法?C++ CAABBox::getHalfSize怎么用?C++ CAABBox::getHalfSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nlmisc::CAABBox
的用法示例。
在下文中一共展示了CAABBox::getHalfSize方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePrecomputedBBoxParams
void CParticleSystemPage::updatePrecomputedBBoxParams()
{
NLMISC::CAABBox b;
_Node->getPSPointer()->computeBBox(b);
_ui.xDoubleSpinBox->setValue(b.getHalfSize().x);
_ui.yDoubleSpinBox->setValue(b.getHalfSize().y);
_ui.zDoubleSpinBox->setValue(b.getHalfSize().z);
}
示例2: setYBbox
void CParticleSystemPage::setYBbox(double value)
{
NLMISC::CAABBox b;
_Node->getPSPointer()->computeBBox(b);
NLMISC::CVector h;
h.x = b.getHalfSize().x;
h.y = value;
h.z = b.getHalfSize().z;
b.setHalfSize(h);
_Node->getPSPointer()->setPrecomputedBBox(b);
}
示例3: evalIconInScenePos
// *********************************************************************************************************
void CDisplayerVisual::evalIconInScenePos(NLMISC::CVector &dest) const
{
//H_AUTO(R2_CDisplayerVisual_evalIconInScenePos)
NLMISC::CAABBox selectBox = getSelectBox();
float radius = std::max(selectBox.getHalfSize().x, selectBox.getHalfSize().y);
// use middle front of bbox for icon pos
NLMISC::CVector result = getWorldPos().asVector() - radius * MainCam.getMatrix().getJ() + selectBox.getHalfSize().z * CVector::K;
static volatile bool wantAssert = true;
if (!isValidDouble(result.x) || !isValidDouble(result.y) ||!isValidDouble(result.z))
{
nlassert(!wantAssert);
return;
}
dest = result;
}
示例4:
// ***************************************************************************
void CQuadGridClipClusterQTreeNode::insertModel(const NLMISC::CAABBox &worldBBox, uint distSetup, CTransformShape *model)
{
// if leaf node, insert the model in the list
if( LeafNode )
{
if(Empty)
{
Empty= false;
BBox= worldBBox;
}
else
{
// extend the bbox with 2 corners of the incoming bbox (sufficient for an AABBox).
BBox.extend( worldBBox.getCenter() + worldBBox.getHalfSize() );
BBox.extend( worldBBox.getCenter() - worldBBox.getHalfSize() );
}
// insert in list
ListNode.insertModel(distSetup, model);
}
// else, recurs insert in branch
else
{
// choose what son according to pivot.
CQuadGridClipClusterQTreeNode *selectSon;
if( worldBBox.getCenter().y<PivotBBox.getCenter().y )
{
if( worldBBox.getCenter().x<PivotBBox.getCenter().x )
selectSon= Sons[NL3D_QCC_LEFT_DOWN];
else
selectSon= Sons[NL3D_QCC_RIGHT_DOWN];
}
else
{
if( worldBBox.getCenter().x<PivotBBox.getCenter().x )
selectSon= Sons[NL3D_QCC_LEFT_UP];
else
selectSon= Sons[NL3D_QCC_RIGHT_UP];
}
// insert in this cluster
selectSon->insertModel(worldBBox, distSetup, model);
// extend my boox according to this son cluster.
if(Empty)
{
Empty= false;
BBox= selectSon->BBox;
}
else
{
// extend the bbox with 2 corners of the son bbox (sufficient for an AABBox).
BBox.extend( selectSon->BBox.getCenter() + selectSon->BBox.getHalfSize() );
BBox.extend( selectSon->BBox.getCenter() - selectSon->BBox.getHalfSize() );
}
}
// update bboxExt
BBoxExt= BBox;
}
示例5: decBbox
void CParticleSystemPage::decBbox()
{
NLMISC::CAABBox b;
_Node->getPSPointer()->computeBBox(b);
b.setHalfSize(0.9f * b.getHalfSize());
_Node->getPSPointer()->setPrecomputedBBox(b);
updatePrecomputedBBoxParams();
}
示例6: if
//.........这里部分代码省略.........
Class_ID clid = obj->ClassID();
// is the object a particle system ?
if (clid.PartA() == NEL_PARTICLE_SYSTEM_CLASS_ID)
{
// build the shape from the file name
std::string objName = CExportNel::getNelObjectName(*pNode);
if (!objName.empty())
{
NL3D::CShapeStream ss;
NLMISC::CIFile iF;
if (iF.open(objName.c_str()))
{
try
{
iF.serial(ss);
NL3D::CParticleSystemShape *pss = dynamic_cast<NL3D::CParticleSystemShape *>(ss.getShapePointer());
if (!pss)
{
nlwarning("ERROR: Node %s shape is not a FX", CExportNel::getName(*pNode).c_str());
}
else
{
NLMISC::CAABBox bbox;
pss->getAABBox(bbox);
// transform in world
Matrix3 xForm = pNode->GetNodeTM(tvTime);
NLMISC::CMatrix nelXForm;
CExportNel::convertMatrix(nelXForm, xForm);
bbox = NLMISC::CAABBox::transformAABBox(nelXForm, bbox);
// store vertices of the bbox in the list
FXVertices.reserve(8);
for(uint k = 0; k < 8; ++k)
{
FXVertices.push_back(CVector(((k & 1) ? 1 : -1) * bbox.getHalfSize().x + bbox.getCenter().x,
((k & 2) ? 1 : -1) * bbox.getHalfSize().y + bbox.getCenter().y,
((k & 4) ? 1 : -1) * bbox.getHalfSize().z + bbox.getCenter().z));
}
//
testVertices = &FXVertices;
buildMeshBBox = false;
}
delete ss.getShapePointer();
}
catch (NLMISC::Exception &e)
{
nlwarning(e.what());
}
}
if (buildMeshBBox)
{
nlwarning("ERROR: Can't get bbox of a particle system from its shape, using helper bbox instead");
}
}
}
}
CMesh::CMeshBuild *pMB = NULL;
CMeshBase::CMeshBaseBuild *pMBB = NULL;
if (buildMeshBBox)
{
pMB = createMeshBuild (*pNode, tvTime, pMBB);
convertToWorldCoordinate( pMB, pMBB );
testVertices = &pMB->Vertices;
}