When you want to run your code after camera moves smoothly by clicking Navigation Cube, you can create your own handler for SmoothTransitionCompleteEvent
.
As you can see MyErrorHandler
in mfc_sandbox, you can create your handler for SmoothTransitionCompleteEvent
in the same way.
class MyHandler : public HPS::EventHandler
{
public:
MyHandler() : HPS::EventHandler() {}
virtual ~MyHandler() { Shutdown(); }
// Override to provide behavior for an event
virtual HandleResult Handle(HPS::Event const* in_event)
{
ASSERT(in_event != NULL);
HPS::SmoothTransitionCompleteEvent const* error = static_cast<HPS::SmoothTransitionCompleteEvent const*>(in_event);
HPS::UTF8 msg = HPS::UTF8("SmoothTransitionCompleteEvent\n");
HPS::WCharArray wmsg;
msg.ToWStr(wmsg);
OutputDebugString(&wmsg[0]);
return HandleResult::Handled;
}
};
// Subscribe _myHandler to handle SmoothTransitionCompleteEvent
HPS::Database::GetEventDispatcher().Subscribe(_myHandler, HPS::Object::ClassID<HPS::SmoothTransitionCompleteEvent>());
Note that SmoothTransitionCompleteEvent will be triggered not only by Navigation Cube.
HPS::View::SmoothTransition
also trigger this event and your event handler is called.
You can find more information :
https://docs.techsoft3d.com/hps/latest/prog_guide/1001_event_handling.html