-
Notifications
You must be signed in to change notification settings - Fork 2
/
BendItPlugin.h
executable file
·54 lines (49 loc) · 1.44 KB
/
BendItPlugin.h
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
50
51
52
53
54
#pragma once
#include <memory>
#pragma comment( lib, "bakkesmod.lib" )
#include "bakkesmod/plugin/bakkesmodplugin.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 BendItPlugin : public BakkesMod::Plugin::BakkesModPlugin
{
private:
Vector lastAppliedMagnusEffect = { 0,0,0 };
std::shared_ptr<bool> curveOn;
std::shared_ptr<bool> debug;
std::shared_ptr<float> dragCoeff, liftCoeff;
std::shared_ptr<bool> lineOn;
std::shared_ptr<int> forceMode;
std::shared_ptr<float> zMultiplier;
std::shared_ptr<float> maxSpin;
std::shared_ptr<bool> groundTurn;
LineColor colors[2] = { { 0, 255, 0, 240 },{ 75, 0, 130, 240 } };
int count;
public:
BendItPlugin();
~BendItPlugin();
virtual void onLoad();
virtual void onUnload();
void OnFreeplayLoad(std::string eventName);
void OnMaxSpinChange(std::string eventName);
void OnFreeplayDestroy(std::string eventName);
void OnExhibitionLoad(std::string eventName);
void OnExhibitionDestroy(std::string eventName);
void OnBallTick(ServerWrapper ball, void* params, std::string eventName);
void Render(CanvasWrapper canvas);
};