Torque3D/Engine/source/afx/ce/afxZodiacPlane.h
AzaezelX fbcfe02098 clean up "Add" menubar categoes on the 3d object side via the following:
SceneObject now defaults to a category of "misc"
getCategoryOfClass now checks parent classes for what categories they hold so that variants can inherit
categories are in one of a few rough groups and subgroups depending on actual mapper needs/usages
2023-11-08 20:42:47 -06:00

150 lines
4.6 KiB
C++

//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
// 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
};
void onImageChanged() {}
public:
DECLARE_IMAGEASSET(afxZodiacPlaneData, Texture, onImageChanged, AFX_GFXZodiacTextureProfile);
DECLARE_ASSET_SETGET(afxZodiacPlaneData, Texture);
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);
virtual void packData(BitStream*);
virtual void unpackData(BitStream*);
bool preload(bool server, String &errorStr);
virtual bool allowSubstitutions() const { 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();
virtual bool onNewDataBlock(GameBaseData* dptr, bool reload);
virtual bool onAdd();
virtual void onRemove();
void setRadius(F32 rad) { radius = rad; }
void setColor(const LinearColorF& clr) { color = clr; }
void setVisibility(bool flag) { is_visible = flag; }
virtual void prepRenderImage(SceneRenderState*);
void _renderZodiacPlane(ObjectRenderInst*, SceneRenderState*, BaseMatInstance*);
DECLARE_CONOBJECT(afxZodiacPlane);
DECLARE_CATEGORY("UNLISTED");
};
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
#endif // _AFX_ZODIAC_PLANE_H_