11#ifndef ZOAPPQUERYCLICK_H
12#define ZOAPPQUERYCLICK_H
14#include "toymaker/camera_system.hpp"
15#include "toymaker/sim_system.hpp"
16#include "toymaker/input_system/input_system.hpp"
52 std::shared_ptr<BaseSimObjectAspect>
clone()
const override;
60 static std::shared_ptr<BaseSimObjectAspect>
create(
const nlohmann::json& jsonAspectProperties);
117 return this->
onLeftClick(actionData, actionDefinition);
The interface used by aspects, objects, which cast pointer rays to interact with objects present in t...
Definition interface_pointer_callback.hpp:35
bool onLeftClick(const ToyMaker::ActionData &actionData, const ToyMaker::ActionDefinition &actionDefinition)
Method responsible for calling left mouse button press callbacks on eligible objects when a pointer c...
Definition query_click.cpp:65
bool onLeftRelease(const ToyMaker::ActionData &actionData, const ToyMaker::ActionDefinition &actionDefinition)
Method responsible for calling left mouse button release callbacks on eligible objects when a pointer...
Definition query_click.cpp:100
QueryClick()
Constructs a new Query Click aspect.
Definition query_click.hpp:141
std::vector< std::shared_ptr< ToyMaker::SceneNodeCore > > mPreviousQueryResults
A list of results from previous pointer queries.
Definition query_click.hpp:159
std::weak_ptr< ToyMaker::FixedActionBinding > handlerLeftClick
The binding connecting the pointer left click action to its handler method on this object.
Definition query_click.hpp:112
bool onPointerMove(const ToyMaker::ActionData &actionData, const ToyMaker::ActionDefinition &actionDefinition)
Method responsible for calling hover callbacks when a pointer move event is received.
Definition query_click.cpp:134
static std::string getSimObjectAspectTypeName()
Gets the aspect type string associated with this class.
Definition query_click.hpp:45
static std::shared_ptr< BaseSimObjectAspect > create(const nlohmann::json &jsonAspectProperties)
Creates a query click object based on its description in JSON.
Definition query_click.cpp:60
std::shared_ptr< BaseSimObjectAspect > clone() const override
Creates a new query click aspect using this one as its blueprint.
Definition query_click.cpp:56
ToyMaker::Ray rayFromClickCoordinates(glm::vec2 clickCoordinates)
Converts the location of a pointer event from its normalized viewport coordinates to a camera relativ...
Definition query_click.cpp:8
std::weak_ptr< ToyMaker::FixedActionBinding > handlerPointerMove
The binding connecting the pointer move action to its handler method on this object.
Definition query_click.hpp:98
std::weak_ptr< ToyMaker::FixedActionBinding > handlerLeftRelease
The binding connecting the pointer left release action to its handler method on this object.
Definition query_click.hpp:126
std::weak_ptr< FixedActionBinding > declareFixedActionBinding(const std::string &context, const std::string &action, std::function< bool(const ActionData &, const ActionDefinition &)>)
Binds some method (or any function) present on this object to an action generated by the InputManager...
Definition sim_system.cpp:219
An object containing closely related methods and data, and exposing object lifecycle and application ...
Definition sim_system.hpp:956
Contains classes that serve as interfaces for sim objects that wish to respond to click events.
The definition of a single action, including whether it represents state or change,...
Definition input_data.hpp:511
A union that may contain any one of SimpleActionData, OneAxisActionData, TwoAxisActionData,...
Definition input_data.hpp:721