imaj_ashwini's Blog

Week 4 blog

imaj_ashwini
Published: 06/22/2020

Hello everyone,

We are into the fourth week now, and closing into the first month. Last week, I rearranged all my functions and classes so that it becomes more readable, organised and clean. Now the main classes and the funtions involved in the integration of recast/detour into Panda3D are:

  • NavMesh
    • It stores the navigation mesh generated by NavMeshBuilder class.
    • It can called as an object, or more Panda3D specifically, as PT(NavMesh) object, which is Panda3D's own Pointer declaration.
  • NavMeshBuilder
    • It takes the nodepath as input from the user. 
    • It builds the polygon mesh, polygon detailed mesh and navigation mesh (which is then stored in class NavMesh).
    • It has a function to draw the polygon mesh generated, which may be helpful for the user for debugging purposes.
    • The user can set the properties of the actor, so that the NavMeshBuilder accounts for it while building the meshes.
  • NavMeshNode
    • This class inherits from PandaNode and hence allows handling of relative coordinate system.
  • NavMeshQuery
    • This class has the query functions.
    • Query functions are processed over the class NavMesh objects, which contain the generated navigation mesh.
    • Query functions include the following:
      • Given an input point, a function can return the point nearest to it and on the navigation mesh.
      • Given two input points, a function can return the array of points which form the path between those two points (this function is yet to be added).

Apart from these classes, the exposed functions are included as PUBLISHED. This now, I would be working on cleaning up of code for better readability and adjusting to Panda3D's coding style. Also, changes are required in order to make the library available in python environment.

For all of this to happen, the mentors have really helped me a lot. So a huge shout out to them. Thank you @rdb and @moguri :D 

Meet you all next week!

Stay safe, Thank you.

View Blog Post

Week 3 checkin

imaj_ashwini
Published: 06/15/2020

Hey everyone

So 2 weeks have already passed and we are into the third week now. Last week I shared about my progess about polymesh generation. The next step was basically polymesh detail generation, which was pretty simple and did not require much effort. Along with that, I managed to draft a PR, over which the mentors suggested a lot of changes, mostly related to code styling and naming of variables, members, functions and classes. I edited the code, and since there are many variables involved, that process took some time (Yeah, I obviously tried Find and Replace XD).
Also, I added functions to generate polymesh as per the properties of the actor/agent. For example, set_actor_height(float h) would generate polymesh such that polygons with verticle space of size less than actor's height 'h' would not be add to the polymesh. Similarly, set_actor_radius(float r) does the same work, but here regarding area covered by the actor. Some other functions included are: set_actor_max_climb(), set_actor_max_slope(), etc... 
Also, I have started working on off-mesh-connection-tool which would connect separate geometries (example islands). Hopefully, by this week I would be able to complete this feature. Also, I aim to add NavMeshQuery class this week..

If you compare both the images, the first is the polymesh generation for actor_height = 1.0 while second is polymesh generation for actor_height = 10.0. As suggested by the red marker in the second image, the space between the roof and floor of the marked part is less than 10 units, so for actor_height = 10, it was not included in the generated polymesh. In a similar way, other functions also affect the polymesh.

PS: sorry if you don't like the colours used, I was just having some fun XD. 

Thank you. Have a great and safe week!

View Blog Post

Week 2 blog!

imaj_ashwini
Published: 06/08/2020

Hello everyone,

Its me again. Excited to share my progress this week with you all. There was a lot of coding involved this week. I coded three classes in order to generate a polymesh using the recast tools directly through the panda3d interface. First I coded for any .obj file to be loaded into a polymesh, but later changed it to load polymesh from any geometry stored in the NodePath. A lot of time was spent on debugging and stuffs. Properly converting Z-up coordinate system to Y-up coordinate system and vice versa, drawing the output polymesh using GeomNode, understanding how exactly GeomNode and various other Panda3D tools work, proper knowledge of recast library were very essential to get the code compile and run successfully. Here is a 3D model form Panda3D sample directory called roaming-ralph and corresponding output for polymesh (the walkable surface) is shown in red. 

             

Apart from the main coding part, building the recast library and my classes with panda3d is also important. This was one place I stuck for a long long time and everytime my mentors helped me out. So, though I might be troubling them for this part, but I got to learn a lot from them. So a big thanks to them for how they helped me this whole week

For future work, I have a lot of stuff lined up. I have drafted a PR. My mentors will ask me to do some necessary changes within a day or two. Apart from that, NavMesh generation and Detour integration are main challenges of the journey in the coming weeks. 

Thanks for reading the blog

Stay safe

View Blog Post

Week 1 check-in

imaj_ashwini
Published: 06/01/2020

Hello

Welcome to my blog. I am participating in this year's GSoC program for Panda3D - a suborgansiation under PSF. Today is the start of the coding period. Its 7:00 am in India here and I am starting this memorable day by writing my first blog here on this forum. I have been assigned the task to integrate Recast & Detour tools in Panda3D game engine. Already excited by the project idea, I started playing with the tools of Panda3D during the community bonding period. I did go through a lot of blogs and articles about "recastnavigation", which is the github repository that provides the Recast and Detour tools. Well, this was pretty much what I did in the previous month, but now starts the actual coding period. I plan to start by planning the classes and functions required to bring recast into the Panda3D world.

So yeah, I am very much excited to let you guys how all of it unfolds.

Let's start the journey! 

View Blog Post