2008-05-22 04:51:37 -07:00
|
|
|
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
2007-05-20 11:03:49 -07:00
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
|
|
|
#ifndef __I_MESH_H_INCLUDED__
|
|
|
|
#define __I_MESH_H_INCLUDED__
|
|
|
|
|
2007-09-06 23:11:47 -07:00
|
|
|
#include "IReferenceCounted.h"
|
2007-05-20 11:03:49 -07:00
|
|
|
#include "SMaterial.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace scene
|
|
|
|
{
|
|
|
|
class IMeshBuffer;
|
|
|
|
|
|
|
|
//! Class for accessing a mesh with multiple mesh buffers.
|
2008-05-22 04:51:37 -07:00
|
|
|
/** An IMesh is nothing more than a collection of some mesh buffers
|
|
|
|
(IMeshBuffer). SMesh is a simple implementation of an IMesh.
|
2007-05-20 11:03:49 -07:00
|
|
|
*/
|
2007-09-06 23:11:47 -07:00
|
|
|
class IMesh : public virtual IReferenceCounted
|
2007-05-20 11:03:49 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! Returns the amount of mesh buffers.
|
|
|
|
/** \return Returns the amount of mesh buffers (IMeshBuffer) in this mesh. */
|
|
|
|
virtual u32 getMeshBufferCount() const = 0;
|
|
|
|
|
|
|
|
//! Returns pointer to a mesh buffer.
|
2008-05-22 04:51:37 -07:00
|
|
|
/** \param nr: Zero based index of the mesh buffer. The maximum value is
|
2007-05-20 11:03:49 -07:00
|
|
|
getMeshBufferCount() - 1;
|
2008-05-22 04:51:37 -07:00
|
|
|
\return Returns the pointer to the mesh buffer or
|
2007-05-20 11:03:49 -07:00
|
|
|
NULL if there is no such mesh buffer. */
|
|
|
|
virtual IMeshBuffer* getMeshBuffer(u32 nr) const = 0;
|
|
|
|
|
|
|
|
//! Returns pointer to a mesh buffer which fits a material
|
2008-05-22 04:51:37 -07:00
|
|
|
/** \param material: material to search for
|
|
|
|
\return Returns the pointer to the mesh buffer or
|
2007-05-20 11:03:49 -07:00
|
|
|
NULL if there is no such mesh buffer. */
|
2007-08-13 17:54:40 -07:00
|
|
|
virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const = 0;
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
//! Returns an axis aligned bounding box of the mesh.
|
|
|
|
/** \return A bounding box of this mesh is returned. */
|
|
|
|
virtual const core::aabbox3d<f32>& getBoundingBox() const = 0;
|
|
|
|
|
|
|
|
//! set user axis aligned bounding box
|
2008-05-22 04:51:37 -07:00
|
|
|
/** \param box New bounding box to use for the mesh. */
|
2007-05-20 11:03:49 -07:00
|
|
|
virtual void setBoundingBox( const core::aabbox3df& box) = 0;
|
|
|
|
|
|
|
|
//! Sets a flag of all contained materials to a new value.
|
|
|
|
/** \param flag: Flag to set in all materials.
|
2008-05-22 04:51:37 -07:00
|
|
|
\param newvalue: New value to set in all materials. */
|
2007-05-20 11:03:49 -07:00
|
|
|
virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|