Start of some refactoring work...
This commit is contained in:
@ -24,11 +24,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#include "Constants.h"
|
||||
#include "MaterialMap.h"
|
||||
#include "Surface.h"
|
||||
#include "Triangle.h"
|
||||
#include "SurfacePatchRenderable.h"
|
||||
#include "SurfaceTriangle.h"
|
||||
#include "TypeDef.h"
|
||||
#include "Volume.h"
|
||||
#include "Vertex.h"
|
||||
#include "SurfaceVertex.h"
|
||||
|
||||
#include <set>
|
||||
|
||||
@ -80,9 +80,9 @@ namespace Ogre
|
||||
|
||||
void generateLevelVolume(void);
|
||||
|
||||
void generateMeshDataForRegion(uint regionX, uint regionY, uint regionZ, std::vector< std::vector<Vertex> >& vertexData, std::vector< std::vector<Triangle> >& indexData) const;
|
||||
void mergeVertices6(std::vector< std::vector<Vertex> >& vertexData, std::vector< std::vector<Triangle> >& indexData) const;
|
||||
bool verticesArePlanar3(uint uCurrentVertex, std::set<uint> setConnectedVertices, std::vector<Vertex>& vertexData) const;
|
||||
void generateMeshDataForRegion(uint regionX, uint regionY, uint regionZ, std::vector< std::vector<SurfaceVertex> >& vertexData, std::vector< std::vector<SurfaceTriangle> >& indexData) const;
|
||||
void mergeVertices6(std::vector< std::vector<SurfaceVertex> >& vertexData, std::vector< std::vector<SurfaceTriangle> >& indexData) const;
|
||||
bool verticesArePlanar3(uint uCurrentVertex, std::set<uint> setConnectedVertices, std::vector<SurfaceVertex>& vertexData) const;
|
||||
|
||||
void doRegionGrowing(uint xStart, uint yStart, uint zStart, uchar value);
|
||||
|
||||
@ -96,7 +96,7 @@ namespace Ogre
|
||||
bool surfaceUpToDate[OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS];
|
||||
bool regionIsHomogenous[OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS];
|
||||
|
||||
std::map<uchar,Surface*> m_mapSurfaces[OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS];
|
||||
std::map<uchar,SurfacePatchRenderable*> m_mapSurfaces[OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS][OGRE_VOLUME_SIDE_LENGTH_IN_REGIONS];
|
||||
|
||||
void igniteVoxel(UIntVector3 voxelToIgnite);
|
||||
|
||||
|
@ -1,29 +0,0 @@
|
||||
#ifndef __SURFACE_H__
|
||||
#define __SURFACE_H__
|
||||
|
||||
#include "Ogre.h"
|
||||
#include <vector>
|
||||
|
||||
#include "Triangle.h"
|
||||
#include "Vertex.h"
|
||||
|
||||
namespace Ogre
|
||||
{
|
||||
class Surface : public SimpleRenderable
|
||||
{
|
||||
public:
|
||||
Surface(const String& material = "BaseWhiteNoLighting");
|
||||
~Surface(void);
|
||||
|
||||
void setGeometry(std::vector<Vertex> verticesToSet, std::vector<Triangle> indicesToSet);
|
||||
|
||||
Real getSquaredViewDepth(const Camera *cam) const;
|
||||
Real getBoundingRadius(void) const;
|
||||
protected:
|
||||
//void getWorldTransforms(Matrix4 *xform) const;
|
||||
const Quaternion &getWorldOrientation(void) const;
|
||||
const Vector3 &getWorldPosition(void) const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* __SURFACE_H__ */
|
0
include/SurfaceEdge.h
Normal file
0
include/SurfaceEdge.h
Normal file
0
include/SurfacePatch.h
Normal file
0
include/SurfacePatch.h
Normal file
29
include/SurfacePatchRenderable.h
Normal file
29
include/SurfacePatchRenderable.h
Normal file
@ -0,0 +1,29 @@
|
||||
#ifndef __SurfacePatchRenderable_H__
|
||||
#define __SurfacePatchRenderable_H__
|
||||
|
||||
#include "Ogre.h"
|
||||
#include <vector>
|
||||
|
||||
#include "SurfaceTriangle.h"
|
||||
#include "SurfaceVertex.h"
|
||||
|
||||
namespace Ogre
|
||||
{
|
||||
class SurfacePatchRenderable : public SimpleRenderable
|
||||
{
|
||||
public:
|
||||
SurfacePatchRenderable(const String& material = "BaseWhiteNoLighting");
|
||||
~SurfacePatchRenderable(void);
|
||||
|
||||
void setGeometry(std::vector<SurfaceVertex> verticesToSet, std::vector<SurfaceTriangle> indicesToSet);
|
||||
|
||||
Real getSquaredViewDepth(const Camera *cam) const;
|
||||
Real getBoundingRadius(void) const;
|
||||
protected:
|
||||
//void getWorldTransforms(Matrix4 *xform) const;
|
||||
const Quaternion &getWorldOrientation(void) const;
|
||||
const Vector3 &getWorldPosition(void) const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* __SurfacePatchRenderable_H__ */
|
@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __Triangle_H__
|
||||
#define __Triangle_H__
|
||||
#ifndef __SurfaceTriangle_H__
|
||||
#define __SurfaceTriangle_H__
|
||||
|
||||
#include "OgrePrerequisites.h"
|
||||
|
||||
@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
namespace Ogre
|
||||
{
|
||||
class Triangle
|
||||
class SurfaceTriangle
|
||||
{
|
||||
public:
|
||||
|
||||
@ -35,14 +35,14 @@ namespace Ogre
|
||||
ulong v1;
|
||||
ulong v2;
|
||||
|
||||
Triangle()
|
||||
SurfaceTriangle()
|
||||
:v0(0)
|
||||
,v1(0)
|
||||
,v2(0)
|
||||
{
|
||||
}
|
||||
|
||||
Triangle(uint v0ToSet, uint v1ToSet, uint v2ToSet)
|
||||
SurfaceTriangle(uint v0ToSet, uint v1ToSet, uint v2ToSet)
|
||||
:v0(v0ToSet)
|
||||
,v1(v1ToSet)
|
||||
,v2(v2ToSet)
|
@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __Vertex_H__
|
||||
#define __Vertex_H__
|
||||
#ifndef __SurfaceVertex_H__
|
||||
#define __SurfaceVertex_H__
|
||||
|
||||
#include "OgrePrerequisites.h"
|
||||
|
||||
@ -26,19 +26,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
namespace Ogre
|
||||
{
|
||||
class Vertex
|
||||
class SurfaceVertex
|
||||
{
|
||||
public:
|
||||
Vector3 position;
|
||||
Vector3 normal;
|
||||
float alpha;
|
||||
|
||||
Vertex(Vector3 positionToSet)
|
||||
SurfaceVertex(Vector3 positionToSet)
|
||||
:position(positionToSet)
|
||||
{
|
||||
}
|
||||
|
||||
Vertex(Vector3 positionToSet, Vector3 normalToSet)
|
||||
SurfaceVertex(Vector3 positionToSet, Vector3 normalToSet)
|
||||
:position(positionToSet)
|
||||
,normal(normalToSet)
|
||||
{
|
Reference in New Issue
Block a user