bool CJaw::GetFiringPos(EntityId weaponId, const IFireMode* pFireMode, Vec3& pos) { int slot = eIGS_ThirdPerson; CActor* pOwnerActor = GetOwnerActor(); if (pOwnerActor && !pOwnerActor->IsThirdPerson()) slot = eIGS_FirstPerson; ICharacterInstance *pCharacter = GetEntity()->GetCharacter(slot); if (!pCharacter || !(pCharacter->IsCharacterVisible() && slot==eIGS_ThirdPerson)) return false; Matrix34 fireHelperLocation = GetCharacterAttachmentWorldTM(slot, "muzzleflash_effect"); pos = fireHelperLocation.TransformPoint(Vec3(ZERO)); return true; }
//------------------------------------------------------------------------ Matrix34 CItem::GetEffectWorldTM(uint32 id) { TEffectInfoMap::const_iterator it = m_effects.find(id); if (it == m_effects.end()) return Matrix34::CreateIdentity(); const SEffectInfo &info = it->second; SEntitySlotInfo slotInfo; if (GetEntity()->GetSlotInfo(info.slot, slotInfo) && slotInfo.pParticleEmitter) return GetEntity()->GetSlotWorldTM(info.slot); else if (GetEntity()->GetSlotInfo(info.characterSlot, slotInfo) && slotInfo.pCharacter) return GetCharacterAttachmentWorldTM(info.characterSlot, info.helper.c_str()); return Matrix34::CreateIdentity(); }