Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
Loading...
Searching...
No Matches
ScaleHandle.h
Go to the documentation of this file.
1#pragma once
2#include "IHandle.h"
4
5class ScaleHandle : public IHandle{
6public:
8
9 void onDrag(const Math::Ray& ray) override;
10 void setDragState(glm::vec3 initHitPos) override;
11 glm::mat4 getModelMatrix() const override;
12 glm::vec3 getAxisDir() const override { return axisDir(axis); }
13
14private:
15 SceneObject* target;
16 Axis axis;
17
18 constexpr static float thickness = 0.5f;
19 constexpr static float length = 1.0f;
20
21 glm::vec3 initialHitPoint;
22 glm::vec3 originalScale;
23};
Axis
Cardinal axes for handle orientation.
Definition Axis.h:7
Interface for interactive manipulation handles on gizmos.
constexpr glm::vec3 axisDir(Axis a)
Converts an axis enum to its corresponding unit vector.
Definition IHandle.h:17
Abstract interface for gizmo manipulation handles.
Definition IHandle.h:47
glm::vec3 getAxisDir() const override
Gets the axis direction this handle operates along/around.
Definition ScaleHandle.h:12
void setDragState(glm::vec3 initHitPos) override
Initializes the drag operation state.
void onDrag(const Math::Ray &ray) override
Handles continuous dragging motion.
glm::mat4 getModelMatrix() const override
Gets the model transformation matrix for rendering this handle.
Represents a ray in 3D space.
Definition Ray.h:11