CEL

Public API Reference

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 enum TriggerType
00034 {
00035   TRIGGER_NONE = 0,
00036   TRIGGER_SPHERE,
00037   TRIGGER_BOX,
00038   TRIGGER_ABOVE,
00039   TRIGGER_BEAM
00040 };
00041 
00045 struct iPcTriggerListener : public virtual iBase
00046 {
00047   SCF_INTERFACE (iPcTriggerListener, 0, 0, 1);
00048 
00052   virtual void EntityEnters (iPcTrigger* trigger, iCelEntity* entity) = 0;
00053 
00057   virtual void EntityLeaves (iPcTrigger* trigger, iCelEntity* entity) = 0;
00058 
00062   virtual void EnterTrigger (iPcTrigger* trigger, iCelEntity* entity) = 0;
00063 
00067   virtual void LeaveTrigger (iPcTrigger* trigger, iCelEntity* entity) = 0;
00068 };
00069 
00112 struct iPcTrigger : public virtual iBase
00113 {
00114   SCF_INTERFACE (iPcTrigger, 0, 1, 1);
00115 
00120   virtual void AddTriggerListener (iPcTriggerListener* listener) = 0;
00124   virtual void RemoveTriggerListener (iPcTriggerListener* listener) = 0;
00125 
00129   virtual void SetupTriggerSphere (iSector* sector,
00130         const csVector3& center, float radius) = 0;
00131 
00136   virtual void SetupTriggerSphere (iSector* sector,
00137         const char* center_name, float radius) = 0;
00138 
00142   virtual void SetupTriggerBox (iSector* sector, const csBox3& box) = 0;
00143 
00147   virtual void SetupTriggerBeam (iSector* sector, const csVector3& start,
00148         const csVector3& end) = 0;
00149 
00154   virtual void SetupTriggerAboveMesh (iPcMesh* mesh, float maxdistance) = 0;
00155 
00163   virtual void MonitorEntity (const char* entityname) = 0;
00164 
00169   virtual const char* GetMonitorEntity () const = 0;
00170 
00176   virtual void MonitorClass (const char* classname) = 0;
00177 
00182   virtual const char* GetMonitorClass () const = 0;
00183 
00191   virtual void SetMonitorDelay (csTicks delay, csTicks jitter) = 0;
00192 
00198   virtual void EnableMonitorInvisible (bool en) = 0;
00199 
00206   virtual void EnableMessagesToSelf (bool en) = 0;
00207 
00214   virtual void EnableMessagesToOthers (bool en) = 0;
00215 
00219   virtual void EnableTrigger (bool en) = 0;
00220 
00224   virtual bool IsEnabled () const = 0;
00225 
00230   virtual const csWeakRefArray<iCelEntity>& GetEntitiesInTrigger () const = 0;
00231 
00236   virtual bool Check () = 0;
00237 
00239   virtual csTicks GetUpdateDelay () const = 0;
00241   virtual csTicks GetUpdateJitter () const = 0;
00243   virtual bool HasCheckingOnInvisibleEntities () const = 0;
00245   virtual bool HasFollowEntity () const = 0;
00247   virtual void SetFollowEntity (bool c) = 0;
00249   virtual bool HasStrictChecking () const = 0;
00254   virtual void SetStrictChecking (bool c) = 0;
00256   virtual TriggerType GetTriggerType () const = 0;
00257 };
00258 
00259 #endif // __CEL_PF_TRIGGER__
00260 

Generated for CEL: Crystal Entity Layer 2.0 by doxygen 1.7.6.1