return meshData;
}
+Dali::MeshData NewPath( Dali::Path path, const unsigned int resolution )
+{
+ MeshData meshData;
+ meshData.SetHasNormals(false);
+ meshData.SetHasTextureCoords(false);
+
+ if( resolution != 0 )
+ {
+ size_t vertexCount(resolution+1);
+ MeshData::VertexContainer vertex(vertexCount);
+
+ float sampleDelta = 1.0f/(float)resolution;
+ Vector3 tangent;
+ for( size_t i(0); i!=vertexCount; ++i )
+ {
+ //Sample path to get the vertex position
+ Vector3* vertexPosition = reinterpret_cast<Vector3*>(&vertex[i].x);
+ path.Sample( i*sampleDelta, *vertexPosition, tangent );
+ }
+
+ //Generate indices. Each vertex is connected to the next
+ size_t indexCount(resolution*2);
+ MeshData::FaceIndices index(indexCount);
+ unsigned int nIndex = 0;
+ for( size_t i(0); i!=indexCount; i+=2 )
+ {
+ index[i] = nIndex;
+ index[i+1] = ++nIndex;
+ }
+
+ meshData.SetLineData(vertex, index, Dali::Material::New("PathMat"));
+ }
+
+ return meshData;
+}
+
} // MeshFactory
} // Dali
*/
#include <dali/public-api/math/rect.h>
+#include <dali/public-api/animation/path.h>
namespace Dali
{
const int ySteps,
const Rect<float>& textureCoordinates = Rect<float>(0.0f, 0.0f, 1.0f, 1.0f) );
+/**
+ * @brief Create a mesh from a given path.
+ * The mesh generated will be a set of lines, each one connecting a point sampled from the path to the next sampled point.
+ *
+ * @param[in] path The path used to generate the mesh
+ * @param[in] resolution The number of vertices to generate
+ * @return A mesh data structure containing the path mesh
+ */
+DALI_IMPORT_API Dali::MeshData NewPath( Dali::Path path, const unsigned int resolution );
+
} // MeshFactory
} // Dali