28#ifndef __Ogre_Volume_MeshBuilder_H__
29#define __Ogre_Volume_MeshBuilder_H__
171 mBox.setExtents(v.
x, v.
y, v.
z, v.
x, v.
y, v.
z);
176 if (v.
x <
mBox.getMinimum().x)
178 mBox.setMinimumX(v.
x);
180 if (v.
y <
mBox.getMinimum().y)
182 mBox.setMinimumY(v.
y);
184 if (v.
z <
mBox.getMinimum().z)
186 mBox.setMinimumZ(v.
z);
188 if (v.
x >
mBox.getMaximum().x)
190 mBox.setMaximumX(v.
x);
192 if (v.
y >
mBox.getMaximum().y)
194 mBox.setMaximumY(v.
y);
196 if (v.
z >
mBox.getMaximum().z)
198 mBox.setMaximumZ(v.
z);
260 manual->
index(baseIndex + 0); manual->
index(baseIndex + 1);
261 manual->
index(baseIndex + 1); manual->
index(baseIndex + 2);
262 manual->
index(baseIndex + 2); manual->
index(baseIndex + 3);
263 manual->
index(baseIndex + 3); manual->
index(baseIndex + 0);
265 manual->
index(baseIndex + 4); manual->
index(baseIndex + 5);
266 manual->
index(baseIndex + 5); manual->
index(baseIndex + 6);
267 manual->
index(baseIndex + 6); manual->
index(baseIndex + 7);
268 manual->
index(baseIndex + 7); manual->
index(baseIndex + 4);
270 manual->
index(baseIndex + 0); manual->
index(baseIndex + 4);
271 manual->
index(baseIndex + 1); manual->
index(baseIndex + 5);
272 manual->
index(baseIndex + 2); manual->
index(baseIndex + 6);
273 manual->
index(baseIndex + 3); manual->
index(baseIndex + 7);
#define _OgreVolumeExport
A 3D box aligned with the x/y/z axes.
Defines an instance of a discrete, movable object based on a Mesh.
Class providing a much simplified interface to generating manual objects with custom geometry.
virtual void position(const Vector3 &pos)
Add a vertex position, starting a new vertex at the same time.
virtual void index(uint32 idx)
Add a vertex index to construct faces / lines / points via indexing rather than just by a simple list...
'New' rendering operation using vertex buffers.
Manages the organisation and rendering of a 'scene' i.e.
Simple implementation of MovableObject and Renderable for single-part custom objects.
Standard 3-dimensional vector.
Callback class when the user needs information about the triangles of chunks of a LOD level.
virtual void ready(const SimpleRenderable *simpleRenderable, const VecVertex &vertices, const VecIndices &indices, size_t level, int inProcess)=0
To be called with the callback function of a MeshBuilder.
virtual ~MeshBuilderCallback()
void addVertex(const Vertex &v)
Adds a vertex to the data structure, reusing the index if it is already known.
void addTriangle(const Vector3 &v0, const Vector3 &n0, const Vector3 &v1, const Vector3 &n1, const Vector3 &v2, const Vector3 &n2)
Adds a triangle to the mesh with reusing already existent vertices via their index.
bool mBoxInit
Holds whether the initial bounding box has been set.
static const unsigned short MAIN_BINDING
The buffer binding.
MeshBuilder(void)
Constructor.
AxisAlignedBox getBoundingBox(void)
Gets the bounding box of the mesh.
AxisAlignedBox mBox
Holds the bounding box.
VecIndices mIndices
Holds the indices of the mesh.
map< Vertex, size_t >::type UMapVertexIndex
Map to get a vertex index.
Entity * generateWithManualObject(SceneManager *sceneManager, const String &name, const String &material)
Generates an entity via a ManualObject.
void executeCallback(MeshBuilderCallback *callback, const SimpleRenderable *simpleRenderable, size_t level, int inProcess) const
Executes a MeshBuilderCallback on this instance.
VecVertex mVertices
Holds the vertices of the mesh.
static void addCubeToManualObject(ManualObject *manual, const Vector3 &c0, const Vector3 &c1, const Vector3 &c2, const Vector3 &c3, const Vector3 &c4, const Vector3 &c5, const Vector3 &c6, const Vector3 &c7, uint32 &baseIndex)
Adds a cube to a manual object rendering lines.
UMapVertexIndex mIndexMap
size_t generateBuffers(RenderOperation &operation)
Generates the vertex- and indexbuffer of this mesh on the given RenderOperation.
vector< size_t >::type VecIndices
To hold indices.
struct _OgreVolumeExport Ogre::Volume::Vertex Vertex
Lightweight struct to represent a mesh vertex.
bool _OgreVolumeExport operator<(const Vector3 &a, const Vector3 &b)
A less operator.
vector< Vertex >::type VecVertex
To hold vertices.
bool _OgreVolumeExport operator==(Vertex const &a, Vertex const &b)
== operator for two vertices.
float Real
Software floating point type.
GeneralAllocatedObject UtilityAlloc
Lightweight struct to represent a mesh vertex.
Real x
X coordinate of the position.
Vertex(const Vector3 &v, const Vector3 &n)
Convenience constructor.
Real nX
X component of the normal.
Real nY
Y component of the normal.
Real y
Y coordinate of the position.
Real z
Z coordinate of the position.
Real nZ
Z component of the normal.
std::map< K, V, P, A > type