Torque3D Documentation / _generateds / afxEffectVector.h

afxEffectVector.h

Engine/source/afx/afxEffectVector.h

More...

Classes:

Detailed Description

 1
 2
 3//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
 4// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
 5// Copyright (C) 2015 Faust Logic, Inc.
 6//
 7// Permission is hereby granted, free of charge, to any person obtaining a copy
 8// of this software and associated documentation files (the "Software"), to
 9// deal in the Software without restriction, including without limitation the
10// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11// sell copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23// IN THE SOFTWARE.
24//
25//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
26
27#ifndef _AFX_EFFECT_VECTOR_H_
28#define _AFX_EFFECT_VECTOR_H_
29
30#include "afx/afxEffectWrapper.h"
31#include "afx/afxEffectGroup.h"
32
33//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
34// afxEffectVector
35
36class afxEffectWrapper;
37class afxChoreographer;
38
39class afxEffectVector
40{
41  Vector<afxEffectWrapper*>*  mFX_v;
42  Vector<afxEffectWrapper*>*  mFX_v2;
43
44  bool          mActive;
45  bool          mOn_server;
46  F32           mPhrase_dur;
47  F32           mTotal_fx_dur;
48  F32           mAfter_life;
49
50  void          swap_vecs();
51  void          filter_client_server();
52  void          calc_fx_dur_and_afterlife();
53
54  void          effects_init(afxChoreographer*, afxEffectList&, bool will_stop, F32 time_factor, 
55                             S32 group_index, const afxGroupTimingData* group_timing=0);
56
57public:
58  /*C*/         afxEffectVector();
59  /*D*/         ~afxEffectVector();
60
61  void          ev_init(afxChoreographer*, afxEffectList&, bool on_server, bool will_stop, 
62                        F32 time_factor, F32 phrase_dur, S32 group_index=0);
63
64  void          start(F32 timestamp);
65  void          update(F32 dt);
66  void          stop(bool force_cleanup=false);
67  void          interrupt();
68  bool          empty() { return (!mFX_v || mFX_v->empty()); }
69  bool          isActive() { return mActive; }
70  S32           count() { return (mFX_v) ? mFX_v->size() : 0; }
71
72  F32           getTotalDur() { return mTotal_fx_dur; }
73  F32           getAfterLife() { return mAfter_life; }
74
75  Vector<afxEffectWrapper*>* getFX() { return mFX_v; }
76};
77
78inline void afxEffectVector::swap_vecs()
79{
80  Vector<afxEffectWrapper*>* tmp = mFX_v;
81  mFX_v = mFX_v2;
82  mFX_v2 = tmp;
83}
84
85//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
86
87#endif // _AFX_EFFECT_VECTOR_H_
88