mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 04:39:18 +02:00
continued refactoring: lines, terrain models; render culling optimizations and fixes
This commit is contained in:
22
Model3d.h
22
Model3d.h
@@ -50,7 +50,12 @@ enum TAnimType // rodzaj animacji
|
||||
at_Undefined = 0x800000FF // animacja chwilowo nieokreślona
|
||||
};
|
||||
|
||||
#ifdef EU07_USE_OLD_GROUNDCODE
|
||||
class TGroundNode;
|
||||
#endif
|
||||
namespace scene {
|
||||
class shape_node;
|
||||
}
|
||||
|
||||
class TSubModel
|
||||
{ // klasa submodelu - pojedyncza siatka, punkt świetlny albo grupa punktów
|
||||
@@ -59,6 +64,7 @@ class TSubModel
|
||||
friend class opengl_renderer;
|
||||
friend class TModel3d; // temporary workaround. TODO: clean up class content/hierarchy
|
||||
friend class TDynamicObject; // temporary etc
|
||||
friend class scene::shape_node; // temporary etc
|
||||
|
||||
public:
|
||||
enum normalization {
|
||||
@@ -131,10 +137,8 @@ private:
|
||||
|
||||
public: // chwilowo
|
||||
float3 v_TransVector { 0.0f, 0.0f, 0.0f };
|
||||
/*
|
||||
basic_vertex *Vertices; // roboczy wskaźnik - wczytanie T3D do VBO
|
||||
*/
|
||||
vertex_array Vertices;
|
||||
float m_boundingradius { 0 };
|
||||
size_t iAnimOwner{ 0 }; // roboczy numer egzemplarza, który ustawił animację
|
||||
TAnimType b_aAnim{ at_None }; // kody animacji oddzielnie, bo zerowane
|
||||
public:
|
||||
@@ -163,9 +167,6 @@ public:
|
||||
TSubModel * NextGet() { return Next; };
|
||||
TSubModel * ChildGet() { return Child; };
|
||||
int TriangleAdd(TModel3d *m, material_handle tex, int tri);
|
||||
/*
|
||||
basic_vertex * TrianglePtr(int tex, int pos, glm::vec3 const &Ambient, glm::vec3 const &Diffuse, glm::vec3 const &Specular );
|
||||
*/
|
||||
void SetRotate(float3 vNewRotateAxis, float fNewAngle);
|
||||
void SetRotateXYZ(vector3 vNewAngles);
|
||||
void SetRotateXYZ(float3 vNewAngles);
|
||||
@@ -215,8 +216,9 @@ public:
|
||||
std::vector<float4x4>&);
|
||||
void serialize_geometry( std::ostream &Output ) const;
|
||||
// places contained geometry in provided ground node
|
||||
#ifdef EU07_USE_OLD_GROUNDCODE
|
||||
void convert( TGroundNode &Groundnode ) const;
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
class TModel3d : public CMesh
|
||||
@@ -236,6 +238,11 @@ private:
|
||||
std::string asBinary; // nazwa pod którą zapisać model binarny
|
||||
std::string m_filename;
|
||||
public:
|
||||
float bounding_radius() const {
|
||||
return (
|
||||
Root ?
|
||||
Root->m_boundingradius :
|
||||
0.f ); }
|
||||
inline TSubModel * GetSMRoot() { return (Root); };
|
||||
TModel3d();
|
||||
~TModel3d();
|
||||
@@ -246,7 +253,6 @@ public:
|
||||
void LoadFromBinFile(std::string const &FileName, bool dynamic);
|
||||
bool LoadFromFile(std::string const &FileName, bool dynamic);
|
||||
void SaveToBinFile(std::string const &FileName);
|
||||
void BreakHierarhy();
|
||||
int Flags() const { return iFlags; };
|
||||
void Init();
|
||||
std::string NameGet() { return m_filename; };
|
||||
|
||||
Reference in New Issue
Block a user