X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fmodel3d-view%2Fobj-loader.cpp;h=5e67b1ed143cd7691ceb2967a6846b4bdcd1425d;hb=c8bdaee794b69decae11a75fbfa25fb915caadd2;hp=c950b9d921569e173aeaaaee2623f61a5be9345a;hpb=2bfffc672a4b2f6ef1ca1de3f9644c9836720ee9;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/model3d-view/obj-loader.cpp b/dali-toolkit/internal/controls/model3d-view/obj-loader.cpp index c950b9d..5e67b1e 100644 --- a/dali-toolkit/internal/controls/model3d-view/obj-loader.cpp +++ b/dali-toolkit/internal/controls/model3d-view/obj-loader.cpp @@ -259,7 +259,7 @@ bool ObjLoader::Load(char* objBuffer, std::streampos fileSize, std::string& mate std::string line; std::getline(ss, line); - while (std::getline(ss, line)) + while (std::getline(ss, line)) { std::istringstream isline(line, std::istringstream::in); std::string tag; @@ -419,16 +419,8 @@ bool ObjLoader::Load(char* objBuffer, std::streampos fileSize, std::string& mate if (iniObj) { - pntAcum += (int)mPoints.Size(); - texAcum += (int)mTextures.Size(); - nrmAcum += (int)mNormals.Size(); - CenterAndScale(true, mPoints); - - face = 0; - mSceneLoaded = true; - return true; } @@ -507,8 +499,8 @@ Geometry ObjLoader::CreateGeometry(Toolkit::Model3dView::IlluminationType illumi Property::Map vertexFormat; vertexFormat["aPosition"] = Property::VECTOR3; vertexFormat["aNormal"] = Property::VECTOR3; - PropertyBuffer surfaceVertices = PropertyBuffer::New( vertexFormat, vertices.Size() ); - surfaceVertices.SetData( &vertices[0] ); + PropertyBuffer surfaceVertices = PropertyBuffer::New( vertexFormat ); + surfaceVertices.SetData( &vertices[0], vertices.Size() ); Geometry surface = Geometry::New(); surface.AddVertexBuffer( surfaceVertices ); @@ -518,8 +510,8 @@ Geometry ObjLoader::CreateGeometry(Toolkit::Model3dView::IlluminationType illumi { Property::Map textureFormat; textureFormat["aTexCoord"] = Property::VECTOR2; - PropertyBuffer extraVertices = PropertyBuffer::New( textureFormat, textures.Size() ); - extraVertices.SetData( &textures[0] ); + PropertyBuffer extraVertices = PropertyBuffer::New( textureFormat ); + extraVertices.SetData( &textures[0], textures.Size() ); surface.AddVertexBuffer( extraVertices ); } @@ -530,8 +522,8 @@ Geometry ObjLoader::CreateGeometry(Toolkit::Model3dView::IlluminationType illumi Property::Map vertexExtFormat; vertexExtFormat["aTangent"] = Property::VECTOR3; vertexExtFormat["aBiNormal"] = Property::VECTOR3; - PropertyBuffer extraVertices = PropertyBuffer::New( vertexExtFormat, verticesExt.Size() ); - extraVertices.SetData( &verticesExt[0] ); + PropertyBuffer extraVertices = PropertyBuffer::New( vertexExtFormat ); + extraVertices.SetData( &verticesExt[0], verticesExt.Size() ); surface.AddVertexBuffer( extraVertices ); } @@ -541,14 +533,13 @@ Geometry ObjLoader::CreateGeometry(Toolkit::Model3dView::IlluminationType illumi //Indices Property::Map indicesVertexFormat; indicesVertexFormat["aIndices"] = Property::INTEGER; - PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat, indices.Size() ); - indicesToVertices.SetData(&indices[0]); + PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat ); + indicesToVertices.SetData( &indices[0], indices.Size() ); surface.SetIndexBuffer ( indicesToVertices ); } surface.SetRequiresDepthTesting(true); - //surface.SetProperty(Geometry::Property::GEOMETRY_HALF_EXTENTS, GetSize() * 0.5); vertices.Clear(); verticesExt.Clear();