本文整理汇总了C++中KX_GameObject::AddRef方法的典型用法代码示例。如果您正苦于以下问题:C++ KX_GameObject::AddRef方法的具体用法?C++ KX_GameObject::AddRef怎么用?C++ KX_GameObject::AddRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KX_GameObject
的用法示例。
在下文中一共展示了KX_GameObject::AddRef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BroadPhaseFilterCollision
bool KX_NearSensor::NewHandleCollision(void *obj1, void *obj2, const PHY_CollData *coll_data)
{
// KX_CollisionEventManager* toucheventmgr = static_cast<KX_CollisionEventManager*>(m_eventmgr);
// KX_GameObject* parent = static_cast<KX_GameObject*>(GetParent());
// need the mapping from PHY_IPhysicsController to gameobjects now
KX_ClientObjectInfo *client_info = static_cast<KX_ClientObjectInfo*> (obj1 == m_physCtrl?
((PHY_IPhysicsController*)obj2)->GetNewClientInfo() :
((PHY_IPhysicsController*)obj1)->GetNewClientInfo());
KX_GameObject* gameobj = ( client_info ?
client_info->m_gameobject :
NULL);
// Add the same check as in SCA_ISensor::Activate(),
// we don't want to record collision when the sensor is not active.
if (m_links && !m_suspended &&
gameobj /* done in BroadPhaseFilterCollision() && (gameobj != parent)*/)
{
if (!m_colliders->SearchValue(gameobj))
m_colliders->Add(gameobj->AddRef());
// only take valid colliders
// These checks are done already in BroadPhaseFilterCollision()
//if (client_info->m_type == KX_ClientObjectInfo::ACTOR)
//{
// if ((m_touchedpropname.size() == 0) ||
// (gameobj->GetProperty(m_touchedpropname)))
// {
m_bTriggered = true;
m_hitObject = gameobj;
// }
//}
}
return false; // was DT_CONTINUE; but this was defined in Sumo as false
}