Files
BlitzNext/Runtime/blitz3d/q3bsprep.hpp
T

59 lines
1.0 KiB
C++
Raw Normal View History

2014-01-31 08:23:00 +13:00
#ifndef Q3BSPREP_H
#define Q3BSPREP_H
2019-01-18 15:55:06 +01:00
#include "meshcollider.hpp"
2019-01-18 17:04:17 +01:00
#include "model.hpp"
2014-01-31 08:23:00 +13:00
struct Q3BSPSurf;
struct Q3BSPFace;
struct Q3BSPLeaf;
struct Q3BSPNode;
2019-01-18 17:04:17 +01:00
class Q3BSPRep {
public:
2014-01-31 08:23:00 +13:00
//constructor
2019-01-18 17:04:17 +01:00
Q3BSPRep(const string& f, float gamma_adj);
2014-01-31 08:23:00 +13:00
~Q3BSPRep();
2019-01-18 17:04:17 +01:00
void render(Model* model, const RenderContext& rc);
bool collide(const Line& line, float radius, Collision* curr_coll, const Transform& t);
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
void setAmbient(const Vector& t);
void setLighting(bool use_lmap);
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
bool isValid() const
{
return root_node != 0;
}
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
private:
Q3BSPNode* root_node;
2014-01-31 08:23:00 +13:00
Vector ambient;
vector<Q3BSPFace*> faces;
2019-01-18 17:04:17 +01:00
vector<Q3BSPSurf*> surfs, r_surfs;
vector<Texture> textures, light_maps;
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
int vis_sz;
char* vis_data;
bool use_lmap;
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
MeshCollider* collider;
2014-01-31 08:23:00 +13:00
void createVis();
void createSurfs();
void createCollider();
2019-01-18 17:04:17 +01:00
void createTextures();
void createLightMaps();
Q3BSPLeaf* createLeaf(int n);
Q3BSPNode* createNode(int n);
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
void vis(Q3BSPNode* node);
void render(Q3BSPLeaf* l, int clip);
void render(Q3BSPNode* n, int clip);
2014-01-31 08:23:00 +13:00
};
#endif