00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef _CALERT_H
00010 #define _CALERT_H
00011
00012 #include "cObject.h"
00013 #include "cParticle.h"
00014
00015 #include <string>
00016 #include <hash_set>
00017 #include <set>
00018
00040 class cAlert : public cObject {
00041 public:
00042 struct rShape {
00043
00044 enum Shapes {
00045 CYLINDER, BOX, SPHERE, MAX_SHAPES
00046 };
00047 int type;
00048 float center[3];
00049 float range[3];
00050 };
00051 private:
00052 rShape shape;
00053 std::string message;
00054 OID group;
00055 std::set<OID> intruders;
00057 bool positive;
00059 bool posedge;
00061 bool once;
00063 bool fired;
00065 OID fusedelay;
00067 std::set<OID> sensitivity;
00068 public:
00069
00070 cAlert(float* center, float* range, int shapetype, std::string message, OID group, bool positive = true, bool posedge = true, bool once = false, OID fusedelay = 0);
00071
00072 virtual float constrainParticle(float* worldpos, float radius = 0.0f, float* localpos = NULL, cObject* enactor = NULL);
00073 virtual void drawEffect();
00074 };
00075
00076 #endif
00077