//GFXNET - [2020-04-13 11:57:47]
#ifndef _GFXNET_H_
#define _GFXNET_H_

#include "CFTTVector32.h"
#include "AABB.h"
#include "CrowdSortB.h"
#include "CModelManager.h"

/*
001B14A4 GFXNET::Init()
001B1664 GFXNET::mInit()
001B1750 GFXNET::cInit()
001B1864 GFXNET::Shutdown()
001B19DC GFXNET::AABBTreeShutdown(AABB *)
001B1A0A GFXNET::mShutdown()
001B1A5C GFXNET::Render(bool)
001B1AAC GFXNET::mRender(bool)
001B1C80 GFXNET::Reset()
001B1CA8 GFXNET::mReset()
001B1D48 GFXNET::Update(float)
001B1D88 GFXNET::mUpdate(float)
001B24DC GFXNET::IsInControl()
001B24EC GFXNET::IsFirstControl()
001B24FC GFXNET::GetV(int,int,int)
001B2534 GFXNET::GetP(int,int,int)
001B2558 GFXNET::GetMinMax(CFTTVector32 &,CFTTVector32 &,GFXNETTri *)
001B26A8 GFXNET::GetMinMax2(CFTTVector32 &,CFTTVector32 &,GFXNETTri *)
001B2718 GFXNET::CreateAABB(ushort)
001B2734 GFXNET::CreateAABB(GFXNETTri const*)
001B2DE0 GFXNET::AlreadyExists(GFXNETConstraint const&)
001B2E6C GFXNET::AlreadyExists(CFTTVector32 const&)
001B2EA4 GFXNET::CreateVertex(CFTTVector32 const&)
001B2F28 GFXNET::CommonInit()
001B3124 GFXNET::InitParticles()
001B38DC GFXNET::PinParticles()
001B3A44 GFXNET::InitConstraints()
001B3FB0 GFXNET::InitTris()
001B4294 GFXNET::Build(ushort *,int)
001B4558 GFXNET::Refit()
001B4568 GFXNET::Refit(AABB *)
001B469C GFXNET::Traverse(AABB const*,AABB const&)
001B47F8 GFXNET::cTriSphere(CFTTVector32 const&,CFTTVector32 const&,int,int,int,float)
001B4D50 GFXNET::TriSphere(CFTTVector32 const&,CFTTVector32 const&,int,int,int)
001B4FE0 GFXNET::EdgeSphere(CFTTVector32 const&,int,int)
001B50D8 GFXNET::VertSphere(CFTTVector32 const&,int)
001B5180 GFXNET::ApplyForces(float)
001B51A8 GFXNET::PredictPosition(float)
001B51D0 GFXNET::DistanceConstrain(float)
001B51F8 GFXNET::InternalConstrain(float,float,float)
001B5238 GFXNET::GroundConstrain()
001B525C GFXNET::RecalculateVelocity(float)
001B5284 GFXNET::cTriSphere(CFTTVector32 const&,CFTTVector32 const&,float)
001B52E0 GFXNET::TriSphere(CFTTVector32 const&,CFTTVector32 const&)
001B5394 GFXNET::PVCollisionConstrain(CFTTVector32 &,CFTTVector32 &)
001B5478 GFXNET::PCollisionConstrain(CFTTVector32 &)
001B5548 GFXNET::CopyPosition()
001B5570 GFXNET::PredictPosition(float,int)
001B55BC GFXNET::ApplyForces(float,int)
001B566C GFXNET::CopyPosition(int)
001B56B4 GFXNET::RecalculateVelocity(float,int)
001B570C GFXNET::VVCollisionConstrain(int,CFTTVector32 &)
001B57E8 GFXNET::VECollisionConstrain(int,CFTTVector32 &)
001B596C GFXNET::VTCollisionConstrain(int,CFTTVector32 &)
001B5B78 GFXNET::FTCollisionConstrain(int,CFTTVector32 &,CFTTVector32 &,bool)
001B5EEC GFXNET::TCollisionConstrain(int,CFTTVector32 &,float)
001B61B0 GFXNET::ECollisionConstrain(int,CFTTVector32 &,float)
001B6404 GFXNET::VCollisionConstrain(int,CFTTVector32 &,float)
001B6560 GFXNET::DistanceConstrain(int,float)
001B664C GFXNET::GroundConstrain(int)
001B6690 GFXNET::InternalConstrain(int,float,float,float)

*/

struct GFXNETTri {
  int un_0;
};

struct GFXNETConstraint {
  float f_0;
  ushort us_4;
  ushort us_6;
};

class CGFXSHADOWStaticShadow;

