Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
Loading...
Searching...
No Matches
IPickable.h
Go to the documentation of this file.
1
6#pragma once
7#include <math/Ray.h>
8#include <optional>
9
28class IPickable {
29public:
33 virtual ~IPickable() = default;
34
70 virtual std::optional<float> intersectsRay(const Math::Ray& ray) const = 0;
71
91 virtual void handleClick(const Math::Ray& ray, float distance) = 0;
92
108 virtual void setHovered(bool hovered) = 0;
109
115 virtual bool getHovered() const = 0;
116
133 virtual uint32_t getObjectID() const = 0;
134};
Abstract interface for objects that can be selected and interacted with using the mouse.
Definition IPickable.h:28
virtual uint32_t getObjectID() const =0
Gets the unique identifier for this object.
virtual std::optional< float > intersectsRay(const Math::Ray &ray) const =0
Tests if a ray intersects this object's geometry.
virtual void setHovered(bool hovered)=0
Sets the hover state of this object.
virtual void handleClick(const Math::Ray &ray, float distance)=0
Handles a mouse click on this object.
virtual ~IPickable()=default
Virtual destructor for proper cleanup of derived classes.
virtual bool getHovered() const =0
Gets the current hover state of this object.
Represents a ray in 3D space.
Definition Ray.h:11