Nox Engine
 
Loading...
Searching...
No Matches
MouseTracker.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "Collider.h"
9#include "ECS.h"
10#include "Transform.h"
11
17struct MouseTracker : public Component {
18public:
21
25 void init() override;
29 void update() override;
33 void reload() override;
34
39 static const bool getMouseButtonPressed();
40
41private:
42 Transform* transform;
43 Collider* collider;
44 static bool isPressed;
45};
Defines a component for collision detection.
Defines the core classes for the Entity-Component-System (ECS) architecture.
Defines the component for managing an entity's position, rotation, and scale.
Provides an entity with a physical bounding box for collision detection.
Definition Collider.h:22
The base class for all components in the ECS.
Definition ECS.h:53
A component attached to an entity that follows the mouse cursor.
Definition MouseTracker.h:17
void init() override
Initializes the component by getting the entity's transform and collider.
Definition MouseTracker.cpp:12
void reload() override
Resets the mouse pressed state.
Definition MouseTracker.cpp:24
static const bool getMouseButtonPressed()
Gets the current state of the primary mouse button.
Definition MouseTracker.cpp:28
void update() override
Updates the entity's position to match the mouse cursor's current coordinates.
Definition MouseTracker.cpp:18
Stores an entity's position, velocity, scale, and rotation.
Definition Transform.h:17