-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathHitboxPlugin.h
More file actions
executable file
·49 lines (44 loc) · 1.22 KB
/
HitboxPlugin.h
File metadata and controls
executable file
·49 lines (44 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include <memory>
#pragma comment( lib, "pluginsdk.lib" )
#include "bakkesmod/plugin/bakkesmodplugin.h"
#include "Hitbox.h"
/*
Colors the prediction line can have
*/
struct LineColor
{
unsigned char r, g, b, a; //rgba can be a value of 0-255
};
/*Predicted point in 3d space*/
struct PredictedPoint
{
/*Location of the predicted ball*/
Vector location;
/*States whether it as its highest point or bounces*/
bool isApex = false;
Vector apexLocation = { 0,0,0 };
Vector velocity;
Vector angVel;
};
class HitboxPlugin : public BakkesMod::Plugin::BakkesModPlugin
{
private:
std::shared_ptr<int> hitboxOn;
std::shared_ptr<int> hitboxType;
std::shared_ptr<LinearColor> hitboxColor;
LineColor colors[2] = { {0, 255, 0, 240}, {75, 0, 130, 240} };
std::vector<Hitbox> hitboxes;
public:
HitboxPlugin();
~HitboxPlugin();
virtual void onLoad();
virtual void onUnload();
void OnFreeplayLoad(std::string eventName);
void OnFreeplayDestroy(std::string eventName);
void OnHitboxOnValueChanged(std::string oldValue, CVarWrapper cvar);
void OnHitboxTypeChanged(std::string oldValue, CVarWrapper cvar);
void Render(CanvasWrapper canvas);
};
// utility function
Vector Rotate(Vector aVec, double roll, double yaw, double pitch);