本文整理汇总了C++中CAI::GetObject方法的典型用法代码示例。如果您正苦于以下问题:C++ CAI::GetObject方法的具体用法?C++ CAI::GetObject怎么用?C++ CAI::GetObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAI
的用法示例。
在下文中一共展示了CAI::GetObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitAttachments
void AI_Helicopter::InitAttachments()
{
CAIVehicle::InitAttachments();
for ( int iObject = 0 ; iObject < m_cObjects ; iObject++ )
{
BaseClass* pObject = m_apObjects[iObject];
if (pObject)
{
if ( IsKindOf(pObject->m_hObject, "ControlledSearchLight") )
{
m_iObjectSearchLight = iObject;
ControlledSearchLight* pSearchLight = ((ControlledSearchLight*)pObject);
pSearchLight->SetController(m_hObject);
HATTACHMENT hAttachment;
if ( LT_OK == g_pLTServer->FindAttachment(m_hObject, pSearchLight->m_hObject, &hAttachment) )
{
LTransform transform;
g_pLTServer->Common()->GetAttachmentTransform(hAttachment, transform, LTTRUE);
g_pTransLT->Get(transform, m_vPosSearchlight, m_rRotSearchlight);
}
}
else if ( IsKindOf(pObject->m_hObject, "CAI") )
{
Link(pObject->m_hObject);
m_iObjectGunner = iObject;
CAI* pGunner = ((CAI*)pObject);
HATTACHMENT hAttachment;
if ( LT_OK == g_pLTServer->FindAttachment(m_hObject, pGunner->m_hObject, &hAttachment) )
{
LTransform transform;
g_pLTServer->Common()->GetAttachmentTransform(hAttachment, transform, LTTRUE);
g_pTransLT->Get(transform, m_vPosGunner, m_rRotGunner);
}
char szMessage[128];
sprintf(szMessage, "HELIATTACK HELI=%s", g_pLTServer->GetObjectName(m_hObject));
SendTriggerMsgToObject(this, pGunner->GetObject(), LTFALSE, szMessage);
}
}
}
}