Manually creating a Mesh without MeshManager

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
User avatar
Yavin
Bronze Sponsor
Bronze Sponsor
Posts: 140
Joined: Wed Mar 02, 2005 3:41 pm
Location: Lake Constance, Germany
Contact:

Manually creating a Mesh without MeshManager

Post by Yavin »

@ the OGRE Team:

I'm working on a Java based converter for several 3D formats. Why it is not allowed to create a Mesh directly without the MeshManager? I only want to export it with the serializer. I doesn't understand why the MeshManager has to know anything about the mesh. I think it must not because I don't want to add it in a scene at the moment. Just creating and writing as .mesh file.

Could I do this:

Code: Select all

Mesh * mesh = new Mesh(0, "Name", 0, "General", true, 0);
// populate data
MeshSerializer * ser = new MeshSerializer();
ser.export(mesh);
delete ser;
delete mesh;
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Because all resources notify their ResourceManager of various things. It's not exactly hard:

Code: Select all

MeshPtr ogreMesh = MeshManager::getSingleton().create("export", 
        ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Post Reply