
Convert manual object to mesh (v2)
-
- OGRE Contributor
- Posts: 267
- Joined: Wed Apr 23, 2014 3:49 pm
- Location: Bologna, Italy
- x 75
Convert manual object to mesh (v2)
As the title says, is there a way to convert a v2 manual object in a v2 mesh? For v1 classes, exists a convertToMesh convenience method. Or do I have to mimic what the DynamicGeometry sample does and submit a PR? 

Senior programmer at 505 Games; former senior engine programmer at Sandbox Games
Worked on: Racecraft Esport — Racecraft Coin-Op, Victory: The Age of Racing
-
- OGRE Team Member
- Posts: 5505
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1372
Re: Convert manual object to mesh (v2)
I don't know if there is (ManualObject was a contribution, I didn't write the code).
But ManualObject, like any v2 object, has its own VertexArrayObject, with its own VertexBuffers, with its own IndexBuffers; and the local AABB & Material data is already available; which is all you need to construct a Mesh and a SubMesh.
Therefore it should be relative trivial to write a conversion routine that either duplicates these structures (use BufferPacked::copyTo and create a new Vao) or just give away the pointers and its ownership (i.e. don't leave dangling pointers)
But ManualObject, like any v2 object, has its own VertexArrayObject, with its own VertexBuffers, with its own IndexBuffers; and the local AABB & Material data is already available; which is all you need to construct a Mesh and a SubMesh.
Therefore it should be relative trivial to write a conversion routine that either duplicates these structures (use BufferPacked::copyTo and create a new Vao) or just give away the pointers and its ownership (i.e. don't leave dangling pointers)
-
- OGRE Contributor
- Posts: 267
- Joined: Wed Apr 23, 2014 3:49 pm
- Location: Bologna, Italy
- x 75
Re: Convert manual object to mesh (v2)
Senior programmer at 505 Games; former senior engine programmer at Sandbox Games
Worked on: Racecraft Esport — Racecraft Coin-Op, Victory: The Age of Racing