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

其他游戏

开发平台:

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_COLLIDE_STORAGESAMPLEDHEIGHTFIELDSHAPE_H
  9. #define HK_COLLIDE_STORAGESAMPLEDHEIGHTFIELDSHAPE_H
  10. #include <Physics/Collide/Shape/HeightField/SampledHeightField/hkpSampledHeightFieldShape.h>
  11. #include <Physics/Collide/Shape/HeightField/SampledHeightField/hkpSampledHeightFieldBaseCinfo.h>
  12. extern const hkClass hkpStorageSampledHeightFieldShapeClass;
  13. /// A heightfield shape which stores the heights as an array of hkReals.
  14. /// This class is most useful for debug snapshots in the same way as hkpStorageMeshShape.
  15. /// Normally the heightfield data would be stored in a more memory efficient manner,
  16. /// possibly shared with other components.
  17. /// hkpStorageSampledHeightFieldShape is also used as a simple heightfield implementation on the SPU
  18. class hkpStorageSampledHeightFieldShape : public hkpSampledHeightFieldShape
  19. {
  20. public:
  21. HK_DECLARE_REFLECTION();
  22. hkpStorageSampledHeightFieldShape( const hkpSampledHeightFieldShape* hf );
  23. hkpStorageSampledHeightFieldShape( const hkpSampledHeightFieldBaseCinfo& info, hkArray<hkReal>& samples );
  24. HK_FORCE_INLINE HKP_SHAPE_VIRTUAL hkReal getHeightAtImpl( HKP_SHAPE_VIRTUAL_THIS int x, int z ) HKP_SHAPE_VIRTUAL_CONST;
  25. HK_FORCE_INLINE HKP_SHAPE_VIRTUAL hkBool getTriangleFlipImpl(HKP_SHAPE_VIRTUAL_THIS2) HKP_SHAPE_VIRTUAL_CONST;
  26. virtual void collideSpheres( const CollideSpheresInput& input, SphereCollisionOutput* outputArray) const;
  27. /// hkpShape Interface
  28. virtual int calcSizeForSpu(const CalcSizeForSpuInput& input, int spuBufferSizeLeft) const;
  29. public:
  30. hkArray<hkReal> m_storage;
  31. hkBool m_triangleFlip;
  32. public:
  33. hkpStorageSampledHeightFieldShape( hkFinishLoadedObjectFlag f )
  34. : hkpSampledHeightFieldShape(f), m_storage(f)
  35. {
  36. if( f.m_finishing )
  37. {
  38. m_heightfieldType = hkpSampledHeightFieldShape::HEIGHTFIELD_STORAGE;
  39. }
  40. }
  41. };
  42. #include <Physics/Collide/Shape/HeightField/StorageSampledHeightField/hkpStorageSampledHeightFieldShape.inl>
  43. #endif // HK_COLLIDE_STORAGESAMPLEDHEIGHTFIELDSHAPE_H
  44. /*
  45. * Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20090216)
  46. * Confidential Information of Havok.  (C) Copyright 1999-2009
  47. * Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
  48. * Logo, and the Havok buzzsaw logo are trademarks of Havok.  Title, ownership
  49. * rights, and intellectual property rights in the Havok software remain in
  50. * Havok and/or its suppliers.
  51. * Use of this software for evaluation purposes is subject to and indicates
  52. * acceptance of the End User licence Agreement for this product. A copy of
  53. * the license is included with this software and is also available at www.havok.com/tryhavok.
  54. */