Hi.
My overarching idea is to have a n*n grid of hex tiles which an AI agent will then navigate to a goal tile on.
The main point is that the user can specify the tile type. I.E. there will be mountains, hills, plains etc.
They specify this by clicking on the tile, which then changes to the next type.
What Ogre objects should I be using for this?
The reason I ask is that static geometry won't work due to the individual tiles being unattainable, however individual scene nodes will be excessive for them.
I am using the raycasting to the polygon level algorithm given here: http://wiki.ogre3d.org/Raycasting+to+the+polygon+level
Pickable (mouse clicking) hex tiles.
-
- OGRE Expert User
- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: Pickable (mouse clicking) hex tiles.
I think raycast to polygon is overkill for something like a tile... tiles are almost perfect fit of its bounding box, so a simple raycast should work. you are right in the fact that would be a lot of scene nodes, but if they are static should be no problem (at least in Ogre 2.X)
-
- OGRE Team Member
- Posts: 2151
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1156
Re: Pickable (mouse clicking) hex tiles.
this is the best thing you can do.Natalo77 wrote: Thu Apr 25, 2019 8:00 pm I am using the raycasting to the polygon level algorithm given here: http://wiki.ogre3d.org/Raycasting+to+the+polygon+level
Even in 2.x creating an item for the 4 triangles of your hex tile would waste a lot of memory as the meta-data would by far out-weight the actual data. Also testing against 6 sides of an AABB requires more computation (besides not being a good fit for a hex tile).