[SOLVED] MeshBuffer to Mesh

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
LeGars
Posts: 8
Joined: Thu May 11, 2006 1:57 pm

[SOLVED] MeshBuffer to Mesh

Post by LeGars »

I create an object with vertex and indexes.
Everything is in a vertexbuffer. I can display it with drawMeshBuffer(...) IVideoDrivers's function.
The problem is that I can't interact with this object as I should with an IMesh. I want to be able to use the SceneCollisionManager to detect a point I select on my object.

So the question is how can I transform my meshbuffer to an IMesh ?
Last edited by LeGars on Mon Feb 19, 2007 2:26 pm, edited 1 time in total.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=17028

Also look at IMesh.h and SMesh.h and Irr help. You will find there all you need.
LeGars
Posts: 8
Joined: Thu May 11, 2006 1:57 pm

Post by LeGars »

Thanks for the link,

I discover that usefull method : addMeshBuffer(...)

Exactly what I was looking for.

I just add a new constructor to SMesh.h :

Code: Select all

SMesh(IMeshBuffer* mb)
{
   this->addMeshBuffer(mb);
}
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Why would you need [or want] to add this constructor to SMesh. If you have a pointer to an SMesh you could call addMeshBuffer() directly.
LeGars
Posts: 8
Joined: Thu May 11, 2006 1:57 pm

Post by LeGars »

I Prefer to add this constructor because I work with the DeusEx's .Net wrapper and the addMeshbuffer method is not implemented.
Because I do not completly undestand how this wrapper works, I add this to the original source and create my own contructor in the wrapper.

Yeah I know it sounds crazy, but my project's demo deadline approch and I don't have enough time to create an optimized and personalized wrapper...

So, this is the reason :)

When my project will end, I will invest myself in Irrlicht's .Net but I don't already know in which wrapper (DeusEx or Irrlicht)...
Post Reply