afxPhrase.h

Engine/source/afx/afxPhrase.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_PHRASE_H_
28#define _AFX_PHRASE_H_
29
30#include "afxEffectVector.h"
31
32//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
33// afxPhrase
34
35class afxChoreographer;
36class afxConstraintMgr;
37class afxEffectVector;
38
39class afxPhrase
40{
41protected:
42  afxEffectList*    mInit_fx_list;
43  F32               mInit_dur;
44  afxChoreographer* mInit_chor;
45  F32               mInit_time_factor;
46  F32               mExtra_time;
47
48  afxEffectVector*  mFX;
49  afxEffectVector*  mFX2;
50
51  bool              mOn_server;
52  bool              mWill_stop;
53
54  F32               mStartTime;
55  F32               mDur;
56  S32               mNum_loops;
57  S32               mLoop_cnt;
58  F32               mExtra_stoptime;
59
60  void              init_fx(S32 group_index=0);
61
62public:
63  /*C*/             afxPhrase(bool on_server, bool will_stop);
64  virtual           ~afxPhrase();
65
66  virtual void      init(afxEffectList&, F32 dur, afxChoreographer*, F32 time_factor, 
67                         S32 n_loops, S32 group_index=0, F32 extra_time=0.0f);
68
69  virtual void      start(F32 startstamp, F32 timestamp);
70  virtual void      update(F32 dt, F32 timestamp);
71  virtual void      stop(F32 timestamp);
72  virtual void      interrupt(F32 timestamp);
73  virtual bool      expired(F32 timestamp);
74  virtual bool      recycle(F32 timestamp);
75  virtual F32       elapsed(F32 timestamp);
76
77  bool              isEmpty() { return mFX->empty(); }
78  bool              isInfinite() { return (mInit_dur < 0); }
79  F32               calcDoneTime();
80  F32               calcAfterLife();
81  bool              willStop() { return mWill_stop; }
82  bool              onServer() { return mOn_server; }
83  S32               count() { return mFX->count(); }
84};
85
86//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
87
88#endif // _AFX_PHRASE_H_
89