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_EXTENSIONS_BROAD_PHASE_H
15#define PX_PHYSICS_EXTENSIONS_BROAD_PHASE_H
16/** \addtogroup extensions
17 @{
18*/
19
20#include "PxPhysXConfig.h"
21#include "common/PxPhysXCommonConfig.h"
22
23#ifndef PX_DOXYGEN
24namespace physx
25{
26#endif
27
28class PxBroadPhaseExt
29{
30public:
31
32 /**
33 \brief Creates regions for PxSceneDesc, from a global box.
34
35 This helper simply subdivides the given global box into a 2D grid of smaller boxes. Each one of those smaller boxes
36 is a region of interest for the broadphase. There are nbSubdiv*nbSubdiv regions in the 2D grid. The function does not
37 subdivide along the given up axis.
38
39 This is the simplest setup one can use with PxBroadPhaseType::eMBP. A more sophisticated setup would try to cover
40 the game world with a non-uniform set of regions (i.e. not just a grid).
41
42 \param[out] regions Regions computed from the input global box
43 \param[in] globalBounds World-space box covering the game world
44 \param[in] nbSubdiv Grid subdivision level. The function will create nbSubdiv*nbSubdiv regions.
45 \param[in] upAxis Up axis (0 for X, 1 for Y, 2 for Z).
46 \return number of regions written out to the 'regions' array
47
48 @see PxSceneDesc PxBroadPhaseType
49 */
50 static PxU32 createRegionsFromWorldBounds(PxBounds3* regions, const PxBounds3& globalBounds, PxU32 nbSubdiv, PxU32 upAxis=1);
51};
52
53#ifndef PX_DOXYGEN
54} // namespace physx
55#endif
56
57/** @} */
58#endif
59