RavEngine
Loading...
Searching...
No Matches
NpPruningStructure.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29#ifndef NP_PRUNING_STRUCTURE_H
30#define NP_PRUNING_STRUCTURE_H
34#include "PxPruningStructure.h"
35
36#include "foundation/PxUserAllocated.h"
37#include "GuPrunerMergeData.h"
38
39namespace physx
40{
41 namespace Sq
42 {
44 {
45 PX_NOCOPY(PruningStructure)
46 public:
47 // PX_SERIALIZATION
48 PruningStructure(PxBaseFlags baseFlags);
49 virtual void resolveReferences(PxDeserializationContext& );
50 static PruningStructure* createObject(PxU8*& address, PxDeserializationContext& context);
51 static void getBinaryMetaData(PxOutputStream& stream);
52 void preExportDataReset() {}
53 void exportExtraData(PxSerializationContext&);
54 void importExtraData(PxDeserializationContext&);
55 virtual void requiresObjects(PxProcessPxBaseCallback&);
56 //~PX_SERIALIZATION
57
58 // PxPruningStructure
59 virtual void release();
60 virtual PxU32 getRigidActors(PxRigidActor** userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const;
61 virtual PxU32 getNbRigidActors() const;
62 virtual const void* getStaticMergeData() const;
63 virtual const void* getDynamicMergeData() const;
64 // ~PxPruningStructure
66 virtual ~PruningStructure();
67
68 bool build(PxRigidActor*const* actors, PxU32 nbActors);
69
70 PX_FORCE_INLINE PxU32 getNbActors() const { return mNbActors; }
71 PX_FORCE_INLINE PxActor*const* getActors() const { return mActors; }
72
73 PX_FORCE_INLINE bool isValid() const { return mValid; }
74 void invalidate(PxActor* actor);
75 private:
77 PxU32 mNbActors; // Nb actors from which the pruner structure was build
78 PxActor** mActors; // actors used for pruner structure build, used later for serialization
79 bool mValid; // pruning structure validity
80 };
81 }
82
83}
84
86#endif
Definition base.h:1940
PxActor is the base class for the main simulation objects in the physics SDK.
Definition PxActor.h:201
Binary deserialization context class.
Definition PxSerialFramework.h:174
Output stream class for I/O.
Definition PxIO.h:114
Callback class used to process PxBase objects.
Definition PxSerialFramework.h:81
A precomputed pruning structure to accelerate scene queries against newly added actors.
Definition PxPruningStructure.h:61
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SD...
Definition PxRigidActor.h:53
Binary serialization context class.
Definition PxSerialFramework.h:99
Definition PxUserAllocated.h:43
Definition NpPruningStructure.h:44
virtual const void * getStaticMergeData() const
Gets the merge data for static actors.
Definition NpPruningStructure.cpp:354
virtual void release()
Release this object.
Definition NpPruningStructure.cpp:84
virtual PxU32 getRigidActors(PxRigidActor **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const
Retrieve rigid actors in the pruning structure.
Definition NpPruningStructure.cpp:364
virtual PxU32 getNbRigidActors() const
Returns the number of rigid actors in the pruning structure.
Definition NpPruningStructure.cpp:349
virtual const void * getDynamicMergeData() const
Gets the merge data for dynamic actors.
Definition NpPruningStructure.cpp:359
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Definition GuPrunerMergeData.h:43