Adding navigation targets to the map
Before we start, let us imagine which properties a possible navigation target must have:
- It should come in any shape and number.
- It should be easy to select and move around.
- It can be placed anywhere on the ground.
- Ideally, it should be able to move by itself.
So, our ideal target is a model instance! And since we already have all the ingredients for this list, implementing navigation targets becomes easy.
Adjusting model and instance
First, we add a new Boolean variable named msUseAsNavigationTarget
to the ModelSettings
struct:
bool msUseAsNavigationTarget = false;
The AssimpModel
class also needs two simple public
methods named setAsNavigationTarget()
and isNavigationTarget()
to set and query the new variable:
void setAsNavigationTarget(bool value);
bool isNavigationTarget();
In the UserInterface
class, a checkbox will be added to set the state of a model with a simple...