本文整理汇总了C++中KString::Compare方法的典型用法代码示例。如果您正苦于以下问题:C++ KString::Compare方法的具体用法?C++ KString::Compare怎么用?C++ KString::Compare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KString
的用法示例。
在下文中一共展示了KString::Compare方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCurrentAnimationIndex
int Scene::getCurrentAnimationIndex()
{
int index = 0;
for(int i = 0; i < animationNames.GetCount(); i++) {
KString* currentName = animationNames[i];
KString activeName = KFbxGet<KString>(fbxScene->ActiveAnimStackName);
if(currentName->Compare(activeName) == 0) {
index = i;
}
}
return index;
}
示例2: getCurrentCamera
// -- Cameras ----------------------------------------------------------------------------
KFbxCamera* Scene::getCurrentCamera(KTime time)
{
KFbxGlobalSettings& lGlobalSettings = fbxScene->GetGlobalSettings();
KFbxGlobalCameraSettings& lGlobalCameraSettings = fbxScene->GlobalCameraSettings();
KString lCurrentCameraName = lGlobalSettings.GetDefaultCamera();
// check if we need to create the Producer cameras!
if (lGlobalCameraSettings.GetCameraProducerPerspective() == NULL &&
lGlobalCameraSettings.GetCameraProducerBottom() == NULL &&
lGlobalCameraSettings.GetCameraProducerTop() == NULL &&
lGlobalCameraSettings.GetCameraProducerFront() == NULL &&
lGlobalCameraSettings.GetCameraProducerBack() == NULL &&
lGlobalCameraSettings.GetCameraProducerRight() == NULL &&
lGlobalCameraSettings.GetCameraProducerLeft() == NULL)
{
lGlobalCameraSettings.CreateProducerCameras();
}
if (lCurrentCameraName.Compare(PRODUCER_PERSPECTIVE) == 0) {
return lGlobalCameraSettings.GetCameraProducerPerspective();
} else if (lCurrentCameraName.Compare(PRODUCER_BOTTOM) == 0) {
return lGlobalCameraSettings.GetCameraProducerBottom();
} else if (lCurrentCameraName.Compare(PRODUCER_TOP) == 0) {
return lGlobalCameraSettings.GetCameraProducerTop();
} else if (lCurrentCameraName.Compare(PRODUCER_FRONT) == 0) {
return lGlobalCameraSettings.GetCameraProducerFront();
} else if (lCurrentCameraName.Compare(PRODUCER_BACK) == 0) {
return lGlobalCameraSettings.GetCameraProducerBack();
} else if (lCurrentCameraName.Compare(PRODUCER_RIGHT) == 0) {
return lGlobalCameraSettings.GetCameraProducerRight();
} else if (lCurrentCameraName.Compare(PRODUCER_LEFT) == 0) {
return lGlobalCameraSettings.GetCameraProducerLeft();
} else if (lCurrentCameraName.Compare(CAMERA_SWITCHER) == 0) {
KFbxCameraSwitcher* lCameraSwitcher = fbxScene->GlobalCameraSettings().GetCameraSwitcher();
KFbxAnimCurve* lCurve = NULL;
if (lCameraSwitcher) {
lCurve = lCameraSwitcher->CameraIndex.GetCurve<KFbxAnimCurve>(currentAnimationLayer);
KFCurve* lFCurve = (lCurve)?lCurve->GetKFCurve():NULL;
int lCameraIndex = 0;
if (lFCurve)
// Get the index of the camera in the camera array.
lCameraIndex = (int) lFCurve->Evaluate(time) - 1;
if (lCameraIndex >= 0 && lCameraIndex < cameras.GetCount()) {
KFbxNode* lNode = cameras[lCameraIndex];
// Get the animated parameters of the camera.
getCameraAnimatedParameters(lNode, time);
return (KFbxCamera*) lNode->GetNodeAttribute();
}
}
} else {
int i;
KFbxNode* lNode = NULL;
// Find the camera in the camera array.
for (i = 0; i < cameras.GetCount(); i++) {
if (lCurrentCameraName.Compare(cameras[i]->GetName()) == 0) {
lNode = cameras[i];
break;
}
}
if (lNode) {
// Get the animated parameters of the camera.
getCameraAnimatedParameters(lNode, time);
return (KFbxCamera*) lNode->GetNodeAttribute();
}
}
return lGlobalCameraSettings.GetCameraProducerPerspective();
}
示例3: GetCurrentCamera
KFbxCamera* GetCurrentCamera(KFbxScene* pScene,
KTime& pTime,
KArrayTemplate<KFbxNode*>& pCameraArray)
{
KFbxGlobalSettings& lGlobalSettings = pScene->GetGlobalSettings();
KFbxGlobalCameraSettings& lGlobalCameraSettings = pScene->GlobalCameraSettings();
KString lCurrentCameraName = lGlobalSettings.GetDefaultCamera();
if (lGlobalCameraSettings.GetCameraProducerPerspective() == NULL &&
lGlobalCameraSettings.GetCameraProducerBottom() == NULL &&
lGlobalCameraSettings.GetCameraProducerTop() == NULL &&
lGlobalCameraSettings.GetCameraProducerFront() == NULL &&
lGlobalCameraSettings.GetCameraProducerBack() == NULL &&
lGlobalCameraSettings.GetCameraProducerRight() == NULL &&
lGlobalCameraSettings.GetCameraProducerLeft() == NULL)
{
lGlobalCameraSettings.CreateProducerCameras();
}
if (lCurrentCameraName.Compare(PRODUCER_PERSPECTIVE) == 0)
{
return lGlobalCameraSettings.GetCameraProducerPerspective();
}
else if (lCurrentCameraName.Compare(PRODUCER_BOTTOM) == 0)
{
return lGlobalCameraSettings.GetCameraProducerBottom();
}
else if (lCurrentCameraName.Compare(PRODUCER_TOP) == 0)
{
return lGlobalCameraSettings.GetCameraProducerTop();
}
else if (lCurrentCameraName.Compare(PRODUCER_FRONT) == 0)
{
return lGlobalCameraSettings.GetCameraProducerFront();
}
else if (lCurrentCameraName.Compare(PRODUCER_BACK) == 0)
{
return lGlobalCameraSettings.GetCameraProducerBack();
}
else if (lCurrentCameraName.Compare(PRODUCER_RIGHT) == 0)
{
return lGlobalCameraSettings.GetCameraProducerRight();
}
else if (lCurrentCameraName.Compare(PRODUCER_LEFT) == 0)
{
return lGlobalCameraSettings.GetCameraProducerLeft();
}
else if (lCurrentCameraName.Compare(CAMERA_SWITCHER) == 0)
{
KFbxCameraSwitcher* lCameraSwitcher = pScene->GlobalCameraSettings().GetCameraSwitcher();
KFbxAnimCurve* lCurve = NULL;
if (lCameraSwitcher)
{
lCurve = lCameraSwitcher->CameraIndex.GetCurve<KFbxAnimCurve>(gCurrentAnimationLayer);
KFCurve* lFCurve = (lCurve)?lCurve->GetKFCurve():NULL;
int lCameraIndex = 0;
if (lFCurve)
lCameraIndex = (int) lFCurve->Evaluate(pTime) - 1;
if (lCameraIndex >= 0 && lCameraIndex < pCameraArray.GetCount())
{
KFbxNode* lNode = pCameraArray[lCameraIndex];
GetCameraAnimatedParameters(lNode, pTime);
return (KFbxCamera*) lNode->GetNodeAttribute();
}
}
}
else
{
int i;
KFbxNode* lNode = NULL;
for (i = 0; i < pCameraArray.GetCount(); i++)
{
if (lCurrentCameraName.Compare(pCameraArray[i]->GetName()) == 0)
{
lNode = pCameraArray[i];
break;
}
}
if (lNode)
{
GetCameraAnimatedParameters(lNode, pTime);
return (KFbxCamera*) lNode->GetNodeAttribute();
}
}
return lGlobalCameraSettings.GetCameraProducerPerspective();
}