A specialized camera object for use within the editor, supporting free-fly movement and input processing.
More...
#include <EditorCamera.hpp>
|
| | EditorCameraObject (vex::Engine &engine, const std::string &name, SDL_Window *window) |
| | Constructs an EditorCameraObject.
|
| void | processEvent (const SDL_Event &event, float deltaTime) |
| | Processes SDL events specific to the editor camera (e.g., mouse movement, key presses).
|
| void | Update (float deltaTime) override |
| | Overrides the base GameObject Update for continuous camera movement and logic.
|
| void | setViewportHovered (bool hovered) |
| | Sets whether the editor's viewport window is currently being hovered by the mouse.
|
| | CameraObject (Engine &engine, const std::string &name) |
| | GameObject (Engine &engine, const std::string &name) |
| | Default constructor for GameObject.
|
| void | Destroy () |
| | Destroys the GameObject and removes it from the engine's registry.
|
| virtual | ~GameObject () |
| | Destructor.
|
|
| GameObject (const GameObject &)=delete |
|
GameObject & | operator= (const GameObject &)=delete |
| | GameObject (GameObject &&other) noexcept |
| virtual void | BeginPlay () |
| | virtual void function you override to implement custom behavior when the game starts.
|
| vex::Entity | GetEntity () const |
| | Function that returns entity object, which is the entity associated with this GameObject. Its mostly needed for parenting and other engine internal usage.
|
| Engine & | GetEngine () |
| | Function that returns engine reference allowing your custom Object to use engine provided methods.
|
| template<typename T> |
| T & | GetComponent () |
| | Function that returns reference to a requested component.
|
| template<typename T> |
| void | AddComponent (const T &comp) |
| | Function that adds a component to the GameObject.
|
| template<typename T> |
| bool | HasComponent () const |
| | Function that checks if the GameObject has a component.
|
| bool | isValid () const |
| void | ParentTo (vex::Entity entity) |
| | Function that parent this Object to another GameObject. You need to pass another GameObject's entity.
|
| void | setObjectType (const std::string &type) |
| | Function that sets the type of the GameObject.
|
| const std::string & | getObjectType () const |
| | Function that returns the type of the GameObject.
|
A specialized camera object for use within the editor, supporting free-fly movement and input processing.
Definition at line 16 of file EditorCamera.hpp.
◆ EditorCameraObject()
| EditorCameraObject::EditorCameraObject |
( |
vex::Engine & | engine, |
|
|
const std::string & | name, |
|
|
SDL_Window * | window ) |
Constructs an EditorCameraObject.
- Parameters
-
| vex::Engine& | engine - Reference to the core engine instance. |
| const | std::string& name - The name of the camera object. |
| SDL_Window* | window - The main SDL window pointer, used for input handling. |
Definition at line 6 of file EditorCamera.cpp.
◆ processEvent()
| void EditorCameraObject::processEvent |
( |
const SDL_Event & | event, |
|
|
float | deltaTime ) |
Processes SDL events specific to the editor camera (e.g., mouse movement, key presses).
- Parameters
-
| const | SDL_Event& event - The SDL event to process. |
| float | deltaTime - Time elapsed since the last frame. |
Definition at line 14 of file EditorCamera.cpp.
◆ setViewportHovered()
| void EditorCameraObject::setViewportHovered |
( |
bool | hovered | ) |
|
|
inline |
Sets whether the editor's viewport window is currently being hovered by the mouse.
- Parameters
-
| bool | hovered - True if the viewport is hovered, false otherwise. |
Definition at line 39 of file EditorCamera.hpp.
◆ Update()
| void EditorCameraObject::Update |
( |
float | deltaTime | ) |
|
|
overridevirtual |
Overrides the base GameObject Update for continuous camera movement and logic.
- Parameters
-
| float | deltaTime - Time elapsed since the last frame. |
Reimplemented from vex::GameObject.
Definition at line 54 of file EditorCamera.cpp.
◆ keyStates
| std::unordered_map<SDL_Scancode, bool> EditorCameraObject::keyStates |
|
private |
◆ m_isFlying
| bool EditorCameraObject::m_isFlying = false |
|
private |
◆ m_mouseSensitivity
| float EditorCameraObject::m_mouseSensitivity = 0.1f |
|
private |
◆ m_movementSpeed
| float EditorCameraObject::m_movementSpeed = 50.0f |
|
private |
◆ m_viewportHovered
| bool EditorCameraObject::m_viewportHovered = false |
|
private |
◆ m_window
| SDL_Window* EditorCameraObject::m_window |
|
private |
The documentation for this class was generated from the following files: