[1378] | 1 | #ifndef NX_COLLISION_NXPMAP
|
---|
| 2 | #define NX_COLLISION_NXPMAP
|
---|
| 3 | /*----------------------------------------------------------------------------*\
|
---|
| 4 | |
|
---|
| 5 | | Public Interface to NovodeX Technology
|
---|
| 6 | |
|
---|
| 7 | | www.novodex.com
|
---|
| 8 | |
|
---|
| 9 | \*----------------------------------------------------------------------------*/
|
---|
| 10 | /** \addtogroup physics
|
---|
| 11 | @{
|
---|
| 12 | */
|
---|
| 13 |
|
---|
| 14 | /**
|
---|
| 15 | \brief PMap data structure for mesh collision detection.
|
---|
| 16 |
|
---|
| 17 | Used by the functions NxCreatePMap and NxReleasePMap.
|
---|
| 18 |
|
---|
| 19 | This structure can be assigned to NxTriangleMeshDesc::pmap or passed to NxTriangleMesh::loadPMap().
|
---|
| 20 |
|
---|
| 21 | <h3>Creation</h3>
|
---|
| 22 |
|
---|
| 23 | Example:
|
---|
| 24 |
|
---|
| 25 | \include NxPMap_Create.cpp
|
---|
| 26 |
|
---|
| 27 | <b>Platform:</b>
|
---|
| 28 | \li PC SW: Yes
|
---|
| 29 | \li PPU : No
|
---|
| 30 | \li PS3 : Yes
|
---|
| 31 | \li XB360: Yes
|
---|
| 32 |
|
---|
| 33 | @see NxTriangleMesh.loadPMap() NxConvexShape.loadPMap()
|
---|
| 34 | */
|
---|
| 35 | class NxPMap
|
---|
| 36 | {
|
---|
| 37 | public:
|
---|
| 38 | NxU32 dataSize; //!< size of data buffer in bytes
|
---|
| 39 | void* data; //!< data buffer that stores the PMap information.
|
---|
| 40 | };
|
---|
| 41 |
|
---|
| 42 | //#ifdef NX_COOKING
|
---|
| 43 | /**
|
---|
| 44 | \brief Creates a PMap from a triangle mesh.
|
---|
| 45 |
|
---|
| 46 | A PMap is an optional data structure which makes mesh-mesh collision
|
---|
| 47 | detection more robust at the cost of higher memory consumption.
|
---|
| 48 |
|
---|
| 49 | This structure can then be assigned to NxTriangleMeshDesc::pmap or passed to NxTriangleMesh::loadPMap().
|
---|
| 50 |
|
---|
| 51 | You may wish to store the PMap on disk (just write the above data block to a file of your choice) after
|
---|
| 52 | computing it because the creation process can be quite expensive. Then you won't have to create it the next time
|
---|
| 53 | you need it.
|
---|
| 54 |
|
---|
| 55 | \param[out] pmap Used to store details of the created PMap.
|
---|
| 56 | \param[in] mesh Mesh to create PMap from.
|
---|
| 57 | \param[in] density The density(resolution) of the PMap.
|
---|
| 58 | \param[in] outputStream User supplied interface for reporting errors and displaying messages(see #NxUserOutputStream)
|
---|
| 59 |
|
---|
| 60 | <b>Platform:</b>
|
---|
| 61 | \li PC SW: Yes
|
---|
| 62 | \li PPU : No
|
---|
| 63 | \li PS3 : Yes
|
---|
| 64 | \li XB360: Yes
|
---|
| 65 |
|
---|
| 66 | @see NxPMap NxTriangleMesh.loadPMap() NxConvexShape.loadPMap() NxReleasePMap
|
---|
| 67 | */
|
---|
| 68 | NX_C_EXPORT NXP_DLL_EXPORT bool NX_CALL_CONV NxCreatePMap(NxPMap& pmap, const NxTriangleMesh& mesh, NxU32 density, NxUserOutputStream* outputStream = NULL);
|
---|
| 69 |
|
---|
| 70 | /**
|
---|
| 71 | \brief Releases PMap previously created with NxCreatePMap.
|
---|
| 72 |
|
---|
| 73 | You should not call this on PMap data you have loaded from
|
---|
| 74 | disc yourself. Don't release a PMap while it is being used by a NxTriangleMesh object.
|
---|
| 75 |
|
---|
| 76 | \param[in] pmap Pmap to release.
|
---|
| 77 |
|
---|
| 78 | <b>Platform:</b>
|
---|
| 79 | \li PC SW: Yes
|
---|
| 80 | \li PPU : No
|
---|
| 81 | \li PS3 : Yes
|
---|
| 82 | \li XB360: Yes
|
---|
| 83 |
|
---|
| 84 | @see NxPMap NxTriangleMesh.loadPMap() NxConvexShape.loadPMap() NxCreatePMap
|
---|
| 85 | */
|
---|
| 86 | NX_C_EXPORT NXP_DLL_EXPORT bool NX_CALL_CONV NxReleasePMap(NxPMap& pmap);
|
---|
| 87 | //#endif
|
---|
| 88 |
|
---|
| 89 | /** @} */
|
---|
| 90 | #endif
|
---|
| 91 |
|
---|
| 92 |
|
---|
| 93 | //AGCOPYRIGHTBEGIN
|
---|
| 94 | ///////////////////////////////////////////////////////////////////////////
|
---|
| 95 | // Copyright © 2005 AGEIA Technologies.
|
---|
| 96 | // All rights reserved. www.ageia.com
|
---|
| 97 | ///////////////////////////////////////////////////////////////////////////
|
---|
| 98 | //AGCOPYRIGHTEND
|
---|
| 99 |
|
---|