new widgets

This commit is contained in:
IlyaShurupov 2024-06-19 22:17:18 +03:00
parent 3dce41ea39
commit 8f62c8f387
18 changed files with 373 additions and 43 deletions

View file

@ -30,9 +30,16 @@ namespace tp {
public:
void lookAtPoint(const Vec3F& aTarget, const Vec3F& aPos, Vec3F aUp);
void rotate(halnf anglex, halnf angleY);
// -1 -1 is top left 1 1 is bottom right
void move(Vec2F aPos, Vec2F aPrevPos);
// keeps z axis above your head
void rotate(halnf anglex, halnf angleY);
// -1 -1 is top left 1 1 is bottom right
void zoom(halnf ratio);
void offset_target(halnf val);
public:

View file

@ -159,6 +159,10 @@ namespace tp {
size = p3 - pos;
}
Rect<Type> shrink(Type val) const {
return { pos + val, size - val * 2 };
}
// if only one point isInside
bool clampOutside(Vec2<Type>& v1, Vec2<Type>& v2) {
bool const in1 = isInside(v1);