| 1 | /* |
| 2 | * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. |
| 3 | * |
| 4 | * NVIDIA CORPORATION and its licensors retain all intellectual property |
| 5 | * and proprietary rights in and to this software, related documentation |
| 6 | * and any modifications thereto. Any use, reproduction, disclosure or |
| 7 | * distribution of this software and related documentation without an express |
| 8 | * license agreement from NVIDIA CORPORATION is strictly prohibited. |
| 9 | */ |
| 10 | // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. |
| 11 | // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. |
| 12 | |
| 13 | |
| 14 | #ifndef PX_PHYSICS_EXTENSIONS_SMOOTH_NORMALS_H |
| 15 | #define PX_PHYSICS_EXTENSIONS_SMOOTH_NORMALS_H |
| 16 | /** \addtogroup extensions |
| 17 | @{ |
| 18 | */ |
| 19 | |
| 20 | #include "common/PxPhysXCommonConfig.h" |
| 21 | |
| 22 | /** |
| 23 | \brief Builds smooth vertex normals over a mesh. |
| 24 | |
| 25 | - "smooth" because smoothing groups are not supported here |
| 26 | - takes angles into account for correct cube normals computation |
| 27 | |
| 28 | To use 32bit indices pass a pointer in dFaces and set wFaces to zero. Alternatively pass a pointer to |
| 29 | wFaces and set dFaces to zero. |
| 30 | |
| 31 | \param[in] nbTris Number of triangles |
| 32 | \param[in] nbVerts Number of vertices |
| 33 | \param[in] verts Array of vertices |
| 34 | \param[in] dFaces Array of dword triangle indices, or null |
| 35 | \param[in] wFaces Array of word triangle indices, or null |
| 36 | \param[out] normals Array of computed normals (assumes nbVerts vectors) |
| 37 | \param[in] flip Flips the normals or not |
| 38 | \return True on success. |
| 39 | */ |
| 40 | PX_C_EXPORT bool PX_CALL_CONV PxBuildSmoothNormals(physx::PxU32 nbTris, physx::PxU32 nbVerts, const physx::PxVec3* verts, |
| 41 | const physx::PxU32* dFaces, const physx::PxU16* wFaces, physx::PxVec3* normals, bool flip); |
| 42 | |
| 43 | /** @} */ |
| 44 | #endif |
| 45 | |