RavEngine
Loading...
Searching...
No Matches
PxActor.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 PX_ACTOR_H
30#define PX_ACTOR_H
31
36#include "PxPhysXConfig.h"
37#include "foundation/PxBounds3.h"
38#include "PxClient.h"
39#include "common/PxBase.h"
40
41#if !PX_DOXYGEN
42namespace physx
43{
44#endif
45
46class PxRigidActor;
47class PxRigidBody;
48class PxRigidStatic;
49class PxRigidDynamic;
50class PxArticulationLink;
51class PxScene;
52
56typedef PxU8 PxDominanceGroup; // Must be < 32, PxU8.
57
64{
65 enum Enum
66 {
73
78
85
102 eDISABLE_SIMULATION = (1<<3)
103 };
104};
105
112PX_FLAGS_OPERATORS(PxActorFlag::Enum,PxU8)
113
114
194
200class PxActor : public PxBase
201{
202public:
212 virtual void release() = 0;
213
221 virtual PxActorType::Enum getType() const = 0;
222
230 virtual PxScene* getScene() const = 0;
231
232 // Runtime modifications
233
246 virtual void setName(const char* name) = 0;
247
255 virtual const char* getName() const = 0;
256
269 virtual PxBounds3 getWorldBounds(float inflation=1.01f) const = 0;
270
283 virtual void setActorFlag(PxActorFlag::Enum flag, bool value) = 0;
284
291 virtual void setActorFlags( PxActorFlags inFlags ) = 0;
292
302 virtual PxActorFlags getActorFlags() const = 0;
303
320 virtual void setDominanceGroup(PxDominanceGroup dominanceGroup) = 0;
321
330
331
341 virtual void setOwnerClient( PxClientID inClient ) = 0;
342
350 virtual PxClientID getOwnerClient() const = 0;
351
359 virtual PxAggregate* getAggregate() const = 0;
360
361 //public variables:
362 void* userData;
363
364protected:
365 PX_INLINE PxActor(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags), userData(NULL) {}
366 PX_INLINE PxActor(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
367 virtual ~PxActor() {}
368 virtual bool isKindOf(const char* name) const { return !::strcmp("PxActor", name) || PxBase::isKindOf(name); }
369
370
371};
372
373#if !PX_DOXYGEN
374} // namespace physx
375#endif
376
378#endif
PxActor is the base class for the main simulation objects in the physics SDK.
Definition PxActor.h:201
virtual PxScene * getScene() const =0
Retrieves the scene which this actor belongs to.
virtual PxClientID getOwnerClient() const =0
Returns the owner client that was specified at creation time.
virtual void setOwnerClient(PxClientID inClient)=0
Sets the owner client of an actor.
virtual PxAggregate * getAggregate() const =0
Retrieves the aggregate the actor might be a part of.
virtual void setDominanceGroup(PxDominanceGroup dominanceGroup)=0
Assigns dynamic actors a dominance group identifier.
virtual PxDominanceGroup getDominanceGroup() const =0
Retrieves the value set with setDominanceGroup().
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition PxActor.h:368
virtual PxActorFlags getActorFlags() const =0
Reads the PxActor flags.
virtual void setActorFlag(PxActorFlag::Enum flag, bool value)=0
Raises or clears a particular actor flag.
virtual void release()=0
Deletes the actor.
void * userData
user can assign this to whatever, usually to create a 1:1 relationship with a user object.
Definition PxActor.h:362
virtual void setActorFlags(PxActorFlags inFlags)=0
Sets the actor flags.
virtual const char * getName() const =0
Retrieves the name string set with setName().
virtual void setName(const char *name)=0
Sets a name string for the object that can be retrieved with getName().
virtual PxBounds3 getWorldBounds(float inflation=1.01f) const =0
Retrieves the axis aligned bounding box enclosing the actor.
virtual PxActorType::Enum getType() const =0
Retrieves the type of actor.
Class to aggregate actors into a single broad-phase entry.
Definition PxAggregate.h:98
Base class for objects that can be members of a PxCollection.
Definition PxBase.h:73
virtual bool isKindOf(const char *superClass) const
Returns whether a given type name matches with the type of this instance.
Definition PxBase.h:179
Class representing 3D range or axis aligned bounding box.
Definition PxBounds3.h:58
Container for bitfield flag variables associated with a specific enum type.
Definition PxFlags.h:73
A scene is a collection of bodies and constraints which can interact.
Definition PxScene.h:178
#define PX_INLINE
Definition PxPreprocessor.h:320
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PxU8 PxClientID
An ID to identify different clients for multiclient support.
Definition PxClient.h:44
PxU8 PxDominanceGroup
Group index which allows to specify 1- or 2-way interaction.
Definition PxActor.h:56
PxFlags< PxActorFlag::Enum, PxU8 > PxActorFlags
collection of set bits defined in PxActorFlag.
Definition PxActor.h:111
Flags which control the behavior of an actor.
Definition PxActor.h:64
Enum
Definition PxActor.h:66
@ eDISABLE_SIMULATION
Disables simulation for the actor.
Definition PxActor.h:102
@ eSEND_SLEEP_NOTIFIES
Enables the sending of PxSimulationEventCallback::onWake() and PxSimulationEventCallback::onSleep() n...
Definition PxActor.h:84
@ eDISABLE_GRAVITY
Disables scene gravity for this actor.
Definition PxActor.h:77
@ eVISUALIZATION
Enable debug renderer for this actor.
Definition PxActor.h:72
Identifies each type of actor.
Definition PxActor.h:119
Enum
Definition PxActor.h:121
@ eACTOR_COUNT
internal use only!
Definition PxActor.h:188
@ eCUSTOM_PARTICLESYSTEM
A CUSTOM ParticleSystem.
Definition PxActor.h:178
@ eARTICULATION_LINK
An articulation link.
Definition PxActor.h:138
@ eFLIP_PARTICLESYSTEM
A FLIP ParticleSystem.
Definition PxActor.h:164
@ eFEMCLOTH
A FEM-based cloth.
Definition PxActor.h:151
@ eSOFTBODY
A FEM-based soft body.
Definition PxActor.h:144
@ eHAIRSYSTEM
A HairSystem.
Definition PxActor.h:185
@ ePBD_PARTICLESYSTEM
A PBD ParticleSystem.
Definition PxActor.h:157
@ eMPM_PARTICLESYSTEM
A MPM ParticleSystem.
Definition PxActor.h:171
@ eRIGID_STATIC
A static rigid body.
Definition PxActor.h:126
@ eRIGID_DYNAMIC
A dynamic rigid body.
Definition PxActor.h:132