hkpEntityCallbackUtil.h
上传用户:yisoukefu
上传日期:2020-08-09
资源大小:39506k
文件大小:4k
源码类别:

其他游戏

开发平台:

Visual C++

  1. /* 
  2.  * 
  3.  * Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
  4.  * prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
  5.  * Level 2 and Level 3 source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2009 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement.
  6.  * 
  7.  */
  8. #ifndef HK_DYNAMICS2_ENTITY_CALLBACK_UTIL_H
  9. #define HK_DYNAMICS2_ENTITY_CALLBACK_UTIL_H
  10. class hkpEntity;
  11. struct hkpContactPointAddedEvent;
  12. struct hkpContactPointConfirmedEvent;
  13. struct hkpContactPointRemovedEvent;
  14. struct hkpContactProcessEvent;
  15. class hkpEntityCallbackUtil
  16. {
  17. public:
  18. /// go through both, the entity and the collision listeners
  19. static void HK_CALL fireEntityAdded( hkpEntity* entity );
  20. static void HK_CALL fireEntityRemoved( hkpEntity* entity );
  21. static void HK_CALL fireEntityShapeSet( hkpEntity* entity );
  22. static void HK_CALL fireEntityDeleted( hkpEntity* entity );
  23. static void HK_CALL fireEntitySetMotionType( hkpEntity* entity ) ;
  24. // fast inline functions calling the internal functions
  25. static HK_FORCE_INLINE void HK_CALL fireContactPointAdded( hkpEntity* entity, hkpContactPointAddedEvent& event);
  26. static HK_FORCE_INLINE void HK_CALL fireContactPointConfirmed( hkpEntity* entity, hkpContactPointConfirmedEvent& event);
  27. static HK_FORCE_INLINE void HK_CALL fireContactPointRemoved( hkpEntity* entity, hkpContactPointRemovedEvent& event );
  28. static HK_FORCE_INLINE void HK_CALL fireContactProcess( hkpEntity* entity, hkpContactProcessEvent& event );
  29. protected:
  30. static void HK_CALL fireContactPointAddedInternal( hkpEntity* entity, hkpContactPointAddedEvent& event);
  31. static void HK_CALL fireContactPointConfirmedInternal( hkpEntity* entity, hkpContactPointConfirmedEvent& event);
  32. static void HK_CALL fireContactPointRemovedInternal( hkpEntity* entity, hkpContactPointRemovedEvent& event );
  33. static void HK_CALL fireContactProcessInternal( hkpEntity* entity, hkpContactProcessEvent& event );
  34. };
  35. void HK_CALL hkpEntityCallbackUtil::fireContactPointAdded( hkpEntity* entity, hkpContactPointAddedEvent& event)
  36. {
  37. if ( entity->m_collisionListeners.getSize())
  38. {
  39. fireContactPointAddedInternal(entity, event);
  40. }
  41. }
  42. void HK_CALL hkpEntityCallbackUtil::fireContactPointConfirmed( hkpEntity* entity, hkpContactPointConfirmedEvent& event)
  43. {
  44. if ( entity->m_collisionListeners.getSize())
  45. {
  46. fireContactPointConfirmedInternal( entity, event );
  47. }
  48. }
  49. void HK_CALL hkpEntityCallbackUtil::fireContactPointRemoved( hkpEntity* entity, hkpContactPointRemovedEvent& event )
  50. {
  51. if ( entity->m_collisionListeners.getSize())
  52. {
  53. fireContactPointRemovedInternal( entity, event );
  54. }
  55. }
  56. void HK_CALL hkpEntityCallbackUtil::fireContactProcess( hkpEntity* entity, hkpContactProcessEvent& event )
  57. {
  58. if ( entity->m_collisionListeners.getSize())
  59. {
  60. fireContactProcessInternal( entity, event );
  61. }
  62. }
  63. #endif // HK_DYNAMICS2_ENTITY_CALLBACK_UTIL_H
  64. /*
  65. * Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20090216)
  66. * Confidential Information of Havok.  (C) Copyright 1999-2009
  67. * Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
  68. * Logo, and the Havok buzzsaw logo are trademarks of Havok.  Title, ownership
  69. * rights, and intellectual property rights in the Havok software remain in
  70. * Havok and/or its suppliers.
  71. * Use of this software for evaluation purposes is subject to and indicates
  72. * acceptance of the End User licence Agreement for this product. A copy of
  73. * the license is included with this software and is also available at www.havok.com/tryhavok.
  74. */