1 | #ifndef NX_COLLISION_NXCONVEXSHAPEDESC
|
---|
2 | #define NX_COLLISION_NXCONVEXSHAPEDESC
|
---|
3 | /*----------------------------------------------------------------------------*\
|
---|
4 | |
|
---|
5 | | Public Interface to NovodeX Technology
|
---|
6 | |
|
---|
7 | | www.novodex.com
|
---|
8 | |
|
---|
9 | \*----------------------------------------------------------------------------*/
|
---|
10 | /** \addtogroup physics
|
---|
11 | @{
|
---|
12 | */
|
---|
13 |
|
---|
14 | #include "NxShapeDesc.h"
|
---|
15 | #include "NxConvexShape.h"
|
---|
16 |
|
---|
17 | class NxConvexMesh;
|
---|
18 |
|
---|
19 | /**
|
---|
20 | \brief Descriptor class for #NxConvexShape.
|
---|
21 |
|
---|
22 | @see NxConvexShape NxShapeDesc NxActor.createShape() NxConvexMesh NxPhysicsSDK.createConvexMesh()
|
---|
23 | */
|
---|
24 | class NxConvexShapeDesc : public NxShapeDesc
|
---|
25 | {
|
---|
26 | public:
|
---|
27 |
|
---|
28 | /**
|
---|
29 | \brief References the triangle mesh that we want to instance.
|
---|
30 |
|
---|
31 | <b>Default:</b> NULL
|
---|
32 |
|
---|
33 | <b>Platform:</b>
|
---|
34 | \li PC SW: Yes
|
---|
35 | \li PPU : Yes
|
---|
36 | \li PS3 : Yes
|
---|
37 | \li XB360: Yes
|
---|
38 |
|
---|
39 | @see NxConvexMesh NxConvexMeshDesc NxPhysicsSDK.createConvexMesh()
|
---|
40 | */
|
---|
41 | NxConvexMesh* meshData;
|
---|
42 |
|
---|
43 | /**
|
---|
44 | \brief Combination of ::NxMeshShapeFlag
|
---|
45 |
|
---|
46 | <b>Default:</b> 0
|
---|
47 |
|
---|
48 | <b>Platform:</b>
|
---|
49 | \li PC SW: Yes
|
---|
50 | \li PPU : No
|
---|
51 | \li PS3 : Yes
|
---|
52 | \li XB360: Yes
|
---|
53 |
|
---|
54 | @see NxMeshShapeFlag
|
---|
55 | */
|
---|
56 | NxU32 meshFlags;
|
---|
57 |
|
---|
58 | #ifdef NX_SUPPORT_CONVEX_SCALE
|
---|
59 | NxReal scale;
|
---|
60 | #endif
|
---|
61 |
|
---|
62 | /**
|
---|
63 | \brief Constructor sets to default.
|
---|
64 | */
|
---|
65 | NX_INLINE NxConvexShapeDesc();
|
---|
66 | /**
|
---|
67 | \brief (re)sets the structure to the default.
|
---|
68 | */
|
---|
69 | NX_INLINE virtual void setToDefault();
|
---|
70 | /**
|
---|
71 | \brief Returns true if the descriptor is valid.
|
---|
72 |
|
---|
73 | \return returns true if the current settings are valid
|
---|
74 | */
|
---|
75 | NX_INLINE virtual bool isValid() const;
|
---|
76 | };
|
---|
77 |
|
---|
78 | NX_INLINE NxConvexShapeDesc::NxConvexShapeDesc() : NxShapeDesc(NX_SHAPE_CONVEX) //constructor sets to default
|
---|
79 | {
|
---|
80 | setToDefault();
|
---|
81 | }
|
---|
82 |
|
---|
83 | NX_INLINE void NxConvexShapeDesc::setToDefault()
|
---|
84 | {
|
---|
85 | NxShapeDesc::setToDefault();
|
---|
86 | meshData = NULL;
|
---|
87 | meshFlags = 0;
|
---|
88 | #ifdef NX_SUPPORT_CONVEX_SCALE
|
---|
89 | scale = 1.0f;
|
---|
90 | #endif
|
---|
91 | }
|
---|
92 |
|
---|
93 | NX_INLINE bool NxConvexShapeDesc::isValid() const
|
---|
94 | {
|
---|
95 | if(!meshData) return false;
|
---|
96 | #ifdef NX_SUPPORT_CONVEX_SCALE
|
---|
97 | if(scale<=0.0f) return false;
|
---|
98 | #endif
|
---|
99 | return NxShapeDesc::isValid();
|
---|
100 | }
|
---|
101 | /** @} */
|
---|
102 | #endif
|
---|
103 |
|
---|
104 |
|
---|
105 | //AGCOPYRIGHTBEGIN
|
---|
106 | ///////////////////////////////////////////////////////////////////////////
|
---|
107 | // Copyright © 2005 AGEIA Technologies.
|
---|
108 | // All rights reserved. www.ageia.com
|
---|
109 | ///////////////////////////////////////////////////////////////////////////
|
---|
110 | //AGCOPYRIGHTEND
|
---|
111 |
|
---|