本文整理汇总了C++中CClientPlayer::GetTransformedBonePosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientPlayer::GetTransformedBonePosition方法的具体用法?C++ CClientPlayer::GetTransformedBonePosition怎么用?C++ CClientPlayer::GetTransformedBonePosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClientPlayer
的用法示例。
在下文中一共展示了CClientPlayer::GetTransformedBonePosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawFromAim
void CNametags::DrawFromAim()
{
unsigned long ulCurrentTime = CClientTime::GetTime();
// Got any players that are not local?
if (m_pPlayerManager->Count() > 1)
{
// Grab the local player
CClientPlayer* pLocalPlayer = m_pPlayerManager->GetLocalPlayer();
if (pLocalPlayer)
{
// Grab the current time and the camera
unsigned long ulCurrentTime = CClientTime::GetTime();
CCamera* pCamera = g_pGame->GetCamera();
// Grab our controller state
CControllerState State;
g_pGame->GetPad()->GetCurrentControllerState(&State);
// Grab our current weapon slot. Use screen center if melee or none
CVector vecStart;
CVector vecTarget;
eWeaponSlot eSlot = pLocalPlayer->GetCurrentWeaponSlot();
if (eSlot == WEAPONSLOT_TYPE_UNARMED || eSlot == WEAPONSLOT_TYPE_MELEE || eSlot == WEAPONSLOT_TYPE_RIFLE || eSlot == WEAPONSLOT_TYPE_THROWN ||
eSlot == WEAPONSLOT_TYPE_SPECIAL || eSlot == WEAPONSLOT_TYPE_GIFT || eSlot == WEAPONSLOT_TYPE_PARACHUTE || eSlot == WEAPONSLOT_TYPE_DETONATOR)
{
// Grab the active cam
CCamera* pCamera = g_pGame->GetCamera();
CCam* pActive = pCamera->GetCam(pCamera->GetActiveCam());
// Grab the camera matrix
CMatrix matCamera;
pCamera->GetMatrix(&matCamera);
vecStart = matCamera.vPos;
// Range
float fRange;
eWeaponType eWeapon = pLocalPlayer->GetCurrentWeaponType();
float fSkill = pLocalPlayer->GetStat(g_pGame->GetStats()->GetSkillStatIndex(eWeapon));
CWeaponStat* pWeaponStat = g_pGame->GetWeaponStatManager()->GetWeaponStatsFromSkillLevel(eWeapon, fSkill);
if (pWeaponStat)
{
fRange = pWeaponStat->GetTargetRange();
}
else
{
fRange = MELEE_VISIBLE_RANGE;
}
// Find the target position
CVector vecFront = *pActive->GetFront();
vecFront.Normalize();
vecTarget = *pActive->GetSource() + vecFront * fRange;
}
else
{
// Grab the weapon and keysync state. If it exists and he holds Target down
CWeapon* pPlayerWeapon = pLocalPlayer->GetWeapon();
if (pPlayerWeapon && State.RightShoulder1)
{
// Grab the gun muzzle position
eWeaponType eWeapon = pLocalPlayer->GetCurrentWeaponType();
float fSkill = pLocalPlayer->GetStat(g_pGame->GetStats()->GetSkillStatIndex(eWeapon));
CWeaponStat* pWeaponStat = g_pGame->GetWeaponStatManager()->GetWeaponStatsFromSkillLevel(eWeapon, fSkill);
CVector vecGunMuzzle = *pWeaponStat->GetFireOffset();
pLocalPlayer->GetTransformedBonePosition(BONE_RIGHTWRIST, vecGunMuzzle);
// Grab the target point
pCamera->Find3rdPersonCamTargetVector(AIM_VISIBLE_RANGE, &vecGunMuzzle, &vecStart, &vecTarget);
}
else
{
// Grab the active cam
CCam* pActive = pCamera->GetCam(pCamera->GetActiveCam());
// Grab the camera matrix
CMatrix matCamera;
pCamera->GetMatrix(&matCamera);
vecStart = matCamera.vPos;
// Find the target position
CVector vecFront = *pActive->GetFront();
vecFront.Normalize();
vecTarget = *pActive->GetSource() + vecFront * MELEE_VISIBLE_RANGE;
}
}
// Ignore the local player for this
pLocalPlayer->WorldIgnore(true);
// Do the raycast
CColPoint* pColPoint = NULL;
CEntity* pEntity = NULL;
SLineOfSightFlags flags;
flags.bCheckBuildings = true;
flags.bCheckVehicles = true;
flags.bCheckPeds = true;
flags.bCheckObjects = true;
flags.bCheckDummies = true;
//.........这里部分代码省略.........