eqemu

diff src/mesh.h @ 4:3d3656360a82

rendering properly, added picking, almost done...
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 17 Jul 2014 08:51:17 +0300
parents f9274bebe55e
children 2656099aff12
line diff
     1.1 --- a/src/mesh.h	Thu Jul 17 02:35:19 2014 +0300
     1.2 +++ b/src/mesh.h	Thu Jul 17 08:51:17 2014 +0300
     1.3 @@ -1,6 +1,8 @@
     1.4  #ifndef MESH_H_
     1.5  #define MESH_H_
     1.6  
     1.7 +#include "bvol.h"
     1.8 +
     1.9  enum {
    1.10  	MESH_ATTR_VERTEX,
    1.11  	MESH_ATTR_NORMAL,
    1.12 @@ -19,6 +21,10 @@
    1.13  	mutable unsigned int buf_valid;	/* bitmask */
    1.14  	void update_buffers() const;
    1.15  
    1.16 +	mutable BSphere bsph;
    1.17 +	mutable bool bsph_valid;
    1.18 +	void calc_bsph() const;
    1.19 +
    1.20  public:
    1.21  	Mesh();
    1.22  	~Mesh();
    1.23 @@ -28,6 +34,9 @@
    1.24  	const float *get_attrib(int aidx) const;
    1.25  
    1.26  	void draw() const;
    1.27 +
    1.28 +	BSphere &get_bounds();
    1.29 +	const BSphere &get_bounds() const;
    1.30  };
    1.31  
    1.32  #endif	// MESH_H_