Commit 0e00187f authored by hybrid's avatar hybrid

Aded a meshbuffer version of makePlanarTextureMapping.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2171 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 7810313b
...@@ -119,6 +119,13 @@ namespace scene ...@@ -119,6 +119,13 @@ namespace scene
and texture coordinate space. */ and texture coordinate space. */
virtual void makePlanarTextureMapping(IMesh* mesh, f32 resolution=0.001f) const = 0; virtual void makePlanarTextureMapping(IMesh* mesh, f32 resolution=0.001f) const = 0;
//! Creates a planar texture mapping on the meshbuffer
/** \param meshbuffer: Buffer on which the operation is performed.
\param resolution: resolution of the planar mapping. This is
the value specifying which is the relation between world space
and texture coordinate space. */
virtual void makePlanarTextureMapping(scene::IMeshBuffer* meshbuffer, f32 resolution=0.001f) const = 0;
//! Creates a copy of the mesh, which will only consist of S3DVertexTangents vertices. //! Creates a copy of the mesh, which will only consist of S3DVertexTangents vertices.
/** This is useful if you want to draw tangent space normal /** This is useful if you want to draw tangent space normal
mapped geometry because it calculates the tangent and binormal mapped geometry because it calculates the tangent and binormal
......
...@@ -387,10 +387,6 @@ SMesh* CMeshManipulator::createMeshCopy(scene::IMesh* mesh) const ...@@ -387,10 +387,6 @@ SMesh* CMeshManipulator::createMeshCopy(scene::IMesh* mesh) const
//! Creates a planar texture mapping on the mesh //! Creates a planar texture mapping on the mesh
//! \param mesh: Mesh on which the operation is performed.
//! \param resolution: resolution of the planar mapping. This is the value
//! specifying which is the releation between world space and
//! texture coordinate space.
void CMeshManipulator::makePlanarTextureMapping(scene::IMesh* mesh, f32 resolution=0.01f) const void CMeshManipulator::makePlanarTextureMapping(scene::IMesh* mesh, f32 resolution=0.01f) const
{ {
if (!mesh) if (!mesh)
...@@ -399,7 +395,14 @@ void CMeshManipulator::makePlanarTextureMapping(scene::IMesh* mesh, f32 resoluti ...@@ -399,7 +395,14 @@ void CMeshManipulator::makePlanarTextureMapping(scene::IMesh* mesh, f32 resoluti
const u32 bcount = mesh->getMeshBufferCount(); const u32 bcount = mesh->getMeshBufferCount();
for ( u32 b=0; b<bcount; ++b) for ( u32 b=0; b<bcount; ++b)
{ {
IMeshBuffer* buffer = mesh->getMeshBuffer(b); makePlanarTextureMapping(mesh->getMeshBuffer(b), resolution);
}
}
//! Creates a planar texture mapping on the meshbuffer
void CMeshManipulator::makePlanarTextureMapping(scene::IMeshBuffer* buffer, f32 resolution) const
{
u32 idxcnt = buffer->getIndexCount(); u32 idxcnt = buffer->getIndexCount();
u16* idx = buffer->getIndices(); u16* idx = buffer->getIndices();
...@@ -437,7 +440,6 @@ void CMeshManipulator::makePlanarTextureMapping(scene::IMesh* mesh, f32 resoluti ...@@ -437,7 +440,6 @@ void CMeshManipulator::makePlanarTextureMapping(scene::IMesh* mesh, f32 resoluti
} }
} }
} }
}
} }
......
...@@ -85,6 +85,9 @@ public: ...@@ -85,6 +85,9 @@ public:
texture coordinate space. */ texture coordinate space. */
virtual void makePlanarTextureMapping(scene::IMesh* mesh, f32 resolution) const; virtual void makePlanarTextureMapping(scene::IMesh* mesh, f32 resolution) const;
//! Creates a planar texture mapping on the meshbuffer
virtual void makePlanarTextureMapping(scene::IMeshBuffer* meshbuffer, f32 resolution=0.001f) const;
//! Creates a copy of the mesh, which will only consist of S3DVertexTangents vertices. //! Creates a copy of the mesh, which will only consist of S3DVertexTangents vertices.
virtual IMesh* createMeshWithTangents(IMesh* mesh, bool recalculateNormals=false, bool smooth=false, bool angleWeighted=false) const; virtual IMesh* createMeshWithTangents(IMesh* mesh, bool recalculateNormals=false, bool smooth=false, bool angleWeighted=false) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment