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