diff --git a/Include/Core/Internal.hpp b/Include/Core/Internal.hpp index bbb9109..b4f8983 100644 --- a/Include/Core/Internal.hpp +++ b/Include/Core/Internal.hpp @@ -17,6 +17,8 @@ #include "Types/Convex.hpp" #include "Types/Area.hpp" #include "Types/Logger.hpp" +#include "Types/Triangle.hpp" +#include "Types/Wireframe.hpp" #include "JavaClass/ByteBuffer.hpp" #include "JavaClass/Canvas.hpp" diff --git a/Include/Core/Math.hpp b/Include/Core/Math.hpp index f26684d..3c76282 100644 --- a/Include/Core/Math.hpp +++ b/Include/Core/Math.hpp @@ -14,6 +14,7 @@ std::int32_t UniformRandom(std::int32_t Min, std::int32_t Max); double UniformRandom(); std::int32_t NormalRandom(std::int32_t Mean, double StandardDeviation); std::int32_t NormalRandom(std::int32_t Low, std::int32_t High, double PercentageDeviation); +void GetLine(Point A, Point B, std::vector* Res); std::vector ConvexHull(std::vector Points); /** @} */ diff --git a/Include/Core/Types/Triangle.hpp b/Include/Core/Types/Triangle.hpp new file mode 100644 index 0000000..65d01b3 --- /dev/null +++ b/Include/Core/Types/Triangle.hpp @@ -0,0 +1,21 @@ +#ifndef TRIANGLE_HPP +#define TRIANGLE_HPP + +#include "Point.hpp" + +class Triangle +{ + public: + Point A; + Point B; + Point C; + + Triangle(); + Triangle(const Point& A, const Point& B, const Point& C); + ~Triangle(); + + bool Contains(const Point& P) const; + +}; + +#endif // TRIANGLE_HPP diff --git a/Include/Core/Types/Wireframe.hpp b/Include/Core/Types/Wireframe.hpp new file mode 100644 index 0000000..6e06799 --- /dev/null +++ b/Include/Core/Types/Wireframe.hpp @@ -0,0 +1,31 @@ +#ifndef WIREFRAME_HPP +#define WIREFRAME_HPP + +#include +#include "Point.hpp" +#include "Triangle.hpp" +#include "Convex.hpp" +#include "Box.hpp" + +class Wireframe +{ + public: + Wireframe(); + Wireframe(const std::vector& Points); + ~Wireframe(); + + Point GetHybridRandomPoint(double ProbabilityX, double ProbabilityY, double StandardDeviationX, double StandardDeviationY, double PointGenAccuracy) const; + Point GetProfileHybridRandomPoint() const; + Point GetProfileHybridRandomPoint(double PointGenAccuracy) const; + Box GetBox() const; + Convex GetConvex() const; + bool Contains(const Point& P) const; + operator bool() const; + private: + std::vector Points; + std::vector Triangles; + Convex C; + Box B; +}; + +#endif // WIREFRAME_HPP diff --git a/Include/Game/Core.hpp b/Include/Game/Core.hpp index 2a14956..9bd8474 100644 --- a/Include/Game/Core.hpp +++ b/Include/Game/Core.hpp @@ -12,6 +12,7 @@ #include "Tools/RandomHandler.hpp" #include "Tools/Camera.hpp" #include "Tools/Pathfinding.hpp" +#include "Tools/Antiban.hpp" #include "Interfaces/Bank.hpp" #include "Interfaces/Chat.hpp" diff --git a/Include/Game/Interactable/DecorativeObject.hpp b/Include/Game/Interactable/DecorativeObject.hpp index 873e9c7..bcba902 100644 --- a/Include/Game/Interactable/DecorativeObject.hpp +++ b/Include/Game/Interactable/DecorativeObject.hpp @@ -7,6 +7,7 @@ #include "../../Core/Types/Point.hpp" #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Types/Wireframe.hpp" #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include @@ -24,6 +25,8 @@ namespace Interactable Internal::ObjectInfo GetInfo() const; std::vector GetModel() const; + Wireframe GetWireframe() const; + Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; diff --git a/Include/Game/Interactable/GameObject.hpp b/Include/Game/Interactable/GameObject.hpp index 2951c7f..42650f8 100644 --- a/Include/Game/Interactable/GameObject.hpp +++ b/Include/Game/Interactable/GameObject.hpp @@ -7,6 +7,7 @@ #include "../../Core/Types/Point.hpp" #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Types/Wireframe.hpp" #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include @@ -24,6 +25,8 @@ namespace Interactable Internal::ObjectInfo GetInfo() const; std::vector GetModel() const; + Wireframe GetWireframe() const; + Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; diff --git a/Include/Game/Interactable/GroundItem.hpp b/Include/Game/Interactable/GroundItem.hpp index aa3b7ff..7575f1a 100644 --- a/Include/Game/Interactable/GroundItem.hpp +++ b/Include/Game/Interactable/GroundItem.hpp @@ -7,6 +7,7 @@ #include "../../Core/Types/Point.hpp" #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Types/Wireframe.hpp" #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include @@ -27,6 +28,8 @@ namespace Interactable Internal::ItemInfo GetInfo() const; std::vector GetModel() const; + Wireframe GetWireframe() const; + Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; diff --git a/Include/Game/Interactable/GroundObject.hpp b/Include/Game/Interactable/GroundObject.hpp index 4cbadfb..7995d9a 100644 --- a/Include/Game/Interactable/GroundObject.hpp +++ b/Include/Game/Interactable/GroundObject.hpp @@ -7,6 +7,7 @@ #include "../../Core/Types/Point.hpp" #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Types/Wireframe.hpp" #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include @@ -24,6 +25,8 @@ namespace Interactable Internal::ObjectInfo GetInfo() const; std::vector GetModel() const; + Wireframe GetWireframe() const; + Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; diff --git a/Include/Game/Interactable/NPC.hpp b/Include/Game/Interactable/NPC.hpp index 790bc7c..95ab017 100644 --- a/Include/Game/Interactable/NPC.hpp +++ b/Include/Game/Interactable/NPC.hpp @@ -7,6 +7,7 @@ #include "../../Core/Types/Point.hpp" #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Types/Wireframe.hpp" #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include @@ -24,6 +25,8 @@ namespace Interactable Internal::NPCInfo GetInfo() const; std::vector GetModel() const; + Wireframe GetWireframe() const; + Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; diff --git a/Include/Game/Interactable/Player.hpp b/Include/Game/Interactable/Player.hpp index 44befe0..3d941ad 100644 --- a/Include/Game/Interactable/Player.hpp +++ b/Include/Game/Interactable/Player.hpp @@ -7,6 +7,7 @@ #include "../../Core/Types/Point.hpp" #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Types/Wireframe.hpp" #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include @@ -23,6 +24,8 @@ namespace Interactable Internal::PlayerInfo GetInfo() const; std::vector GetModel() const; + Wireframe GetWireframe() const; + Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; diff --git a/Include/Game/Interactable/WallObject.hpp b/Include/Game/Interactable/WallObject.hpp index 232e8c5..a1a7279 100644 --- a/Include/Game/Interactable/WallObject.hpp +++ b/Include/Game/Interactable/WallObject.hpp @@ -7,6 +7,7 @@ #include "../../Core/Types/Point.hpp" #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Types/Wireframe.hpp" #include "../../Core/Input.hpp" #include "../../Game/Tools/Camera.hpp" #include @@ -24,6 +25,8 @@ namespace Interactable Internal::ObjectInfo GetInfo() const; std::vector GetModel() const; + Wireframe GetWireframe() const; + Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; diff --git a/Include/Game/Tools/Antiban.hpp b/Include/Game/Tools/Antiban.hpp new file mode 100644 index 0000000..bd308c6 --- /dev/null +++ b/Include/Game/Tools/Antiban.hpp @@ -0,0 +1,11 @@ +#ifndef ANTIBAN_HPP_INCLUDED +#define ANTIBAN_HPP_INCLUDED + +class Antiban +{ + public: + static void LoseClientFocus(); + static void MouseOffClient(bool LoseFocus = true); +}; + +#endif // ANTIBAN_HPP_INCLUDED diff --git a/Library/libAlpacaLibrary.a b/Library/libAlpacaLibrary.a index d626ff9..a38252e 100644 Binary files a/Library/libAlpacaLibrary.a and b/Library/libAlpacaLibrary.a differ