Main Page
Class Hierarchy
Compound List
Compound Members
Include
geometry
PxHeightFieldDesc.h
Go to the documentation of this file.
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_COLLISION_NXHEIGHTFIELDDESC
15
#define PX_COLLISION_NXHEIGHTFIELDDESC
16
20
#include "
foundation/PxBounds3.h
"
21
#include "
common/PxPhysXCommonConfig.h
"
22
#include "
geometry/PxHeightFieldFlag.h
"
23
#include "
common/PxCoreUtilityTypes.h
"
24
25
#ifndef PX_DOXYGEN
26
namespace
physx
27
{
28
#endif
29
38
class
PxHeightFieldDesc
39
{
40
public
:
41
50
PxU32
nbRows
;
51
60
PxU32
nbColumns
;
61
71
PxHeightFieldFormat::Enum
format
;
72
91
PxStridedData
samples
;
92
110
PxReal
thickness
;
111
126
PxReal
convexEdgeThreshold
;
127
135
PxHeightFieldFlags
flags
;
136
140
PX_INLINE
PxHeightFieldDesc
();
141
145
PX_INLINE
void
setToDefault();
146
151
PX_INLINE
bool
isValid()
const
;
152
};
153
154
PX_INLINE
PxHeightFieldDesc::PxHeightFieldDesc
()
//constructor sets to default
155
{
156
nbColumns = 0;
157
nbRows = 0;
158
format =
PxHeightFieldFormat::eS16_TM
;
159
thickness = -1.0f;
160
convexEdgeThreshold = 0.0f;
161
flags
=
PxHeightFieldFlags
();
162
}
163
164
PX_INLINE
void
PxHeightFieldDesc::setToDefault
()
165
{
166
*
this
=
PxHeightFieldDesc
();
167
}
168
169
PX_INLINE
bool
PxHeightFieldDesc::isValid
()
const
170
{
171
if
(nbColumns < 2)
172
return
false
;
173
if
(nbRows < 2)
174
return
false
;
175
switch
(format)
176
{
177
case
PxHeightFieldFormat::eS16_TM
:
178
if
(samples.stride < 4)
179
return
false
;
180
break
;
181
default
:
182
return
false
;
183
}
184
if
(convexEdgeThreshold < 0)
185
return
false
;
186
if
((
flags
&
PxHeightFieldFlag::eNO_BOUNDARY_EDGES
) !=
flags
)
187
return
false
;
188
if
(thickness < -PX_MAX_BOUNDS_EXTENTS || thickness >
PX_MAX_BOUNDS_EXTENTS
)
189
return
false
;
190
return
true
;
191
}
192
193
#ifndef PX_DOXYGEN
194
}
// namespace physx
195
#endif
196
198
#endif
Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.
www.nvidia.com