1 | #ifndef NX_COLLISION_NXSMOOTHNORMALS
|
---|
2 | #define NX_COLLISION_NXSMOOTHNORMALS
|
---|
3 | /*----------------------------------------------------------------------------*\
|
---|
4 | |
|
---|
5 | | Public Interface to NovodeX Technology
|
---|
6 | |
|
---|
7 | | www.novodex.com
|
---|
8 | |
|
---|
9 | \*----------------------------------------------------------------------------*/
|
---|
10 | /** \addtogroup physics
|
---|
11 | @{
|
---|
12 | */
|
---|
13 |
|
---|
14 | #include "Nxp.h"
|
---|
15 | #include "PhysXLoader.h"
|
---|
16 |
|
---|
17 | /**
|
---|
18 | \brief Builds smooth vertex normals over a mesh.
|
---|
19 |
|
---|
20 | - "smooth" because smoothing groups are not supported here
|
---|
21 | - takes angles into account for correct cube normals computation
|
---|
22 |
|
---|
23 | To use 32bit indices pass a pointer in dFaces and set wFaces to zero. Alternativly pass a pointer to
|
---|
24 | wFaces and set dFaces to zero.
|
---|
25 |
|
---|
26 | \warning #NxCreatePhysicsSDK() must be called before using this function.
|
---|
27 |
|
---|
28 | \param[in] nbTris Number of triangles
|
---|
29 | \param[in] nbVerts Number of vertices
|
---|
30 | \param[in] verts Array of vertices
|
---|
31 | \param[in] dFaces Array of dword triangle indices, or null
|
---|
32 | \param[in] wFaces Array of word triangle indices, or null
|
---|
33 | \param[out] normals Array of computed normals (assumes nbVerts vectors)
|
---|
34 | \param[in] flip Flips the normals or not
|
---|
35 |
|
---|
36 | \return True on success.
|
---|
37 |
|
---|
38 | <b>Platform:</b>
|
---|
39 | \li PC SW: Yes
|
---|
40 | \li PPU : Yes
|
---|
41 | \li PS3 : Yes
|
---|
42 | \li XB360: Yes
|
---|
43 | */
|
---|
44 | NX_INLINE bool NX_CALL_CONV NxBuildSmoothNormals(
|
---|
45 | NxU32 nbTris,
|
---|
46 | NxU32 nbVerts,
|
---|
47 | const NxVec3* verts,
|
---|
48 | const NxU32* dFaces,
|
---|
49 | const NxU16* wFaces,
|
---|
50 | NxVec3* normals,
|
---|
51 | bool flip=false
|
---|
52 | )
|
---|
53 | {
|
---|
54 | return NxGetUtilLib()->NxBuildSmoothNormals(nbTris,nbVerts,verts,dFaces,wFaces,normals,flip);
|
---|
55 | }
|
---|
56 |
|
---|
57 | /** @} */
|
---|
58 | #endif
|
---|
59 |
|
---|
60 |
|
---|
61 | //AGCOPYRIGHTBEGIN
|
---|
62 | ///////////////////////////////////////////////////////////////////////////
|
---|
63 | // Copyright © 2005 AGEIA Technologies.
|
---|
64 | // All rights reserved. www.ageia.com
|
---|
65 | ///////////////////////////////////////////////////////////////////////////
|
---|
66 | //AGCOPYRIGHTEND
|
---|
67 |
|
---|