triggerComponent.h
Engine/source/T3D/components/game/triggerComponent.h
Classes:
class
Detailed Description
1 2//----------------------------------------------------------------------------- 3// Torque Game Engine 4// Copyright (C) GarageGames.com, Inc. 5//----------------------------------------------------------------------------- 6#ifndef _TRIGGER_COMPONENT_H_ 7#define _TRIGGER_COMPONENT_H_ 8 9#ifndef _COMPONENT_H_ 10#include "T3D/components/component.h" 11#endif 12 13#ifndef _ENTITY_H_ 14#include "T3D/entity.h" 15#endif 16 17#ifndef _COLLISION_INTERFACES_H_ 18#include "T3D/components/collision/collisionInterfaces.h" 19#endif 20 21////////////////////////////////////////////////////////////////////////// 22/// 23/// 24////////////////////////////////////////////////////////////////////////// 25class TriggerComponent : public Component 26{ 27 typedef Component Parent; 28 29protected: 30 Vector<SceneObject*> mObjectList; 31 32 bool mVisible; 33 34 String mEnterCommand; 35 String mOnExitCommand; 36 String mOnUpdateInViewCmd; 37 38public: 39 TriggerComponent(); 40 virtual ~TriggerComponent(); 41 DECLARE_CONOBJECT(TriggerComponent); 42 43 virtual bool onAdd(); 44 virtual void onRemove(); 45 static void initPersistFields(); 46 47 virtual void onComponentAdd(); 48 virtual void onComponentRemove(); 49 50 virtual void componentAddedToOwner(Component *comp); 51 virtual void componentRemovedFromOwner(Component *comp); 52 53 virtual U32 packUpdate(NetConnection *con, U32 mask, BitStream *stream); 54 virtual void unpackUpdate(NetConnection *con, BitStream *stream); 55 56 void potentialEnterObject(SceneObject *collider); 57 58 bool testObject(SceneObject* enter); 59 60 virtual void processTick(); 61 62 GameConnection* getConnection(S32 connectionID); 63 64 void addClient(S32 clientID); 65 void removeClient(S32 clientID); 66 67 void visualizeFrustums(F32 renderTimeMS); 68 69 DECLARE_CALLBACK(void, onEnterViewCmd, (Entity* cameraEnt, bool firstTimeSeeing)); 70 DECLARE_CALLBACK(void, onExitViewCmd, (Entity* cameraEnt)); 71 DECLARE_CALLBACK(void, onUpdateInViewCmd, (Entity* cameraEnt)); 72 DECLARE_CALLBACK(void, onUpdateOutOfViewCmd, (Entity* cameraEnt)); 73}; 74 75#endif // _EXAMPLEBEHAVIOR_H_ 76
