35#include <glm/gtc/matrix_transform.hpp>
36#include <glm/gtc/type_ptr.hpp>
39 double Angle,
bool bInter,
double T0,
double T1):
48 bool bInter,
double T0,
double T1):
56 const glm::vec3& Origin,
double Angle,
bool bScale,
bool bInter,
double T0,
double T1):
66 const glm::vec3& Origin,
double Angle,
bool bScale,
bool bInter,
double T0,
double T1):
82std::shared_ptr<SRotate>
83makeSRotate(
const glm::vec3& Axis,
const glm::vec3& Origin,
double Angle,
bool bInter,
double T0,
double T1)
85 return std::make_shared<SRotate>(Axis, Origin, Angle, bInter, T0, T1);
88std::shared_ptr<SScale>
89makeSScale(
const glm::vec3& Scale,
const glm::vec3& Origin,
bool bInter,
double T0,
double T1)
91 return std::make_shared<SScale>(
Scale, Origin, bInter, T0, T1);
94std::shared_ptr<STranslate>
97 return std::make_shared<STranslate>(
Vector, bInter, T0, T1);
100std::shared_ptr<SEllipseTranslate>
101makeSEllipseTranslate(
double dWidth,
double dHeight,
double dStartPosition,
double dEndPosition,
bool bInter,
double T0,
double T1)
103 return std::make_shared<SEllipseTranslate>(dWidth, dHeight, dStartPosition, dEndPosition, bInter, T0, T1);
106std::shared_ptr<RotateAndScaleDepthByWidth>
109 return std::make_shared<RotateAndScaleDepthByWidth>(Axis, Origin, Angle, bScale, bInter, T0, T1);
112std::shared_ptr<RotateAndScaleDepthByHeight>
115 return std::make_shared<RotateAndScaleDepthByHeight>(Axis, Origin, Angle, bScale, bInter, T0, T1);
120 return (
t - T0 ) / ( T1 - T0 );
140 glm::vec3 translation_vector(SlideWidthScale*
origin.x, SlideHeightScale*
origin.y,
origin.z);
141 glm::vec3 scale_vector(SlideWidthScale * SlideWidthScale, SlideHeightScale * SlideHeightScale, 1);
149void SScale::interpolate(glm::mat4& matrix,
double t,
double SlideWidthScale,
double SlideHeightScale)
const
156 glm::vec3 translation_vector(SlideWidthScale*
origin.x, SlideHeightScale*
origin.y,
origin.z);
169 glm::vec3 translation_vector(SlideWidthScale*
origin.x, SlideHeightScale*
origin.y, SlideWidthScale*
origin.z);
170 glm::vec3 scale_vector(SlideWidthScale * SlideWidthScale, SlideHeightScale * SlideHeightScale, 1);
187 glm::vec3 translation_vector(SlideWidthScale*
origin.x, SlideHeightScale*
origin.y, SlideHeightScale*
origin.z);
188 glm::vec3 scale_vector(SlideWidthScale * SlideWidthScale, SlideHeightScale * SlideHeightScale, 1);
199 double dEndPosition,
bool bInter,
double T0,
double T1):
219 x =
width*(cos (a2) - cos (a1))/2;
220 y =
height*(sin (a2) - sin (a1))/2;
std::shared_ptr< RotateAndScaleDepthByWidth > makeRotateAndScaleDepthByWidth(const glm::vec3 &Axis, const glm::vec3 &Origin, double Angle, bool bScale, bool bInter, double T0, double T1)
std::shared_ptr< SRotate > makeSRotate(const glm::vec3 &Axis, const glm::vec3 &Origin, double Angle, bool bInter, double T0, double T1)
std::shared_ptr< SScale > makeSScale(const glm::vec3 &Scale, const glm::vec3 &Origin, bool bInter, double T0, double T1)
std::shared_ptr< SEllipseTranslate > makeSEllipseTranslate(double dWidth, double dHeight, double dStartPosition, double dEndPosition, bool bInter, double T0, double T1)
std::shared_ptr< RotateAndScaleDepthByHeight > makeRotateAndScaleDepthByHeight(const glm::vec3 &Axis, const glm::vec3 &Origin, double Angle, bool bScale, bool bInter, double T0, double T1)
static double intervalInter(double t, double T0, double T1)
std::shared_ptr< STranslate > makeSTranslate(const glm::vec3 &Vector, bool bInter, double T0, double T1)
This class is to be derived to make any operation (transform) you may need in order to construct your...
double mnT0
time to begin the transformation
bool mbInterpolate
Should this operation be interpolated .
double mnT1
time to finish the transformation
virtual void interpolate(glm::mat4 &matrix, double t, double SlideWidthScale, double SlideHeightScale) const override
this is the function that is called to give the Operation to OpenGL.
RotateAndScaleDepthByHeight(const glm::vec3 &Axis, const glm::vec3 &Origin, double Angle, bool bScale, bool bInter, double T0, double T1)
virtual void interpolate(glm::mat4 &matrix, double t, double SlideWidthScale, double SlideHeightScale) const override
this is the function that is called to give the Operation to OpenGL.
RotateAndScaleDepthByWidth(const glm::vec3 &Axis, const glm::vec3 &Origin, double Angle, bool bScale, bool bInter, double T0, double T1)
double width
width and length of the ellipse
double startPosition
start and end position on the ellipse <0,1>
virtual void interpolate(glm::mat4 &matrix, double t, double SlideWidthScale, double SlideHeightScale) const override
this is the function that is called to give the Operation to OpenGL.
SEllipseTranslate(double dWidth, double dHeight, double dStartPosition, double dEndPosition, bool bInter, double T0, double T1)
Constructor.
virtual void interpolate(glm::mat4 &matrix, double t, double SlideWidthScale, double SlideHeightScale) const override
this is the function that is called to give the Operation to OpenGL.
glm::vec3 origin
position that rotation axis runs through
glm::vec3 axis
axis to rotate CCW about
double angle
angle in degrees of CCW rotation
SRotate(const glm::vec3 &Axis, const glm::vec3 &Origin, double Angle, bool bInter, double T0, double T1)
Constructor.
virtual void interpolate(glm::mat4 &matrix, double t, double SlideWidthScale, double SlideHeightScale) const override
this is the function that is called to give the Operation to OpenGL.
SScale(const glm::vec3 &Scale, const glm::vec3 &Origin, bool bInter, double T0, double T1)
Constructor.
virtual void interpolate(glm::mat4 &matrix, double t, double SlideWidthScale, double SlideHeightScale) const override
this is the function that is called to give the Operation to OpenGL.
glm::vec3 vector
vector to translate by
STranslate(const glm::vec3 &Vector, bool bInter, double T0, double T1)
Constructor.
constexpr double deg2rad(double v)