SpiecsEngine
 
Loading...
Searching...
No Matches
WorldPickIDQuerier.h
Go to the documentation of this file.
1/**
2* @file WorldPickIDQuerier.h.
3* @brief The WorldPickIDQuerier Definitions.
4* @author Spices.
5*/
6
7#pragma once
8#include "Core/Core.h"
9#include "NativeScript.h"
10#include "Core/Event/MouseEvent.h"
11
12namespace Spices {
13
14 /**
15 * @brief Forward declare.
16 */
17 class ImguiViewport;
18
19 /**
20 * @brief Script of handle world entity pick.
21 */
23 {
24 public:
25
26 /**
27 * @brief Constructor Function.
28 */
29 WorldPickIDQuerier() = default;
30
31 /**
32 * @brief Destructor Function.
33 */
34 virtual ~WorldPickIDQuerier() override = default;
35
36 /**
37 * @brief This interface defines the behave on specific component tick every frame.
38 * @param[in] ts TimeStep.
39 */
40 virtual void OnTick(TimeStep& ts) override {};
41
42 /**
43 * @brief This interface defines the behave on specific component event happened.
44 * @param[in] e Event.
45 */
46 virtual void OnEvent(Event& e) override;
47
48 private:
49
50 /**
51 * @brief Event OnKeyPressed.
52 * @param[in] e Event Wrapper.
53 * @return true if we need block the event.
54 */
56
57 private:
58
59 /**
60 * @brief World Picked entity id (only use channel 0).
61 */
62 float m_WorldPickID[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
63
64 /**
65 * @brief viewport pointer.
66 */
67 std::weak_ptr<ImguiViewport> m_ViewPort;
68 };
69}
#define BIND_EVENT_FN(x)
Bind Event.
Definition Event.h:88
#define SPICES_PROFILE_ZONE
Entity Class. This class defines the specific behaves of Entity.
Definition Entity.h:20
EventDispatcher(Event &event)
Constructor Function.
Definition Event.h:172
This Class store a Specific Event type first and Dispatch a event handle function to it.
Definition Event.h:156
This Class is the basic Event Class. Inherit from it and create specific event class.
Definition Event.h:96
static FrameInfo & Get()
Get FrameInfo.
Definition FrameInfo.cpp:14
FrameInfo Class. This class defines the FrameInfo data.
Definition FrameInfo.h:32
The ImguiViewport Class. This class defines how to render a viewport.
static bool IsKeyPressed(const int &keycode)
Query If given Key is Pressed.
Definition Input.h:34
This Class Is a wrapper of Platform Specific Input Query.
Definition Input.h:16
const int & GetMouseButton() const
Destructor Function.
Definition MouseEvent.h:167
This Class is inherited from Event Class.
Definition MouseEvent.h:194
Native C++ Script Class.
TagComponent Class. This class defines the specific behaves of TagComponent.
This Class handles our engine time step during frames. Global Unique.
Definition TimeStep.h:22
virtual void OnTick(TimeStep &ts) override
This interface defines the behave on specific component tick every frame.
virtual ~WorldPickIDQuerier() override=default
Destructor Function.
WorldPickIDQuerier()=default
Constructor Function.
bool OnMouseButtonPressed(MouseButtonPressedEvent &e)
Event OnKeyPressed.
std::weak_ptr< ImguiViewport > m_ViewPort
viewport pointer.
float m_WorldPickID[4]
World Picked entity id (only use channel 0).
virtual void OnEvent(Event &e) override
This interface defines the behave on specific component event happened.
Script of handle world entity pick.