osci-render/Source/audio/PerspectiveEffect.h

33 wiersze
895 B
C
Czysty Zwykły widok Historia

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:
PerspectiveEffect(int versionHint);
~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;
void resetRotation();
2023-09-01 18:52:36 +00:00
BooleanParameter* fixedRotateX;
BooleanParameter* fixedRotateY;
BooleanParameter* fixedRotateZ;
2023-07-21 16:42:29 +00:00
private:
float currentRotateX = 0;
float currentRotateY = 0;
float currentRotateZ = 0;
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;
if (rotateSpeed < 0) {
actualSpeed *= -1;
}
return actualSpeed;
}
2023-09-01 18:52:36 +00:00
};