本文整理汇总了C++中Model::GetTree方法的典型用法代码示例。如果您正苦于以下问题:C++ Model::GetTree方法的具体用法?C++ Model::GetTree怎么用?C++ Model::GetTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model
的用法示例。
在下文中一共展示了Model::GetTree方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Collide
bool PlanesCollider::Collide(PlanesCache& cache, const IceMaths::Plane* planes, udword nb_planes, const Model& model, const IceMaths::Matrix4x4* worldm)
{
// Checkings
if (!Setup(&model))
return false;
// Init collision query
if (InitQuery(cache, planes, nb_planes, worldm))
return true;
udword PlaneMask = (1 << nb_planes) - 1;
if (!model.HasLeafNodes()) {
if (model.IsQuantized()) {
const AABBQuantizedNoLeafTree* Tree = (const AABBQuantizedNoLeafTree*)model.GetTree();
// Setup dequantization coeffs
mCenterCoeff = Tree->mCenterCoeff;
mExtentsCoeff = Tree->mExtentsCoeff;
// Perform collision query
if (SkipPrimitiveTests())
_CollideNoPrimitiveTest(Tree->GetNodes(), PlaneMask);
else
_Collide(Tree->GetNodes(), PlaneMask);
} else {
const AABBNoLeafTree* Tree = (const AABBNoLeafTree*)model.GetTree();
// Perform collision query
if (SkipPrimitiveTests())
_CollideNoPrimitiveTest(Tree->GetNodes(), PlaneMask);
else
_Collide(Tree->GetNodes(), PlaneMask);
}
} else {
if (model.IsQuantized()) {
const AABBQuantizedTree* Tree = (const AABBQuantizedTree*)model.GetTree();
// Setup dequantization coeffs
mCenterCoeff = Tree->mCenterCoeff;
mExtentsCoeff = Tree->mExtentsCoeff;
// Perform collision query
if (SkipPrimitiveTests())
_CollideNoPrimitiveTest(Tree->GetNodes(), PlaneMask);
else
_Collide(Tree->GetNodes(), PlaneMask);
} else {
const AABBCollisionTree* Tree = (const AABBCollisionTree*)model.GetTree();
// Perform collision query
if (SkipPrimitiveTests())
_CollideNoPrimitiveTest(Tree->GetNodes(), PlaneMask);
else
_Collide(Tree->GetNodes(), PlaneMask);
}
}
return true;
}
示例2: Collide
bool OBBCollider::Collide(OBBCache& cache, const OBB& box, const Model& model, const Matrix4x4* worldb, const Matrix4x4* worldm)
{
// Checkings
if(!Setup(&model)) return false;
// Init collision query
if(InitQuery(cache, box, worldb, worldm)) return true;
if(!model.HasLeafNodes())
{
if(model.IsQuantized())
{
const AABBQuantizedNoLeafTree* Tree = (const AABBQuantizedNoLeafTree*)model.GetTree();
// Setup dequantization coeffs
mCenterCoeff = Tree->mCenterCoeff;
mExtentsCoeff = Tree->mExtentsCoeff;
// Perform collision query
if(SkipPrimitiveTests()) _CollideNoPrimitiveTest(Tree->GetNodes());
else _Collide(Tree->GetNodes());
}
else
{
const AABBNoLeafTree* Tree = (const AABBNoLeafTree*)model.GetTree();
// Perform collision query
if(SkipPrimitiveTests()) _CollideNoPrimitiveTest(Tree->GetNodes());
else _Collide(Tree->GetNodes());
}
}
else
{
if(model.IsQuantized())
{
const AABBQuantizedTree* Tree = (const AABBQuantizedTree*)model.GetTree();
// Setup dequantization coeffs
mCenterCoeff = Tree->mCenterCoeff;
mExtentsCoeff = Tree->mExtentsCoeff;
// Perform collision query
if(SkipPrimitiveTests()) _CollideNoPrimitiveTest(Tree->GetNodes());
else _Collide(Tree->GetNodes());
}
else
{
const AABBCollisionTree* Tree = (const AABBCollisionTree*)model.GetTree();
// Perform collision query
if(SkipPrimitiveTests()) _CollideNoPrimitiveTest(Tree->GetNodes());
else _Collide(Tree->GetNodes());
}
}
return true;
}