1 | #ifndef NX_COLLISION_NXCAPSULESHAPEDESC
|
---|
2 | #define NX_COLLISION_NXCAPSULESHAPEDESC
|
---|
3 | /*----------------------------------------------------------------------------*\
|
---|
4 | |
|
---|
5 | | Public Interface to NovodeX Technology
|
---|
6 | |
|
---|
7 | | www.novodex.com
|
---|
8 | |
|
---|
9 | \*----------------------------------------------------------------------------*/
|
---|
10 | /** \addtogroup physics
|
---|
11 | @{
|
---|
12 | */
|
---|
13 |
|
---|
14 | #include "NxCapsuleShape.h"
|
---|
15 | #include "NxShapeDesc.h"
|
---|
16 | /**
|
---|
17 | \brief Descriptor class for #NxCapsuleShape.
|
---|
18 |
|
---|
19 | @see NxCapsuleShape NxShapeDesc NxActor.createShape() NxCapsule
|
---|
20 | */
|
---|
21 | class NxCapsuleShapeDesc : public NxShapeDesc
|
---|
22 | {
|
---|
23 | public:
|
---|
24 | /**
|
---|
25 | \brief Radius of the capsule's hemispherical ends and its trunk.
|
---|
26 |
|
---|
27 | <b>Range:</b> (0,inf)<br>
|
---|
28 | <b>Default:</b> 1.0
|
---|
29 |
|
---|
30 | <b>Platform:</b>
|
---|
31 | \li PC SW: Yes
|
---|
32 | \li PPU : Yes
|
---|
33 | \li PS3 : Yes
|
---|
34 | \li XB360: Yes
|
---|
35 |
|
---|
36 | @see NxCapsuleShape.setRadius() NxCapsuleShape.setDimensions()
|
---|
37 | */
|
---|
38 | NxReal radius;
|
---|
39 |
|
---|
40 | /**
|
---|
41 | \brief The distance between the two hemispherical ends of the capsule.
|
---|
42 |
|
---|
43 | The height is along the capsule's Y axis.
|
---|
44 |
|
---|
45 | <b>Range:</b> (0,inf)<br>
|
---|
46 | <b>Default:</b> 1.0
|
---|
47 |
|
---|
48 | <b>Platform:</b>
|
---|
49 | \li PC SW: Yes
|
---|
50 | \li PPU : Yes
|
---|
51 | \li PS3 : Yes
|
---|
52 | \li XB360: Yes
|
---|
53 |
|
---|
54 | @see NxCapsuleShape.setHeight() NxCapsuleShape.setDimensions()
|
---|
55 | */
|
---|
56 | NxReal height;
|
---|
57 |
|
---|
58 | /**
|
---|
59 | \brief Combination of ::NxCapsuleShapeFlag
|
---|
60 |
|
---|
61 | <b>Default:</b> 0
|
---|
62 |
|
---|
63 | <b>Platform:</b>
|
---|
64 | \li PC SW: Yes
|
---|
65 | \li PPU : No
|
---|
66 | \li PS3 : Yes
|
---|
67 | \li XB360: Yes
|
---|
68 |
|
---|
69 | @see NxCapsuleShapeFlag
|
---|
70 | */
|
---|
71 | NxU32 flags;
|
---|
72 |
|
---|
73 | /**
|
---|
74 | \brief constructor sets to default.
|
---|
75 | */
|
---|
76 | NX_INLINE NxCapsuleShapeDesc();
|
---|
77 | /**
|
---|
78 | \brief (re)sets the structure to the default.
|
---|
79 | */
|
---|
80 | NX_INLINE virtual void setToDefault();
|
---|
81 | /**
|
---|
82 | \brief Returns true if the descriptor is valid.
|
---|
83 |
|
---|
84 | \return True if the current settings are valid
|
---|
85 | */
|
---|
86 | NX_INLINE virtual bool isValid() const;
|
---|
87 | };
|
---|
88 |
|
---|
89 | NX_INLINE NxCapsuleShapeDesc::NxCapsuleShapeDesc() : NxShapeDesc(NX_SHAPE_CAPSULE) //constructor sets to default
|
---|
90 | {
|
---|
91 | setToDefault();
|
---|
92 | }
|
---|
93 |
|
---|
94 | NX_INLINE void NxCapsuleShapeDesc::setToDefault()
|
---|
95 | {
|
---|
96 | NxShapeDesc::setToDefault();
|
---|
97 | radius = 1.0f;
|
---|
98 | height = 1.0f;
|
---|
99 | flags = 0;
|
---|
100 | }
|
---|
101 |
|
---|
102 | NX_INLINE bool NxCapsuleShapeDesc::isValid() const
|
---|
103 | {
|
---|
104 | if(!NxMath::isFinite(radius)) return false;
|
---|
105 | if(radius<=0.0f) return false;
|
---|
106 | if(!NxMath::isFinite(height)) return false;
|
---|
107 | if(height<=0.0f) return false;
|
---|
108 | return NxShapeDesc::isValid();
|
---|
109 | }
|
---|
110 |
|
---|
111 | /** @} */
|
---|
112 | #endif
|
---|
113 |
|
---|
114 |
|
---|
115 | //AGCOPYRIGHTBEGIN
|
---|
116 | ///////////////////////////////////////////////////////////////////////////
|
---|
117 | // Copyright © 2005 AGEIA Technologies.
|
---|
118 | // All rights reserved. www.ageia.com
|
---|
119 | ///////////////////////////////////////////////////////////////////////////
|
---|
120 | //AGCOPYRIGHTEND
|
---|
121 |
|
---|