29#ifndef NP_ACTOR_TEMPLATE_H
30#define NP_ACTOR_TEMPLATE_H
36#include "omnipvd/OmniPvdPxSampler.h"
52template<
class APIClass>
77 virtual void release() = 0;
82 virtual PxBounds3 getWorldBounds(
float inflation=1.01f)
const = 0;
100template<
class APIClass>
102 APIClass(concreteType, baseFlags),
105 PX_ASSERT(!APIClass::userData);
108template<
class APIClass>
109NpActorTemplate<APIClass>::~NpActorTemplate()
111 NpActor::onActorRelease(
this);
116template<
class APIClass>
117PxScene* NpActorTemplate<APIClass>::getScene()
const
124template<
class APIClass>
125void NpActorTemplate<APIClass>::setName(
const char* debugName)
127 NP_WRITE_CHECK(getNpScene());
129 PX_CHECK_SCENE_API_WRITE_FORBIDDEN_EXCEPT_SPLIT_SIM(getNpScene(),
"PxActor::setName() not allowed while simulation is running. Call will be ignored.")
133#if PX_SUPPORT_OMNI_PVD
135 streamActorName(a, mName);
140 NpScene* npScene = getNpScene();
143 npScene->getScenePvdClientInternal().updatePvdProperties(
static_cast<NpActor*
>(
this));
147template<
class APIClass>
148const char* NpActorTemplate<APIClass>::getName()
const
150 NP_READ_CHECK(getNpScene());
156template<
class APIClass>
157void NpActorTemplate<APIClass>::setDominanceGroup(
PxDominanceGroup dominanceGroup)
159 NpScene* npScene = getNpScene();
160 NP_WRITE_CHECK(npScene);
162 PX_CHECK_SCENE_API_WRITE_FORBIDDEN(npScene,
"PxActor::setDominanceGroup() not allowed while simulation is running. Call will be ignored.")
164 NpActor::scSetDominanceGroup(dominanceGroup);
167template<class APIClass>
170 NP_READ_CHECK(getNpScene());
171 return NpActor::getDominanceGroup();
176template<
class APIClass>
177void NpActorTemplate<APIClass>::setOwnerClient(
PxClientID inId )
179 if ( getNpScene() != NULL )
182 "Attempt to set the client id when an actor is already in a scene.");
185 NpActor::scSetOwnerClient( inId );
188template<
class APIClass>
189PxClientID NpActorTemplate<APIClass>::getOwnerClient()
const
191 return NpActor::getOwnerClient();
196template<
class APIClass>
201 a.scSetActorFlags( a.getActorFlags() | flag );
203 a.scSetActorFlags( a.getActorFlags() & (~
PxActorFlags(flag)) );
206template<
class APIClass>
209 NpActor::scSetActorFlags(inFlags);
212template<
class APIClass>
215 NpScene* npScene = getNpScene();
216 NP_WRITE_CHECK(npScene);
218 PX_CHECK_SCENE_API_WRITE_FORBIDDEN(npScene,
"PxActor::setActorFlag() not allowed while simulation is running. Call will be ignored.")
220 setActorFlagInternal(flag, value);
223template<class APIClass>
224void NpActorTemplate<APIClass>::setActorFlags(
PxActorFlags inFlags)
226 NpScene* npScene = getNpScene();
227 NP_WRITE_CHECK(npScene);
229 PX_CHECK_SCENE_API_WRITE_FORBIDDEN(npScene,
"PxActor::setActorFlags() not allowed while simulation is running. Call will be ignored.")
231 setActorFlagsInternal(inFlags);
234template<class APIClass>
235PxActorFlags NpActorTemplate<APIClass>::getActorFlags()
const
237 NP_READ_CHECK(getNpScene());
238 return NpActor::getActorFlags();
Definition NpActorTemplate.h:54
Class to aggregate actors into a single broad-phase entry.
Definition PxAggregate.h:98
Class representing 3D range or axis aligned bounding box.
Definition PxBounds3.h:58
Binary deserialization context class.
Definition PxSerialFramework.h:174
A scene is a collection of bodies and constraints which can interact.
Definition PxScene.h:178
Binary serialization context class.
Definition PxSerialFramework.h:99
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_OVERRIDE
Definition PxPreprocessor.h:375
PX_C_EXPORT PX_FOUNDATION_API physx::PxFoundation &PX_CALL_CONV PxGetFoundation()
Retrieves the Foundation SDK after it has been created.
Definition FdFoundation.cpp:279
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
Enum
Definition PxActor.h:66
Enum
Definition PxActor.h:121
@ eINVALID_OPERATION
method was called at a time when an operation is not possible
Definition PxErrors.h:65