| 49 | // An interaction is implicitly active if at least one of the two actors it connects is active. |
| 50 | |
| 51 | class Interaction : public Ps::UserAllocated |
| 52 | { |
| 53 | PX_NOCOPY(Interaction) |
| 54 | |
| 55 | protected: |
| 56 | Interaction(ActorSim& actor0, ActorSim& actor1, InteractionType::Enum interactionType, PxU8 flags); |
| 57 | ~Interaction() { PX_ASSERT(!readInteractionFlag(InteractionFlag::eIN_DIRTY_LIST)); } |
| 58 | |
| 59 | public: |
| 60 | // Interactions automatically register themselves in the actors here |
| 61 | PX_FORCE_INLINE bool registerInActors(void* data = NULL); |
| 62 | |
| 63 | // Interactions automatically unregister themselves from the actors here |
| 64 | PX_FORCE_INLINE void unregisterFromActors(); |
| 65 | |
| 66 | PX_FORCE_INLINE ActorSim& getActorSim0() const { return mActor0; } |
| 67 | PX_FORCE_INLINE ActorSim& getActorSim1() const { return mActor1; } |
| 68 | |
| 69 | PX_FORCE_INLINE Scene& getScene() const { return mActor0.getScene(); } |
| 70 | |
| 71 | PX_FORCE_INLINE InteractionType::Enum getType() const { return InteractionType::Enum(mInteractionType); } |
| 72 | |
| 73 | PX_FORCE_INLINE PxU8 readInteractionFlag(PxU8 flag) const { return PxU8(mInteractionFlags & flag); } |
| 74 | PX_FORCE_INLINE void raiseInteractionFlag(InteractionFlag::Enum flag) { mInteractionFlags |= flag; } |