Irrlicht Lime is a .NET wrapper for Irrlicht Engine
I almost made this work. Got bit stuck on animateNode, ISceneNode is passed to it, but managed callback expects managed SceneNode type so i am lost a bit.
For examples you could just take a look at irrlicht\source\Irrlicht\CSceneNodeAnimatorCameraFPS.[h/cpp]. This is my ripoff (http://pastebin.com/iGKm7ThC) of fps camera, dunno which one suits you better.
For examples you could just take a look at irrlicht\source\Irrlicht\CSceneNodeAnimatorCameraFPS.[h/cpp]. This is my ripoff (http://pastebin.com/iGKm7ThC) of fps camera, dunno which one suits you better.
I know that Irrlicht sources contains a lot of implementations of the interfaces which are public to implement for ordinary users. But i think that 300+ lines is not a short example.
Anyway, once good example will come to my mind, i will take it and implement required feature for it to work in Irrlicht Lime. After that, i will include that example to Lime' examples folders, so it will demonstrate how to use this feature.
P.S.: nevertheless i put "ability to be able to implement SceneNodeAnimator" to my todo list.
Anyway, once good example will come to my mind, i will take it and implement required feature for it to work in Irrlicht Lime. After that, i will include that example to Lime' examples folders, so it will demonstrate how to use this feature.
P.S.: nevertheless i put "ability to be able to implement SceneNodeAnimator" to my todo list.
Yes. I know that, but as i checked it is not a bug of a wrapper, in c++ win32 example the same behavior. And i still didn't managed how to solve it -- simply send user events on each click or mouse move -- don't think this is good idea.roxaz wrote:also it seems there are issues with rendering to win32 form.. or its something i dont know. Anyway - camera does not receive any user input.
i see.. maybe its because windows messages are received and handled by GUI thread, not irrlicht thread..
regarding inheritance of animators - i looked at problem at hand. looks like inheritor trick would not be enough this time. I made inheritor class like you did, and animateNode of inheritor object gets called like it should, however ISceneNode* is passed to that call. Now if we create scene nodes ourselves then node pointer really points to SceneNodeInheritor* object. That object can store managed SceneNode^ that it is tied to. However there is a problem. And problem is adding scene node to say camera, or any scene node that is created inside irrlicht. What happens is that object passed to animateNode is ISceneNode* that does not have member with its managed object stored.
So any thoughts how we could match ISceneNode* to its managed object counterpart? I thought it would work out if there was ability to store user-chosen pointer in CSceneNode, but that would require engine modification, and if modification would not make to the engine release then its not an option to use..
regarding inheritance of animators - i looked at problem at hand. looks like inheritor trick would not be enough this time. I made inheritor class like you did, and animateNode of inheritor object gets called like it should, however ISceneNode* is passed to that call. Now if we create scene nodes ourselves then node pointer really points to SceneNodeInheritor* object. That object can store managed SceneNode^ that it is tied to. However there is a problem. And problem is adding scene node to say camera, or any scene node that is created inside irrlicht. What happens is that object passed to animateNode is ISceneNode* that does not have member with its managed object stored.
So any thoughts how we could match ISceneNode* to its managed object counterpart? I thought it would work out if there was ability to store user-chosen pointer in CSceneNode, but that would require engine modification, and if modification would not make to the engine release then its not an option to use..
Can someone recompile irrlicht lime in release mode for me. I cant run the examples because I dont have the debug runtimes. I tried installing the vcredist package and same problem. I was reading compiling in release mode will fix the problem. Tried to open the project and recompile using sharpdevelop but it looks like irrlicht lime is c++ .net and i get an error message.
As i remember Irrlicht.NET simply re-implement all in .NET so inheritance made in natural way. But i believe support of this kind of implementation is even harder than Irrlicht.NETCP. Inheritance and the extensibility in general is a week point of the Irrlicht Lime.roxaz wrote:question regarding inheritance - have you seen Irrlicht.NET (discontinued wrapper)? It does not use any of these tricky inheritor classes. It seems rather simple solution.
grunt,
I will compile release wrapper and examples and pack to ZIP and upload somewhere and PM you the link, tomorrow at morning.
grunt,
You have to cast to proper type of Vertex3Dxxx[], for example:
Same for indices.
Please take a look on my post bolded with "Version 0.7 has been released." at 4th page here, start reading from "MeshBuffer class has been extended...".
You have to cast to proper type of Vertex3Dxxx[], for example:
Code: Select all
Vertex3D[] v = (Vertex3D[])meshBuffer.Vertices; // this is OK only if meshBuffer.VertexType == VertexType.Standard
Please take a look on my post bolded with "Version 0.7 has been released." at 4th page here, start reading from "MeshBuffer class has been extended...".
How come the array lengths are returning 0 for this?
Code: Select all
For z As Integer = 0 To mesh.MeshBufferCount - 1
Dim mb As MeshBuffer = mesh.GetMeshBuffer(z)
dim indlist() as ushort = ctype(mb.Indices, ushort())
Dim vertlist() as vertex3d = ctype(mb.vertices, vertex3d())
dev.Logger.Log(vertlist.length.ToString)
'loop through vertlist and convert to jvectors
'For Each vert As Vertex3D In vertlist
' dev.Logger.Log(vertlist.Length.tostring)
' dim vec as New JVector(vert.Position.x, vert.position.y, vert.Position.z)
' physverts.Add(vec)
'Next
'dim trivert as New JOctree.TriangleVertexIndices(indlist(0), indlist(1), indlist(2))
'physinds.Add(trivert)
Next
Apparently I was getting the meshbuffer on an animated mesh. Get the mesh of the animated mesh like below and now it returns the correct amount of vertices and indices.
Code: Select all
dim plainmesh as Mesh = mesh.GetMesh(0)
Dim mb As MeshBuffer = plainmesh.GetMeshBuffer(0)
dev.Logger.Log(mb.VertexCount.ToString)