2023-07-21 16:42:29 +00:00
|
|
|
#pragma once
|
|
|
|
#include "EffectApplication.h"
|
2024-01-07 16:17:20 +00:00
|
|
|
#include "../shape/Point.h"
|
2023-07-21 16:42:29 +00:00
|
|
|
#include "../audio/Effect.h"
|
|
|
|
#include "../lua/LuaParser.h"
|
2024-01-21 22:22:03 +00:00
|
|
|
#include "../obj/Frustum.h"
|
2023-07-21 16:42:29 +00:00
|
|
|
|
|
|
|
class PerspectiveEffect : public EffectApplication {
|
|
|
|
public:
|
2024-01-07 19:48:02 +00:00
|
|
|
PerspectiveEffect(int versionHint);
|
2023-12-20 23:30:20 +00:00
|
|
|
~PerspectiveEffect();
|
2023-07-21 16:42:29 +00:00
|
|
|
|
2024-01-07 16:17:20 +00:00
|
|
|
Point apply(int index, Point input, const std::vector<double>& values, double sampleRate) override;
|
2024-01-07 19:48:02 +00:00
|
|
|
void resetRotation();
|
2023-07-22 14:07:11 +00:00
|
|
|
|
2023-09-01 18:52:36 +00:00
|
|
|
BooleanParameter* fixedRotateX;
|
|
|
|
BooleanParameter* fixedRotateY;
|
|
|
|
BooleanParameter* fixedRotateZ;
|
2023-10-19 11:20:24 +00:00
|
|
|
|
2023-07-21 16:42:29 +00:00
|
|
|
private:
|
|
|
|
float currentRotateX = 0;
|
|
|
|
float currentRotateY = 0;
|
|
|
|
float currentRotateZ = 0;
|
2023-12-20 23:30:20 +00:00
|
|
|
|
2023-09-09 10:22:14 +00:00
|
|
|
double linearSpeedToActualSpeed(double rotateSpeed) {
|
2023-09-09 12:47:02 +00:00
|
|
|
double actualSpeed = (std::exp(3 * juce::jmin(10.0, std::abs(rotateSpeed))) - 1) / 50000;
|
2023-09-09 10:22:14 +00:00
|
|
|
if (rotateSpeed < 0) {
|
|
|
|
actualSpeed *= -1;
|
|
|
|
}
|
|
|
|
return actualSpeed;
|
|
|
|
}
|
2023-09-01 18:52:36 +00:00
|
|
|
};
|