123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
- // Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
- // Copyright (C) 2015 Faust Logic, Inc.
- //
- // Permission is hereby granted, free of charge, to any person obtaining a copy
- // of this software and associated documentation files (the "Software"), to
- // deal in the Software without restriction, including without limitation the
- // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- // sell copies of the Software, and to permit persons to whom the Software is
- // furnished to do so, subject to the following conditions:
- //
- // The above copyright notice and this permission notice shall be included in
- // all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- // IN THE SOFTWARE.
- //
- //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
- #ifndef _AFX_ZODIAC_PLANE_H_
- #define _AFX_ZODIAC_PLANE_H_
- #include "afx/ce/afxZodiacDefs.h"
- #ifndef _AFX_ZODIAC_H_
- #include "afx/ce/afxZodiac.h"
- #endif
- class afxZodiacPlaneData : public GameBaseData, public afxZodiacDefs
- {
- typedef GameBaseData Parent;
- public:
- enum BlendType
- {
- BLEND_NORMAL = 0x0,
- BLEND_ADDITIVE = 0x1,
- BLEND_SUBTRACTIVE = 0x2,
- BLEND_RESERVED = 0x3,
- BLEND_MASK = 0x3
- };
- enum FacingType
- {
- FACES_UP = 0,
- FACES_DOWN,
- FACES_FORWARD,
- FACES_BACK,
- FACES_RIGHT,
- FACES_LEFT,
- FACES_BITS = 3
- };
- public:
- DECLARE_IMAGEASSET(afxZodiacPlaneData, Texture, AFX_GFXZodiacTextureProfile)
- F32 radius_xy;
- F32 start_ang;
- F32 ang_per_sec;
- F32 grow_in_time;
- F32 shrink_out_time;
- F32 growth_rate;
- LinearColorF color;
- U32 blend_flags;
- bool respect_ori_cons;
- bool use_full_xfm;
- U32 zflags;
- U32 face_dir;
- bool double_sided;
- void expand_zflags();
- void merge_zflags();
- public:
- /*C*/ afxZodiacPlaneData();
- /*C*/ afxZodiacPlaneData(const afxZodiacPlaneData&, bool = false);
- void packData(BitStream*) override;
- void unpackData(BitStream*) override;
- bool preload(bool server, String &errorStr) override;
- bool allowSubstitutions() const override { return true; }
- F32 calcRotationAngle(F32 elapsed, F32 rate_factor=1.0f);
- static void initPersistFields();
- DECLARE_CONOBJECT(afxZodiacPlaneData);
- };
- typedef afxZodiacPlaneData::BlendType afxZodiacPlane_BlendType;
- DefineEnumType( afxZodiacPlane_BlendType );
- typedef afxZodiacPlaneData::FacingType afxZodiacPlane_FacingType;
- DefineEnumType( afxZodiacPlane_FacingType );
- //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
- // afxZodiacPlane
- class afxZodiacPlane : public GameBase, public afxZodiacDefs
- {
- typedef GameBase Parent;
- private:
- afxZodiacPlaneData* mDataBlock;
- LinearColorF color;
- F32 radius;
- bool is_visible;
- void preDraw();
- void draw();
- void postDraw();
- GFXStateBlockRef normal_sb;
- GFXStateBlockRef reflected_sb;
- public:
- /*C*/ afxZodiacPlane();
- /*D*/ ~afxZodiacPlane();
- bool onNewDataBlock(GameBaseData* dptr, bool reload) override;
- bool onAdd() override;
- void onRemove() override;
- void setRadius(F32 rad) { radius = rad; }
- void setColor(const LinearColorF& clr) { color = clr; }
- void setVisibility(bool flag) { is_visible = flag; }
- void prepRenderImage(SceneRenderState*) override;
-
- void _renderZodiacPlane(ObjectRenderInst*, SceneRenderState*, BaseMatInstance*);
- DECLARE_CONOBJECT(afxZodiacPlane);
- DECLARE_CATEGORY("UNLISTED");
- };
- //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
- #endif // _AFX_ZODIAC_PLANE_H_
|