当前位置: 首页>>代码示例>>C++>>正文


C++ Model::GetTree方法代码示例

本文整理汇总了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;
}
开发者ID:junrw,项目名称:ember-gsoc2012,代码行数:59,代码来源:OPC_PlanesCollider.cpp

示例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;
}
开发者ID:MontyThibault,项目名称:cartwheel-3d-Research-Modifications,代码行数:57,代码来源:OPC_OBBCollider.cpp


注:本文中的Model::GetTree方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。