ribbonNode.h

Engine/source/T3D/fx/ribbonNode.h

More...

Classes:

Detailed Description

  1
  2//-----------------------------------------------------------------------------
  3// Copyright (c) 2014 GarageGames, LLC
  4//
  5// Permission is hereby granted, free of charge, to any person obtaining a copy
  6// of this software and associated documentation files (the "Software"), to
  7// deal in the Software without restriction, including without limitation the
  8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9// sell copies of the Software, and to permit persons to whom the Software is
 10// furnished to do so, subject to the following conditions:
 11//
 12// The above copyright notice and this permission notice shall be included in
 13// all copies or substantial portions of the Software.
 14//
 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 21// IN THE SOFTWARE.
 22//-----------------------------------------------------------------------------
 23
 24#ifndef _RIBBON_NODE_H_
 25#define _RIBBON_NODE_H_
 26
 27#ifndef _GAMEBASE_H_
 28#include "T3D/gameBase/gameBase.h"
 29#endif
 30
 31class RibbonData;
 32class Ribbon;
 33
 34//*****************************************************************************
 35// ParticleEmitterNodeData
 36//*****************************************************************************
 37class RibbonNodeData : public GameBaseData
 38{
 39   typedef GameBaseData Parent;
 40
 41public:
 42   RibbonNodeData();
 43   ~RibbonNodeData();
 44
 45   DECLARE_CONOBJECT(RibbonNodeData);
 46   static void initPersistFields();
 47};
 48
 49
 50//*****************************************************************************
 51// ParticleEmitterNode
 52//*****************************************************************************
 53class RibbonNode : public GameBase
 54{
 55   typedef GameBase Parent;
 56
 57   enum MaskBits
 58   {
 59      StateMask      = Parent::NextFreeMask << 0,
 60      EmitterDBMask  = Parent::NextFreeMask << 1,
 61      NextFreeMask   = Parent::NextFreeMask << 2,
 62   };
 63
 64   RibbonNodeData* mDataBlock;
 65
 66protected:
 67   bool onAdd();
 68   void onRemove();
 69   bool onNewDataBlock( GameBaseData *dptr, bool reload );
 70   void inspectPostApply();
 71
 72   RibbonData* mRibbonDatablock;
 73   S32 mRibbonDatablockId;
 74
 75   SimObjectPtr<Ribbon> mRibbon;
 76
 77   bool mActive;
 78
 79public:
 80   RibbonNode();
 81   ~RibbonNode();
 82
 83   Ribbon *getRibbonEmitter() {return mRibbon;}
 84
 85   // Time/Move Management
 86
 87   void processTick(const Move* move);
 88   void advanceTime(F32 dt);
 89
 90   DECLARE_CONOBJECT(RibbonNode);
 91   static void initPersistFields();
 92
 93   U32  packUpdate  (NetConnection *conn, U32 mask, BitStream* stream);
 94   void unpackUpdate(NetConnection *conn,           BitStream* stream);
 95
 96   inline bool getActive( void )        { return mActive;                             };
 97   inline void setActive( bool active ) { mActive = active; setMaskBits( StateMask ); };
 98
 99   void setRibbonDatablock(RibbonData* data);
100};
101
102#endif // _RIBBON_NODE_H_
103
104