Horde3D
http://horde3d.org/forums/

Horde3d + SDL + recastnavigation, how to intergrate them?
http://horde3d.org/forums/viewtopic.php?f=2&t=1828
Page 1 of 1

Author:  jacmy [ 16.11.2012, 09:35 ]
Post subject:  Horde3d + SDL + recastnavigation, how to intergrate them?

Horde3d + SDL + recastnavigation, how to intergrate them?

could someone give me some advise? and i have refered the url

viewtopic.php?f=4&t=930

and

http://www.horde3d.org/wiki/index.php5? ... e_with_SDL

but there's something wrong with the rendering.

Thanks.

Author:  Roland [ 18.11.2012, 22:14 ]
Post subject:  Re: Horde3d + SDL + recastnavigation, how to intergrate them

Hi.
I'm not quite sure what your question is. Do you need help switching your Horde3D application from glfw to sdl?
If so, http://www.libsdl.org/intro.en/toc.html provides tutorials on how to initialize sdl and how to poll input events. You can do all of this in your main.cpp, similar to the provided Horde3D samples using glfw.

Integrating the RecastNavigation project into your application is unrelated to using sdl. Basically you have to have a look at the RecastDemo project provided by the author and integrate all the functionality that you want to have into your project. What I actually ended up doing is that I removed all the sdl dependencies from the Demo project, and compile it as a static lib. I moved all the input handling of the demo's main.cpp into a MyRecastDemo class, which I use to access all of the demo's functionality from my Horde3d app.

In my Horde3D app.cpp (almost) all I have to do is initialize it and access its public functions to do handle all of the user input:

Code:
{
  ..
  m_recastDemo = new MyRecastDemo();
}

void Application::mainLoop( float fps )
{
  ..
  m_recastDemo->handleUpdate(time);
  ..
}

bool Application::mouseClickEvent(int button, int action, float x, float y)
{
   return m_recastDemo->guiHandleMouseButton(button, action, x, y);
}

bool Application::mouseWheelEvent(int position)
{
   return m_recastDemo->guiHandleMouseWheel(position);
}

void Application::toggleRecastNavGUI()
{
   m_recastDemo->guiToggle();
}


etc...

To me this seemed to be the easiest way of reusing all the code Mikko Mononen already implemented, while doing as little coding as possible myself :)
The nice thing is that merging new updates from the recast project is as easy as it gets.
You can find some screenshots here: viewtopic.php?f=4&t=1685


I'd like to release my solution to the community. Thing is I'm currently quite busy writing my thesis and since the code is quite messy, I'm not sure my current project compile/link/dependency settings are set up properly, there is some functionality missing, it's only working on Windows/VisualStudio2010/2012, and I need to mark all the files I changed according to their license it might take a while.
I first want to sort out these problems (I'd need some help regarding multi platform support) and implement a small demo before releasing it. I guess the GameEngine SVN makes the most sense. Putting all the recastDetour libs in the dependencies folder and adding a small sample app.

Anyways, ....that's all rather off-topic. If you need any more specific help on your own implementation I'll try and help as I can.

Cheers

Author:  jacmy [ 22.11.2012, 11:27 ]
Post subject:  Re: Horde3d + SDL + recastnavigation, how to intergrate them

Thanks very much for your kindness!

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/