## Public API Reference

- Main Page
- Classes
- Files

# propclass/trigger.h

    00001 /*
    00002     Crystal Space Entity Layer
    00003     Copyright (C) 2004 by Jorrit Tyberghein
    00004
    00005     This library is free software; you can redistribute it and/or
    00006     modify it under the terms of the GNU Library General Public
    00007     License as published by the Free Software Foundation; either
    00008     version 2 of the License, or (at your option) any later version.
    00009
    00010     This library is distributed in the hope that it will be useful,
    00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013     Library General Public License for more details.
    00014
    00015     You should have received a copy of the GNU Library General Public
    00016     License along with this library; if not, write to the Free
    00017     Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00018 */
    00019
    00020 #ifndef __CEL_PF_TRIGGER__
    00021 #define __CEL_PF_TRIGGER__
    00022
    00023 #include "cstypes.h"
    00024 #include "csgeom/vector3.h"
    00025 #include "csgeom/box.h"
    00026 #include "csutil/scf.h"
    00027 #include "csutil/weakrefarr.h"
    00028
    00029 struct iCelEntity;
    00030 struct iPcTrigger;
    00031 struct iPcMesh;
    00032
    00033 SCF_VERSION (iPcTriggerListener, 0, 0, 1);
    00034
    00038 struct iPcTriggerListener : public iBase
    00039 {
    00043   virtual void EntityEnters (iPcTrigger* trigger, iCelEntity* entity) = 0;
    00044
    00048   virtual void EntityLeaves (iPcTrigger* trigger, iCelEntity* entity) = 0;
    00049
    00053   virtual void EnterTrigger (iPcTrigger* trigger, iCelEntity* entity) = 0;
    00054
    00058   virtual void LeaveTrigger (iPcTrigger* trigger, iCelEntity* entity) = 0;
    00059 };
    00060
    00061 SCF_VERSION (iPcTrigger, 0, 1, 0);
    00062
    00100 struct iPcTrigger : public iBase
    00101 {
    00106   virtual void AddTriggerListener (iPcTriggerListener* listener) = 0;
    00110   virtual void RemoveTriggerListener (iPcTriggerListener* listener) = 0;
    00111
    00115   virtual void SetupTriggerSphere (iSector* sector,
    00116         const csVector3& center, float radius) = 0;
    00117
    00122   virtual void SetupTriggerSphere (iSector* sector,
    00123         const char* center_name, float radius) = 0;
    00124
    00128   virtual void SetupTriggerBox (iSector* sector, const csBox3& box) = 0;
    00129
    00134   virtual void SetupTriggerAboveMesh (iPcMesh* mesh, float maxdistance) = 0;
    00135
    00143   virtual void MonitorEntity (const char* entityname) = 0;
    00144
    00149   virtual const char* GetMonitorEntity () const = 0;
    00150
    00158   virtual void SetMonitorDelay (csTicks delay, csTicks jitter) = 0;
    00159
    00166   virtual void EnableMessagesToSelf (bool en) = 0;
    00167
    00174   virtual void EnableMessagesToOthers (bool en) = 0;
    00175
    00179   virtual void EnableTrigger (bool en) = 0;
    00180
    00184   virtual bool IsEnabled () const = 0;
    00185
    00190   virtual const csWeakRefArray<iCelEntity>& GetEntitiesInTrigger () const = 0;
    00191
    00196   virtual bool Check () = 0;
    00197 };
    00198
    00199 #endif // __CEL_PF_TRIGGER__
    00200