Horde3D

Next-Generation Graphics Engine
It is currently 17.05.2024, 21:38

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 16.11.2012, 09:35 
Offline

Joined: 21.10.2012, 15:32
Posts: 18
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.


Top
 Profile  
Reply with quote  
PostPosted: 18.11.2012, 22:14 
Offline

Joined: 23.07.2009, 21:03
Posts: 51
Location: Germany
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


Top
 Profile  
Reply with quote  
PostPosted: 22.11.2012, 11:27 
Offline

Joined: 21.10.2012, 15:32
Posts: 18
Thanks very much for your kindness!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group