class GFXNET {
public:
  static void Init();                                                                 //001B14A4
  static void mInit();                                                                //001B1664
  void cInit();                                                                       //001B1750
  static void Shutdown();                                                             //001B1864
  void AABBTreeShutdown(AABB *);                                                      //001B19DC
  void mShutdown();                                                                   //001B1A0A
  static void Render(bool);                                                           //001B1A5C
  void mRender(bool);                                                                 //001B1AAC
  static void Reset();                                                                //001B1C80
  void mReset();                                                                      //001B1CA8
  static void Update(float);                                                          //001B1D48
  void mUpdate(float);                                                                //001B1D88
  static bool IsInControl();                                                                 //001B24DC
  static bool IsFirstControl();                                                              //001B24EC
  short GetV(int, int, int);                                                          //001B24FC
  short GetP(int, int, int);                                                          //001B2534
  void GetMinMax(CFTTVector32 &, CFTTVector32 &, GFXNETTri *);                        //001B2558
  void GetMinMax2(CFTTVector32 &, CFTTVector32 &, GFXNETTri *);                       //001B26A8
  AABB CreateAABB(ushort);                                                            //001B2718
  AABB CreateAABB(GFXNETTri const *);                                                 //001B2734
  bool AlreadyExists(GFXNETConstraint const &);                                       //001B2DE0
  ushort AlreadyExists(CFTTVector32 const &);                                         //001B2E6C
  void CreateVertex(CFTTVector32 const &);                                            //001B2EA4
  void CommonInit();                                                                  //001B2F28
  void InitParticles();                                                               //001B3124
  void PinParticles();                                                                //001B38DC
  void InitConstraints();                                                             //001B3A44
  void InitTris();                                                                    //001B3FB0
  void Build(ushort *, int);                                                          //001B4294
  void Refit();                                                                       //001B4558
  void Refit(AABB *);                                                                 //001B4568
  void Traverse(AABB const *, AABB const &);                                          //001B469C
  void cTriSphere(CFTTVector32 const &, CFTTVector32 const &, int, int, int, float);  //001B47F8
  void TriSphere(CFTTVector32 const &, CFTTVector32 const &, int, int, int);          //001B4D50
  void EdgeSphere(CFTTVector32 const &, int, int);                                    //001B4FE0
  void VertSphere(CFTTVector32 const &, int);                                         //001B50D8
  void ApplyForces(float);                                                            //001B5180
  void PredictPosition(float);                                                        //001B51A8
  void DistanceConstrain(float);                                                      //001B51D0
  void InternalConstrain(float, float, float);                                        //001B51F8
  void GroundConstrain();                                                             //001B5238
  void RecalculateVelocity(float);                                                    //001B525C
  void cTriSphere(CFTTVector32 const &, CFTTVector32 const &, float);                 //001B5284
  void TriSphere(CFTTVector32 const &, CFTTVector32 const &);                         //001B52E0
  void PVCollisionConstrain(CFTTVector32 &, CFTTVector32 &);                          //001B5394
  void PCollisionConstrain(CFTTVector32 &);                                           //001B5478
  void CopyPosition();                                                                //001B5548
  void PredictPosition(float, int);                                                   //001B5570
  void ApplyForces(float, int);                                                       //001B55BC
  void CopyPosition(int);                                                             //001B566C
  void RecalculateVelocity(float, int);                                               //001B56B4
  void VVCollisionConstrain(int, CFTTVector32 &);                                     //001B570C
  void VECollisionConstrain(int, CFTTVector32 &);                                     //001B57E8
  void VTCollisionConstrain(int, CFTTVector32 &);                                     //001B596C
  void FTCollisionConstrain(int, CFTTVector32 &, CFTTVector32 &, bool);               //001B5B78
  void TCollisionConstrain(int, CFTTVector32 &, float);                               //001B5EEC
  void ECollisionConstrain(int, CFTTVector32 &, float);                               //001B61B0
  void VCollisionConstrain(int, CFTTVector32 &, float);                               //001B6404
  void DistanceConstrain(int, float);                                                 //001B6560
  void GroundConstrain(int);                                                          //001B664C
  void InternalConstrain(int, float, float, float);                                   //001B6690


	CFTTVector32 * m_vec_ptr_0;
	CFTTVector32 * m_vec_ptr_4;
	CFTTVector32 * m_vec_ptr_8;
	float *m_float_ptr_C;
	bool b_10;
	bool b_11;
	bool b_12;
	bool b_13;
	int m_i_1_14;
	int* m_i_ptr_18;
	int* m_i_ptr_1C;
	int* m_i_ptr_20;
	char padding2[4];
	int* m_i_ptr_28;
	int m_i_2C;
	GFXNET* m_GFXNET_ptr_1_30;
	GFXNET* m_GFXNET_ptr_2_34;
	float m_float_1_38;
	float m_float_2_3C;
	float m_float_3_40;
	float m_float_4_44;
	float m_float_5_48;
	float m_float_6_4C;
	float m_float_7_50;
	CFTTRenderHelper* renderHelper_ptr_54;
	CFTTRenderHelper* renderHelper_ptr_58;
  
  static GFXNETConstraint* ms_internalConstraints;												  //004760AC
  static int ms_iNumParticles;														                  //004760DC	
	static int ms_iNumIConstraints;													                  //004760E4
	static int ms_iNumVertices;																                //004760E0
	static int ms_iNumTriCollisions;													                //004760F0
	static int ms_iNumEdgeCollisions;													                //004760F4
	static int ms_iNumDConstraints;														                //004760E8
	static int ms_iNumTris;																	                  //004760EC
	static int ms_iNumVertCollisions;													//004760F8
	static int ms_iNumBroadCollisions;												//004760FC
	static int GFXNET_iStyle;																	//00476110
	static int s_iGoalNetMat;																	//00342D08
	static bool GFXNET_bSquare;																//00476114
	static GFXNET* net1;																			//00476108
	static GFXNET* net2;																			//0047610C
	static AABB*	AABBTree;																		//004760D0
	static bool ms_bInControl;																//00476104
	static int sx;																						//004760D8
	static short * ms_iVerts;																//004760CC
  static ushort*	ms_tris;																		//004760C0
  static GFXNETTri* ms_trisP;																		//004760C4
	static float* ms_distanceConstraints;											//004760A8
	static bool ms_bFirstInControl;														//00476105
};

void GFXNET_GoalFrameInit();       //001B12E0
void GFXNET_GoalFrameKill();       //001B1334
void GFXNET_GoalFrameRender(int);  //001B1374

extern CGFXSHADOWStaticShadow *g_pStaticObjectShadow[24];

#endif  //_GFXNET_H_