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

其他游戏

开发平台:

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_COLLIDE2_CONVEX_LIST_AGENT_H
  9. #define HK_COLLIDE2_CONVEX_LIST_AGENT_H
  10. #include <Physics/Internal/Collide/Gjk/GskManifold/hkpGskManifold.h>
  11. #include <Physics/Collide/Agent/ConvexAgent/Gjk/hkpPredGskfAgent.h>
  12. #include <Physics/Internal/Collide/Agent3/Machine/1n/hkpAgent1nTrack.h>
  13. class hkpCollisionDispatcher;
  14. struct hkpExtendedGskOut;
  15. struct hkpCollisionInput;
  16. /// A hkpConvexListAgent handles collisions between a hkpConvexShape and a list of other convex shapes
  17. class hkpConvexListAgent : public hkpPredGskfAgent
  18. {
  19. public:
  20. /// Registers the agent with the collision dispatcher.
  21. static void HK_CALL registerAgent(hkpCollisionDispatcher* dispatcher);
  22. // hkpCollisionAgent interface implementation.
  23. virtual void processCollision(const hkpCdBody& bodyA, const hkpCdBody& bodyB, const hkpProcessCollisionInput& input, hkpProcessCollisionOutput& result);
  24. // hkpCollisionAgent interface implementation.
  25. virtual void linearCast( const hkpCdBody& bodyA, const hkpCdBody& bodyB, const hkpLinearCastCollisionInput& input, hkpCdPointCollector& collector, hkpCdPointCollector* startCollector );
  26. // hkpCollisionAgent interface implementation.
  27. static void HK_CALL staticLinearCast( const hkpCdBody& bodyA, const hkpCdBody& bodyB, const hkpLinearCastCollisionInput& input, hkpCdPointCollector& collector, hkpCdPointCollector* startCollector );
  28. // hkpCollisionAgent interface implementation.
  29. virtual void getClosestPoints( const hkpCdBody& bodyA, const hkpCdBody& bodyB, const hkpCollisionInput& input, class hkpCdPointCollector& collector ) ;
  30. // hkpCollisionAgent interface implementation.
  31. static void HK_CALL staticGetClosestPoints( const hkpCdBody& bodyA, const hkpCdBody& bodyB, const hkpCollisionInput& input, class hkpCdPointCollector& collector ) ;
  32. // hkpCollisionAgent interface implementation.
  33. virtual void getPenetrations( const hkpCdBody& bodyA, const hkpCdBody& bodyB, const hkpCollisionInput& input, hkpCdBodyPairCollector& collector );
  34. // hkpCollisionAgent interface implementation.
  35. static void HK_CALL staticGetPenetrations( const hkpCdBody& bodyA, const hkpCdBody& bodyB, const hkpCollisionInput& input, hkpCdBodyPairCollector& collector );
  36. // hkpCollisionAgent interface implementation.
  37. virtual void updateShapeCollectionFilter( const hkpCdBody& bodyA, const hkpCdBody& bodyB, const hkpCollisionInput& input, hkCollisionConstraintOwner& constraintOwner );
  38.         virtual void calcContentStatistics( hkStatisticsCollector* collector, const hkClass* cls ) const;
  39. // hkpCollisionAgent interface implementation.
  40. virtual void invalidateTim( const hkpCollisionInput& input);
  41. // hkpCollisionAgent interface implementation.
  42. virtual void warpTime(hkTime oldTime, hkTime newTime, const hkpCollisionInput& input);
  43. // hkpCollisionAgent interface implementation.
  44. virtual void cleanup( hkCollisionConstraintOwner& constraintOwner );
  45. // hkpCollisionAgent interface implementation.
  46. virtual void removePoint( hkContactPointId idToRemove );
  47. // hkpCollisionAgent interface implementation.
  48. virtual void commitPotential( hkContactPointId newId );
  49. // hkpCollisionAgent interface implementation.
  50. virtual void createZombie( hkContactPointId idTobecomeZombie );
  51. protected:
  52. friend class hkpConvexConvexWelderAgent;
  53. //
  54. // Note: to use the next two inline functions include the .inl file
  55. //
  56. /// Constructor, called by the createGskConvexConvexAgent() function.
  57. hkpConvexListAgent(const hkpCdBody& bodyA, const hkpCdBody& bodyB, const  hkpCollisionInput& input, hkpContactMgr* mgr );
  58. /// Destructor, called by cleanup().
  59. ~hkpConvexListAgent(){}
  60. void switchToGskMode(hkCollisionConstraintOwner& constraintOwner);
  61. void switchToStreamMode(hkCollisionConstraintOwner& constraintOwner);
  62. public:
  63. /// Agent creation function used by the hkpCollisionDispatcher.
  64. static hkpCollisionAgent* HK_CALL createConvexConvexListAgent(const  hkpCdBody& bodyA, const hkpCdBody& bodyB, const  hkpCollisionInput& input, hkpContactMgr* mgr);
  65. static hkpCollisionAgent* HK_CALL createConvexListConvexAgent(const  hkpCdBody& bodyA, const hkpCdBody& bodyB, const  hkpCollisionInput& input, hkpContactMgr* mgr);
  66. static hkpCollisionAgent* HK_CALL createConvexListConvexListAgent(const  hkpCdBody& bodyA, const hkpCdBody& bodyB, const  hkpCollisionInput& input, hkpContactMgr* mgr);
  67. protected:
  68. hkpCollisionDispatcher* m_dispatcher;
  69. hkBool m_inGskMode;
  70. hkBool      m_processFunctionCalled;
  71. hkInt16 m_inStreamModeCounter;
  72. struct StreamData
  73. {
  74. HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR( HK_MEMORY_CLASS_COLLIDE, hkpConvexListAgent::StreamData );
  75. hkpAgent1nTrack  m_agentTrack;
  76. hkReal     m_inStreamModeTimDist;
  77. };
  78. StreamData& getStream()
  79. {
  80. HK_ASSERT( 0xf0457534, m_inGskMode == false );
  81. return *reinterpret_cast<StreamData*>(&m_manifold);
  82. }
  83. const StreamData& getStreamConst() const
  84. {
  85. HK_ASSERT( 0xf0457534, m_inGskMode == false );
  86. return *reinterpret_cast<const StreamData*>(&m_manifold);
  87. }
  88. };
  89. #endif // HK_COLLIDE2_CONVEX_LIST_AGENT_H
  90. /*
  91. * Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20090216)
  92. * Confidential Information of Havok.  (C) Copyright 1999-2009
  93. * Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
  94. * Logo, and the Havok buzzsaw logo are trademarks of Havok.  Title, ownership
  95. * rights, and intellectual property rights in the Havok software remain in
  96. * Havok and/or its suppliers.
  97. * Use of this software for evaluation purposes is subject to and indicates
  98. * acceptance of the End User licence Agreement for this product. A copy of
  99. * the license is included with this software and is also available at www.havok.com/tryhavok.
  100. */