NvConcavityVolume.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef NV_CONCAVITY_H
  2. #define NV_CONCAVITY_H
  3. /*
  4. NvConcavityVolume.h : This is a code snippet that computes the volume of concavity of a traingle mesh.
  5. */
  6. /*!
  7. **
  8. ** Copyright (c) 2009 by John W. Ratcliff mailto:[email protected]
  9. **
  10. ** Portions of this source has been released with the PhysXViewer application, as well as
  11. ** Rocket, CreateDynamics, ODF, and as a number of sample code snippets.
  12. **
  13. ** If you find this code useful or you are feeling particularily generous I would
  14. ** ask that you please go to http://www.amillionpixels.us and make a donation
  15. ** to Troy DeMolay.
  16. **
  17. ** DeMolay is a youth group for young men between the ages of 12 and 21.
  18. ** It teaches strong moral principles, as well as leadership skills and
  19. ** public speaking. The donations page uses the 'pay for pixels' paradigm
  20. ** where, in this case, a pixel is only a single penny. Donations can be
  21. ** made for as small as $4 or as high as a $100 block. Each person who donates
  22. ** will get a link to their own site as well as acknowledgement on the
  23. ** donations blog located here http://www.amillionpixels.blogspot.com/
  24. **
  25. ** If you wish to contact me you can use the following methods:
  26. **
  27. ** Skype ID: jratcliff63367
  28. ** Yahoo: jratcliff63367
  29. ** AOL: jratcliff1961
  30. ** email: [email protected]
  31. **
  32. **
  33. ** The MIT license:
  34. **
  35. ** Permission is hereby granted, free of charge, to any person obtaining a copy
  36. ** of this software and associated documentation files (the "Software"), to deal
  37. ** in the Software without restriction, including without limitation the rights
  38. ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  39. ** copies of the Software, and to permit persons to whom the Software is furnished
  40. ** to do so, subject to the following conditions:
  41. **
  42. ** The above copyright notice and this permission notice shall be included in all
  43. ** copies or substantial portions of the Software.
  44. ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  45. ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  46. ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  47. ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  48. ** WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  49. ** CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  50. */
  51. #include "NvUserMemAlloc.h"
  52. namespace CONVEX_DECOMPOSITION
  53. {
  54. // computes the 'volume of concavity' of a triangle mesh projected against its surrounding convex hull.
  55. NxF32 computeConcavityVolume(NxU32 vcount_hull,
  56. const NxF32 *vertices_hull,
  57. NxU32 tcount_hull,
  58. const NxU32 *indices_hull,
  59. NxU32 vcount_mesh,
  60. const NxF32 *vertices_mesh,
  61. NxU32 tcount_mesh,
  62. const NxU32 *indices_mesh);
  63. }; // end of namespace
  64. #endif