RavEngine
Loading...
Searching...
No Matches
NpRigidStatic.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_RIGID_STATIC_H
30#define NP_RIGID_STATIC_H
31
32#include "common/PxMetaData.h"
33#include "PxRigidStatic.h"
34#include "NpRigidActorTemplate.h"
35#include "ScStaticCore.h"
36
37namespace physx
38{
39typedef NpRigidActorTemplate<PxRigidStatic> NpRigidStaticT;
40
42{
43//= ATTENTION! =====================================================================================
44// Changing the data layout of this class breaks the binary serialization format. See comments for
45// PX_BINARY_SERIAL_VERSION. If a modification is required, please adjust the getBinaryMetaData
46// function. If the modification is made on a custom branch, please change PX_BINARY_SERIAL_VERSION
47// accordingly.
48//==================================================================================================
49public:
50// PX_SERIALIZATION
51 NpRigidStatic(PxBaseFlags baseFlags) : NpRigidStaticT(baseFlags), mCore(PxEmpty) {}
52 void preExportDataReset() { NpRigidStaticT::preExportDataReset(); }
53 virtual void requiresObjects(PxProcessPxBaseCallback& c);
54 static NpRigidStatic* createObject(PxU8*& address, PxDeserializationContext& context);
55 static void getBinaryMetaData(PxOutputStream& stream);
56//~PX_SERIALIZATION
57
58 NpRigidStatic(const PxTransform& pose);
59 virtual ~NpRigidStatic();
60
61 // PxActor
62 virtual void release() PX_OVERRIDE;
63 virtual PxActorType::Enum getType() const PX_OVERRIDE { return PxActorType::eRIGID_STATIC; }
64 //~PxActor
65
66 // PxRigidActor
67 virtual void setGlobalPose(const PxTransform& pose, bool wake) PX_OVERRIDE;
68
69 virtual PxTransform getGlobalPose() const PX_OVERRIDE;
70
71 //~PxRigidActor
72
73
74 // PT: I think these come from NpRigidActorTemplate
75 // PT: TODO: drop them eventually, they all re-route to NpActor now
76 virtual void switchToNoSim() PX_OVERRIDE;
77 virtual void switchFromNoSim() PX_OVERRIDE;
78
79#if PX_CHECKED
80 bool checkConstraintValidity() const;
81#endif
82
83 PX_FORCE_INLINE const Sc::StaticCore& getCore() const { return mCore; }
84 PX_FORCE_INLINE Sc::StaticCore& getCore() { return mCore; }
85
86 static PX_FORCE_INLINE size_t getCoreOffset() { return PX_OFFSET_OF_RT(NpRigidStatic, mCore); }
87 static PX_FORCE_INLINE size_t getNpShapeManagerOffset() { return PX_OFFSET_OF_RT(NpRigidStatic, mShapeManager); }
88
89#if PX_ENABLE_DEBUG_VISUALIZATION
90 void visualize(PxRenderOutput& out, NpScene& scene, float scale) const;
91#else
92 PX_CATCH_UNDEFINED_ENABLE_DEBUG_VISUALIZATION
93#endif
94
95private:
96 Sc::StaticCore mCore;
97};
98
99}
100
101#endif
Definition base.h:1940
Definition NpRigidActorTemplate.h:47
Definition NpRigidStatic.h:42
Definition NpScene.h:130
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
Definition PxRenderOutput.h:50
class representing a rigid euclidean transform as a quaternion and a vector
Definition PxTransform.h:49
Definition ScStaticCore.h:43
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_OVERRIDE
Definition PxPreprocessor.h:375
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Enum
Definition PxActor.h:121
@ eRIGID_STATIC
A static rigid body.
Definition PxActor.h:126