Quark Physics  1.0
2D Rigid and Soft Body Physics Engine
qgizmos.h
1 
2 /************************************************************************************
3  * MIT License
4  *
5  * Copyright (c) 2023 Eray Zesen
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  *
24  * https://github.com/erayzesen/QuarkPhysics
25  *
26 **************************************************************************************/
27 
28 #ifndef QGIZMOS_H
29 #define QGIZMOS_H
30 #include "qvector.h"
31 #include "qaabb.h"
32 
33 class QGizmo
34 {
35  public :
36  enum GizmoTypes{
37  Circle,
38  Line,
39  Rectangle
40  };
41  protected:
42  GizmoTypes gizmoType=GizmoTypes::Circle;
43  public:
44 
45  QGizmo(){
46 
47  };
48  virtual ~QGizmo(){}
49 
50  GizmoTypes GetGizmoType(){
51  return gizmoType;
52  }
53 };
54 class QGizmoCircle:public QGizmo{
55  public:
56  float radius=0.0f;
57  QVector position=QVector::Zero();
58  QGizmoCircle(QVector pos,float rad ){
59  position=pos;
60  radius=rad;
61  gizmoType=GizmoTypes::Circle;
62  }
63 };
64 
65 class QGizmoLine:public QGizmo{
66  public:
67  QVector pointA=QVector::Zero();
68  QVector pointB=QVector::Zero();
69  bool isArrow;
70  QGizmoLine(QVector from,QVector to,bool arrow=false ){
71  pointA=from;
72  pointB=to;
73  isArrow=arrow;
74  gizmoType=GizmoTypes::Line;
75  }
76 };
77 
78 class QGizmoRect:public QGizmo{
79  public:
80  QAABB rect;
81 
82  QGizmoRect( QAABB rectangle ){
83  rect=rectangle;
84  gizmoType=GizmoTypes::Rectangle;
85  }
86 };
87 
88 
89 
90 #endif // QGIZMOS_H
Definition: qaabb.h:34
Definition: qgizmos.h:54
Definition: qgizmos.h:65
Definition: qgizmos.h:78
Definition: qgizmos.h:34
Definition: qvector.h:44