本文整理汇总了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;
}
示例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();