Main Page
Class Hierarchy
Compound List
Compound Members
Include
PxSpatialIndex.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_PHYSICS_SPATIAL_INDEX
15
#define PX_PHYSICS_SPATIAL_INDEX
16
19
#include "
PxPhysXConfig.h
"
20
#include "
foundation/PxTransform.h
"
21
#include "
geometry/PxGeometry.h
"
22
#include "
PxQueryReport.h
"
23
24
#ifndef PX_DOXYGEN
25
namespace
physx
26
{
27
#endif
28
29
typedef
PxU32
PxSpatialIndexItemId
;
30
static
const
PxSpatialIndexItemId
PX_SPATIAL_INDEX_INVALID_ITEM_ID
= 0xffffffff;
31
32
33
class
PxSpatialIndexItem
34
{
35
};
36
42
struct
PxSpatialOverlapCallback
43
{
44
52
virtual
PxAgain
onHit(
PxSpatialIndexItem
& item) = 0;
53
54
virtual
~PxSpatialOverlapCallback
() {}
55
};
56
62
struct
PxSpatialLocationCallback
63
{
75
virtual
PxAgain
onHit(
PxSpatialIndexItem
& item,
PxReal
distance,
PxReal
& shrunkDistance) = 0;
76
77
virtual
~PxSpatialLocationCallback
() {}
78
};
79
80
81
93
class
PxSpatialIndex
94
{
95
public
:
96
97
104
virtual
PxSpatialIndexItemId
insert(
PxSpatialIndexItem
& item,
105
const
PxBounds3
& bounds) = 0;
106
113
virtual
void
update(
PxSpatialIndexItemId
id
,
114
const
PxBounds3
& bounds) = 0;
115
121
virtual
void
remove
(
PxSpatialIndexItemId
id) = 0;
122
123
130
virtual
void
overlap(
const
PxBounds3
&aabb,
131
PxSpatialOverlapCallback
& callback)
const
= 0;
132
141
virtual
void
raycast(
const
PxVec3
& origin,
142
const
PxVec3
& unitDir,
143
PxReal
maxDist,
144
PxSpatialLocationCallback
& callback)
const
= 0;
145
154
virtual
void
sweep(
const
PxBounds3
& aabb,
155
const
PxVec3
& unitDir,
156
PxReal
maxDist,
157
PxSpatialLocationCallback
& callback)
const
= 0;
158
166
virtual
void
flush() = 0;
167
171
virtual
void
rebuildFull() = 0;
172
184
virtual
void
setIncrementalRebuildRate(
PxU32
rate) = 0;
185
189
virtual
void
rebuildStep() = 0;
190
194
virtual
void
release() = 0;
195
protected
:
196
virtual
~PxSpatialIndex
(){}
197
};
198
204
PX_PHYSX_CORE_API
PxSpatialIndex
*
PxCreateSpatialIndex
();
205
206
#ifndef PX_DOXYGEN
207
}
// namespace physx
208
#endif
209
211
#endif
Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.
www.nvidia.com