MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / UnitVector

Class UnitVector

include/Core/Transform/UnitVector.hpp:15–263  ·  view source on GitHub ↗

* \brief Class widely used in the Engine to scale and position elements in * a Scene * \bind{Vector2} */

Source from the content-addressed store, hash-verified

13 * \bind{Vector2}
14 */
15 class UnitVector
16 {
17 public:
18 /**
19 * \nobind
20 * \brief Initialize the conversion module (Step 1) by passing the
21 * pointer to the ViewStruct
22 */
23 static void Init(ViewStruct*&);
24 /**
25 * \nobind
26 * \brief Initialize the conversion module (Step 2) by passing the
27 * values of the ScreenSize
28 * \param width Width of the screen
29 * \param height Height of the screen
30 */
31 static void Init(int width, int height);
32
33 /**
34 * \brief Struct used for UnitVector conversions, do not modify !
35 */
36 static ViewStruct View;
37 /**
38 * \brief Struct used for UnitVector conversions, do not modify !
39 */
40 static ScreenStruct Screen;
41
42 /**
43 * \brief Constructor of UnitVector
44 * \param unit Unit of the UnitVector
45 */
46 explicit UnitVector(Units unit = Units::SceneUnits);
47 /**
48 * \brief Constructor (with x, y) of UnitVector
49 * \param x x Coordinate of the UnitVector
50 * \param y y Coordinate of the UnitVector
51 * \param unit Unit of the UnitVector
52 */
53 UnitVector(double x, double y, Units unit = Units::SceneUnits);
54
55 /**
56 * \brief x Coordinate of the UnitVector (related to Unit)
57 */
58 double x = 0.0;
59 /**
60 * \brief y Coordinate of the UnitVector (related to Unit)
61 */
62 double y = 0.0;
63 /**
64 * \brief Unit of the UnitVector
65 */
66 Units unit;
67
68 /**
69 * \brief Set the values of the given UnitVector but keeps base Unit
70 * \param vec UnitVector containing the new values
71 */
72 void set(const UnitVector& vec);

Callers 15

LoadClassRectFunction · 0.85
LoadClassUnitVectorFunction · 0.85
getSizeMethod · 0.85
getPositionMethod · 0.85
getHandlePointMethod · 0.85
getRectMethod · 0.85
moveToMethod · 0.85
getSizeMethod · 0.85
getSizeMethod · 0.85
getPointPositionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected