SpiecsEngine
 
Loading...
Searching...
No Matches
MouseButtonCodes.h
Go to the documentation of this file.
1/**
2* @file MouseButtonCodes.h.
3* @brief The MouseButtonCodes Class Definitions.
4* @author The Cherno.
5*/
6
7#pragma once
8#include "Core/Core.h"
9
10namespace Spices
11{
12 /**
13 * @brief Helper Type instead uint16_t.
14 */
15 using MouseCode = uint16_t;
16
17 namespace Mouse
18 {
19
20 /**
21 * @brief Key Code enum same as glfw Mouse Code.
22 */
23 enum : MouseCode
24 {
33
38
39 };
40
41 }
42
43}
#define BIND_EVENT_FN(x)
Bind Event.
Definition Event.h:88
#define SPICES_PROFILE_ZONE
virtual void OnEvent(Event &e) override
The interface inherited from NativeScriptComponent, which is called on the global event function poin...
glm::vec3 GetForwardDirection() const
Get Camera Forward(z) Direction.
uint32_t m_ViewportWidth
The Viewport size.
glm::vec3 GetUpDirection() const
Get Camera Up(y) Direction.
bool OnKeyPressed(KeyPressedEvent &e)
Event OnKeyPressed. We do nothing here.
bool OnMouseScroll(MouseScrolledEvent &e)
Event OnMouseScroll. Scale the camera.
void MousePan(const glm::vec2 &delta)
Calculate Camera Drag.
void MouseZoom(const float &delta)
Calculate Camera Zoom.
void UpdateView() const
Setting camera transform component position. We already set rotation in MouseRotate().
std::pair< float, float > PanSpeed() const
Calculate Camera Drag speed.
glm::quat GetOrientation() const
Get Camera quaternion rotation.
void MouseRotate(const glm::vec2 &delta) const
Calculate Camera Rotate.
virtual void OnConstruction() override
The interface inherited from NativeScriptComponent, which is called on this attached to an entity....
bool OnSlateResized(SlateResizeEvent &e)
Event OnWindowResized. Reset Camera aspect ratio.
float ZoomSpeed() const
Calculate Camera Zoom speed.
float m_Distance
The camera spring arm. Init with 10.
glm::vec3 GetRightDirection() const
Get Camera Right(x) Direction.
TransformComponent * m_CameraTranComp
The camera transform component pointer get from owner's transform component.
glm::vec3 CalculatePosition() const
Calculate camera transform component position using the class member parameters.
virtual void OnTick(TimeStep &ts) override
The interface inherited from NativeScriptComponent, which is called every engine loop frame....
float RotationSpeed() const
Calculate Camera Rotate speed.
float m_ZoomLevel
Zoom Level, for orthographic type camera.
CameraController Class. This class inherit from NativeScriptComponent. It receives Mouse Event and Ke...
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 bool IsKeyPressed(const int &keycode)
Query If given Key is Pressed.
Definition Input.h:34
static bool IsMouseButtonPressed(const int &button)
Query If given Mouse Button is Pressed.
Definition Input.h:41
This Class Is a wrapper of Platform Specific Input Query.
Definition Input.h:16
This Class is inherited from KeyEvent Class.
Definition KeyEvent.h:57
const float & GetYOffset() const
Get Mouse offset in Y.
Definition MouseEvent.h:114
This Class is inherited from Event Class.
Definition MouseEvent.h:86
const uint32_t & GetHeight() const
Get New Viewport Height.
Definition SlateEvent.h:46
const uint32_t & GetWidth() const
Get New Viewport Width.
Definition SlateEvent.h:40
This Class is inherited from Event Class. Called by Viewport Resize.
Definition SlateEvent.h:18
This Class handles our engine time step during frames. Global Unique.
Definition TimeStep.h:22
TransformComponent Class. This class defines the specific behaves of TransformComponent.