Rotation works
This commit is contained in:
parent
4a4456524f
commit
8a36bc4b6d
5 changed files with 103 additions and 22 deletions
|
|
@ -16,15 +16,19 @@ class DrawingProgramSelection {
|
|||
private:
|
||||
bool mouse_collided_with_selection_aabb();
|
||||
bool mouse_collided_with_scale_point();
|
||||
bool mouse_collided_with_rotate_center_handle_point();
|
||||
bool mouse_collided_with_rotate_handle_point();
|
||||
|
||||
void calculate_aabb();
|
||||
void calculate_initial_rotate_center_location();
|
||||
void rebuild_cam_space();
|
||||
|
||||
Vector2f get_rotation_point_pos_from_angle(double angle);
|
||||
|
||||
SCollision::AABB<WorldScalar> initialSelectionAABB;
|
||||
SCollision::ColliderCollection<float> camSpaceSelection;
|
||||
|
||||
WorldVec selectionRectMin;
|
||||
WorldVec selectionRectMax;
|
||||
std::array<WorldVec, 4> selectionRectPoints;
|
||||
|
||||
CoordSpaceHelper selectionTransformCoords;
|
||||
std::unordered_set<CollabListType::ObjectInfoPtr> selectedSet;
|
||||
|
|
@ -35,14 +39,23 @@ class DrawingProgramSelection {
|
|||
NONE = 0,
|
||||
TRANSLATE,
|
||||
SCALE,
|
||||
ROTATE_RELOCATE_CENTER,
|
||||
ROTATE
|
||||
} transformOpHappening;
|
||||
} transformOpHappening = TransformOperation::NONE;
|
||||
|
||||
CoordSpaceHelper startingSelectionTransformCoords;
|
||||
|
||||
struct ScaleData {
|
||||
CoordSpaceHelper startingSelectionTransformCoords;
|
||||
WorldVec startPos;
|
||||
WorldVec centerPos;
|
||||
WorldVec currentPos;
|
||||
Vector2f handlePoint;
|
||||
} scaleData;
|
||||
|
||||
struct RotationData {
|
||||
WorldVec centerPos;
|
||||
Vector2f centerHandlePoint;
|
||||
Vector2f handlePoint;
|
||||
double rotationAngle;
|
||||
} rotateData;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue