1 | // |
2 | // Redistribution and use in source and binary forms, with or without |
3 | // modification, are permitted provided that the following conditions |
4 | // are met: |
5 | // * Redistributions of source code must retain the above copyright |
6 | // notice, this list of conditions and the following disclaimer. |
7 | // * Redistributions in binary form must reproduce the above copyright |
8 | // notice, this list of conditions and the following disclaimer in the |
9 | // documentation and/or other materials provided with the distribution. |
10 | // * Neither the name of NVIDIA CORPORATION nor the names of its |
11 | // contributors may be used to endorse or promote products derived |
12 | // from this software without specific prior written permission. |
13 | // |
14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY |
15 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
16 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
17 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
18 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
20 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
21 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
22 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 | // |
26 | // Copyright (c) 2008-2021 NVIDIA Corporation. All rights reserved. |
27 | // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. |
28 | // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. |
29 | |
30 | |
31 | #ifndef PX_PHYSICS_NX_DEBUG_VISUALIZATION_PARAMETER |
32 | #define PX_PHYSICS_NX_DEBUG_VISUALIZATION_PARAMETER |
33 | |
34 | #include "foundation/PxPreprocessor.h" |
35 | |
36 | /** \addtogroup physics |
37 | @{ |
38 | */ |
39 | |
40 | #if !PX_DOXYGEN |
41 | namespace physx |
42 | { |
43 | #endif |
44 | |
45 | /* |
46 | NOTE: Parameters should NOT be conditionally compiled out. Even if a particular feature is not available. |
47 | Otherwise the parameter values get shifted about and the numeric values change per platform. This causes problems |
48 | when trying to serialize parameters. |
49 | |
50 | New parameters should also be added to the end of the list for this reason. Also make sure to update |
51 | eNUM_VALUES, which should be one higher than the maximum value in the enum. |
52 | */ |
53 | |
54 | /** |
55 | \brief Debug visualization parameters. |
56 | |
57 | #PxVisualizationParameter::eSCALE is the master switch for enabling visualization, please read the corresponding documentation |
58 | for further details. |
59 | |
60 | @see PxScene.setVisualizationParameter() PxScene.getVisualizationParameter() PxScene.getRenderBuffer() |
61 | */ |
62 | struct PxVisualizationParameter |
63 | { |
64 | enum Enum |
65 | { |
66 | /* RigidBody-related parameters */ |
67 | |
68 | /** |
69 | \brief This overall visualization scale gets multiplied with the individual scales. Setting to zero ignores all visualizations. Default is 0. |
70 | |
71 | The below settings permit the debug visualization of various simulation properties. |
72 | The setting is either zero, in which case the property is not drawn. Otherwise it is a scaling factor |
73 | that determines the size of the visualization widgets. |
74 | |
75 | Only objects for which visualization is turned on using setFlag(eVISUALIZATION) are visualized (see #PxActorFlag::eVISUALIZATION, #PxShapeFlag::eVISUALIZATION, ...). |
76 | Contacts are visualized if they involve a body which is being visualized. |
77 | Default is 0. |
78 | |
79 | Notes: |
80 | - to see any visualization, you have to set PxVisualizationParameter::eSCALE to nonzero first. |
81 | - the scale factor has been introduced because it's difficult (if not impossible) to come up with a |
82 | good scale for 3D vectors. Normals are normalized and their length is always 1. But it doesn't mean |
83 | we should render a line of length 1. Depending on your objects/scene, this might be completely invisible |
84 | or extremely huge. That's why the scale factor is here, to let you tune the length until it's ok in |
85 | your scene. |
86 | - however, things like collision shapes aren't ambiguous. They are clearly defined for example by the |
87 | triangles & polygons themselves, and there's no point in scaling that. So the visualization widgets |
88 | are only scaled when it makes sense. |
89 | |
90 | <b>Range:</b> [0, PX_MAX_F32)<br> |
91 | <b>Default:</b> 0 |
92 | */ |
93 | eSCALE, |
94 | |
95 | |
96 | /** |
97 | \brief Visualize the world axes. |
98 | */ |
99 | eWORLD_AXES, |
100 | |
101 | /* Body visualizations */ |
102 | |
103 | /** |
104 | \brief Visualize a bodies axes. |
105 | |
106 | @see PxActor.globalPose PxActor |
107 | */ |
108 | eBODY_AXES, |
109 | |
110 | /** |
111 | \brief Visualize a body's mass axes. |
112 | |
113 | This visualization is also useful for visualizing the sleep state of bodies. Sleeping bodies are drawn in |
114 | black, while awake bodies are drawn in white. If the body is sleeping and part of a sleeping group, it is |
115 | drawn in red. |
116 | |
117 | @see PxBodyDesc.massLocalPose PxActor |
118 | */ |
119 | eBODY_MASS_AXES, |
120 | |
121 | /** |
122 | \brief Visualize the bodies linear velocity. |
123 | |
124 | @see PxBodyDesc.linearVelocity PxActor |
125 | */ |
126 | eBODY_LIN_VELOCITY, |
127 | |
128 | /** |
129 | \brief Visualize the bodies angular velocity. |
130 | |
131 | @see PxBodyDesc.angularVelocity PxActor |
132 | */ |
133 | eBODY_ANG_VELOCITY, |
134 | |
135 | |
136 | /* Contact visualisations */ |
137 | |
138 | /** |
139 | \brief Visualize contact points. Will enable contact information. |
140 | */ |
141 | eCONTACT_POINT, |
142 | |
143 | /** |
144 | \brief Visualize contact normals. Will enable contact information. |
145 | */ |
146 | eCONTACT_NORMAL, |
147 | |
148 | /** |
149 | \brief Visualize contact errors. Will enable contact information. |
150 | */ |
151 | eCONTACT_ERROR, |
152 | |
153 | /** |
154 | \brief Visualize Contact forces. Will enable contact information. |
155 | */ |
156 | eCONTACT_FORCE, |
157 | |
158 | |
159 | /** |
160 | \brief Visualize actor axes. |
161 | |
162 | @see PxRigidStatic PxRigidDynamic PxArticulationLink |
163 | */ |
164 | eACTOR_AXES, |
165 | |
166 | |
167 | /** |
168 | \brief Visualize bounds (AABBs in world space) |
169 | */ |
170 | eCOLLISION_AABBS, |
171 | |
172 | /** |
173 | \brief Shape visualization |
174 | |
175 | @see PxShape |
176 | */ |
177 | eCOLLISION_SHAPES, |
178 | |
179 | /** |
180 | \brief Shape axis visualization |
181 | |
182 | @see PxShape |
183 | */ |
184 | eCOLLISION_AXES, |
185 | |
186 | /** |
187 | \brief Compound visualization (compound AABBs in world space) |
188 | */ |
189 | eCOLLISION_COMPOUNDS, |
190 | |
191 | /** |
192 | \brief Mesh & convex face normals |
193 | |
194 | @see PxTriangleMesh PxConvexMesh |
195 | */ |
196 | eCOLLISION_FNORMALS, |
197 | |
198 | /** |
199 | \brief Active edges for meshes |
200 | |
201 | @see PxTriangleMesh |
202 | */ |
203 | eCOLLISION_EDGES, |
204 | |
205 | /** |
206 | \brief Static pruning structures |
207 | */ |
208 | eCOLLISION_STATIC, |
209 | |
210 | /** |
211 | \brief Dynamic pruning structures |
212 | */ |
213 | eCOLLISION_DYNAMIC, |
214 | |
215 | /** |
216 | \brief Visualizes pairwise state. |
217 | */ |
218 | eDEPRECATED_COLLISION_PAIRS, |
219 | |
220 | /** |
221 | \brief Joint local axes |
222 | */ |
223 | eJOINT_LOCAL_FRAMES, |
224 | |
225 | /** |
226 | \brief Joint limits |
227 | */ |
228 | eJOINT_LIMITS, |
229 | |
230 | /** |
231 | \brief Visualize culling box |
232 | */ |
233 | eCULL_BOX, |
234 | |
235 | /** |
236 | \brief MBP regions |
237 | */ |
238 | eMBP_REGIONS, |
239 | |
240 | /** |
241 | \brief This is not a parameter, it just records the current number of parameters (as maximum(PxVisualizationParameter)+1) for use in loops. |
242 | */ |
243 | eNUM_VALUES, |
244 | |
245 | eFORCE_DWORD = 0x7fffffff |
246 | }; |
247 | }; |
248 | |
249 | #if !PX_DOXYGEN |
250 | } // namespace physx |
251 | #endif |
252 | |
253 | /** @} */ |
254 | #endif |
255 | |