Files
BlitzNext/Runtime/blitz3d/meshmodel.hpp
T
Michael Fabian 'Xaymar' Dirks 3afa84df85 runtime/blitz3d: Fixup C++ification
2019-01-18 21:26:42 +01:00

67 lines
1.4 KiB
C++

#pragma once
#include <vector>
#include "model.hpp"
#include "surface.hpp"
class MeshCollider;
class Collision;
class MeshModel : public Model {
public:
typedef std::vector<Surface*> SurfaceList;
MeshModel();
MeshModel(const MeshModel& t);
~MeshModel();
//Entity interface
virtual MeshModel* getMeshModel()
{
return this;
}
virtual Entity* clone()
{
return new MeshModel(*this);
}
//Object interface
virtual bool collide(const Line& line, float radius, Collision* curr_coll, const Transform& t);
//Model interface
virtual void setRenderBrush(const Brush& b);
virtual bool render(const RenderContext& rc);
virtual void renderQueue(int type);
//boned mesh!
void createBones();
//MeshModel interface
Surface* createSurface(const Brush& b);
void setCullBox(const Box& box);
void updateNormals();
void flipTriangles();
void transform(const Transform& t);
void paint(const Brush& b);
void add(const MeshModel& t);
void optimize();
//accessors
const SurfaceList& getSurfaces() const;
Surface* findSurface(const Brush& b) const;
bool intersects(const MeshModel& m) const;
MeshCollider* getCollider() const;
const Box& getBox() const;
private:
struct Rep;
Rep* rep;
int brush_changes;
Brush render_brush;
std::vector<Brush> brushes;
std::vector<Surface::Bone> surf_bones;
MeshModel& operator=(const MeshModel&);
};