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


C++ Control::GetZController方法代码示例

本文整理汇总了C++中Control::GetZController方法的典型用法代码示例。如果您正苦于以下问题:C++ Control::GetZController方法的具体用法?C++ Control::GetZController怎么用?C++ Control::GetZController使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Control的用法示例。


在下文中一共展示了Control::GetZController方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: HasKeyControlInterface

/**
*  @brief
*    Returns whether or not the given controller has any key control interface (x, y, z)
*/
bool PLTools::HasKeyControlInterface(Control &cController)
{
	// X
	Control *pXController = cController.GetXController();
	if (pXController) {
		IKeyControl *pKeyControl = GetKeyControlInterface(pXController);
		if (pKeyControl && pKeyControl->GetNumKeys())
			return true; // There's at least one key control interface
	}

	// Y
	Control *pYController = cController.GetYController();
	if (pYController) {
		IKeyControl *pKeyControl = GetKeyControlInterface(pYController);
		if (pKeyControl && pKeyControl->GetNumKeys())
			return true; // There's at least one key control interface
	}

	// Z
	Control *pZController = cController.GetZController();
	if (pZController) {
		IKeyControl *pKeyControl = GetKeyControlInterface(pZController);
		if (pKeyControl && pKeyControl->GetNumKeys())
			return true; // There's at least one key control interface
	}

	// Funny... but 'scale controller' (unlike position and rotation) seam to have their own way...
	IKeyControl *pKeyControl = GetKeyControlInterface(&cController);
	if (pKeyControl && pKeyControl->GetNumKeys())
		return true; // There's at least one key control interface

	// There are no key control interfaces
	return false;
}
开发者ID:ByeDream,项目名称:pixellight,代码行数:38,代码来源:PLTools.cpp

示例2: if


//.........这里部分代码省略.........
			tmControl->SetPositionController(posControl);

			unsigned int* timeData = (unsigned int*)(m_m2FileData + boneDef.translation.ofsTimes);
			Point3* keyData = (Point3*)(m_m2FileData + boneDef.translation.ofsKeys);

			// 设置动画时间范围
			bool animRangeChanged = false;
			Interval animRange = m_maxInterface->GetAnimRange();
			for (unsigned int j = 0; j < boneDef.translation.nKeys; ++j)
			{
				if (timeData[j] < animRange.Start())
				{
					animRange.SetStart(timeData[j]);
					animRangeChanged = true;
				}
				else if (timeData[j] > animRange.End())
				{
					animRange.SetEnd(timeData[j]);
					animRangeChanged = true;
				}
			}
			if (animRangeChanged)
				m_maxInterface->SetAnimRange(animRange);

			// 设置动画关键桢数据
			Control* xControl = posControl->GetXController();
			IKeyControl* xKeyControl = GetKeyControlInterface(xControl);
			xKeyControl->SetNumKeys(boneDef.translation.nKeys);

			Control* yControl = posControl->GetYController();
			IKeyControl* yKeyControl = GetKeyControlInterface(yControl);
			yKeyControl->SetNumKeys(boneDef.translation.nKeys);

			Control* zControl = posControl->GetZController();
			IKeyControl* zKeyControl = GetKeyControlInterface(zControl);
			zKeyControl->SetNumKeys(boneDef.translation.nKeys);

			for (unsigned int j = 0; j < boneDef.translation.nKeys; ++j)
			{
				// X
				AnyKey bufX;
				ILinFloatKey* keyX = reinterpret_cast<ILinFloatKey*>((IKey*)bufX);
				keyX->time = timeData[j];
				keyX->val = keyData[j].x;
				xKeyControl->AppendKey(keyX);

				// Y
				AnyKey bufY;
				ILinFloatKey* keyY = reinterpret_cast<ILinFloatKey*>((IKey*)bufY);
				keyY->time = timeData[j];
				keyY->val = keyData[j].y;
				yKeyControl->AppendKey(keyY);

				// Z
				AnyKey bufZ;
				ILinFloatKey* keyZ = reinterpret_cast<ILinFloatKey*>((IKey*)bufZ);
				keyZ->time = timeData[j];
				keyZ->val = keyData[j].z;
				zKeyControl->AppendKey(keyZ);
			}
		}
/*
		// Rotation
		if (boneDef.rotation.nKeys)
		{
			Control* rotControl = createRotationController();
开发者ID:helloqinglan,项目名称:qinglan,代码行数:67,代码来源:M2ImportBone.cpp


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