Advertisement
Guest User

Err

a guest
Jan 10th, 2022
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.91 KB | None | 0 0
  1. void CActorInstance::AttachWeapon(DWORD dwParentPartIndex, DWORD dwPartIndex, CItemData * pItemData)
  2. {
  3. //  assert(m_pkCurRaceData);
  4.     if (!pItemData)
  5.         return;
  6.  
  7.     const char * szBoneName;
  8.     if (!GetAttachingBoneName(dwPartIndex, &szBoneName))
  9.         return;
  10.  
  11.     // NOTE : (이도류처리)단도일 경우 형태가 다른 것으로 얻는다. 없을 경우 디폴트를 리턴
  12.     if (CRaceData::PART_WEAPON_LEFT == dwPartIndex)
  13.     {
  14.         RegisterModelThing(dwPartIndex, pItemData->GetSubModelThing());
  15.     }
  16.     else
  17.     {
  18.         RegisterModelThing(dwPartIndex, pItemData->GetModelThing());
  19.     }
  20.  
  21.     for (DWORD i = 0; i < pItemData->GetLODModelThingCount(); ++i)
  22.     {
  23.         CGraphicThing * pThing;
  24.  
  25.         if (!pItemData->GetLODModelThingPointer(i, &pThing))
  26.             continue;
  27.  
  28.         RegisterLODThing(dwPartIndex, pThing);
  29.     }
  30.  
  31.     SetModelInstance(dwPartIndex, dwPartIndex, 0);
  32.     AttachModelInstance(dwParentPartIndex, szBoneName, dwPartIndex);
  33.  
  34.     // 20041208.myevan.무기스펙큘러(값옷은 SetShape에서 직접 해준다.)
  35.     if (USE_WEAPON_SPECULAR)
  36.     {
  37.         SMaterialData kMaterialData;
  38.         kMaterialData.pImage = NULL;
  39.         kMaterialData.isSpecularEnable = TRUE;
  40.         kMaterialData.fSpecularPower = pItemData->GetSpecularPowerf();
  41.         kMaterialData.bSphereMapIndex = 1;
  42.         SetMaterialData(dwPartIndex, NULL, kMaterialData);
  43.     }
  44.  
  45.     // Weapon Trace
  46.     if (__IsWeaponTrace(pItemData->GetWeaponType()))
  47.     {
  48.         CWeaponTrace * pWeaponTrace = CWeaponTrace::New();     
  49.         pWeaponTrace->SetWeaponInstance(this, dwPartIndex, szBoneName);
  50.         m_WeaponTraceVector.push_back(pWeaponTrace);
  51.     }
  52.  
  53.     if (CGrannyLODController* pLODController = m_LODControllerVector[dwPartIndex])
  54.     {
  55.         if (CGrannyModelInstance* pWeaponModelInstance = pLODController->GetModelInstance())
  56.         {
  57.             CGraphicThing* pItemGraphicThing = pItemData->GetModelThing();
  58.             if (CGrannyMotion* pItemMotion = pItemGraphicThing->GetMotionPointer(0))
  59.             {
  60.                 pWeaponModelInstance->SetMotionPointer(pItemMotion);
  61.             }
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement