add: PathAction
This commit is contained in:
parent
2c7ccb4f6d
commit
ad70453c21
|
|
@ -18,7 +18,8 @@
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
|
|
||||||
#include "ActionFiniteTime.h"
|
#include "ActionInterval.h"
|
||||||
|
#include "Geometry.h"
|
||||||
#include "base.hpp"
|
#include "base.hpp"
|
||||||
#include "Node.h"
|
#include "Node.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
@ -26,27 +27,27 @@
|
||||||
namespace easy2d
|
namespace easy2d
|
||||||
{
|
{
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// FiniteTimeAction
|
// IntervalAction
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
FiniteTimeAction::FiniteTimeAction(Duration const& duration)
|
IntervalAction::IntervalAction(Duration const& duration)
|
||||||
: process_(0)
|
: process_(0)
|
||||||
, duration_(duration)
|
, duration_(duration)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void FiniteTimeAction::Reset()
|
void IntervalAction::Reset()
|
||||||
{
|
{
|
||||||
Action::Reset();
|
Action::Reset();
|
||||||
process_ = 0;
|
process_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FiniteTimeAction::Init(Node* target)
|
void IntervalAction::Init(Node* target)
|
||||||
{
|
{
|
||||||
Action::Init(target);
|
Action::Init(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FiniteTimeAction::Update(Node* target, Duration const& dt)
|
void IntervalAction::Update(Node* target, Duration const& dt)
|
||||||
{
|
{
|
||||||
Action::Update(target, dt);
|
Action::Update(target, dt);
|
||||||
|
|
||||||
|
|
@ -73,14 +74,14 @@ namespace easy2d
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
MoveBy::MoveBy(Duration const& duration, Point const& vector)
|
MoveBy::MoveBy(Duration const& duration, Point const& vector)
|
||||||
: FiniteTimeAction(duration)
|
: IntervalAction(duration)
|
||||||
{
|
{
|
||||||
delta_pos_ = vector;
|
delta_pos_ = vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveBy::Init(Node* target)
|
void MoveBy::Init(Node* target)
|
||||||
{
|
{
|
||||||
FiniteTimeAction::Init(target);
|
IntervalAction::Init(target);
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
|
|
@ -90,7 +91,7 @@ namespace easy2d
|
||||||
|
|
||||||
void MoveBy::Update(Node* target, Duration const& dt)
|
void MoveBy::Update(Node* target, Duration const& dt)
|
||||||
{
|
{
|
||||||
FiniteTimeAction::Update(target, dt);
|
IntervalAction::Update(target, dt);
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
|
|
@ -137,7 +138,7 @@ namespace easy2d
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
JumpBy::JumpBy(Duration const& duration, Point const& vec, float height, int jumps)
|
JumpBy::JumpBy(Duration const& duration, Point const& vec, float height, int jumps)
|
||||||
: FiniteTimeAction(duration)
|
: IntervalAction(duration)
|
||||||
, delta_pos_(vec)
|
, delta_pos_(vec)
|
||||||
, height_(height)
|
, height_(height)
|
||||||
, jumps_(jumps)
|
, jumps_(jumps)
|
||||||
|
|
@ -156,7 +157,7 @@ namespace easy2d
|
||||||
|
|
||||||
void JumpBy::Init(Node* target)
|
void JumpBy::Init(Node* target)
|
||||||
{
|
{
|
||||||
FiniteTimeAction::Init(target);
|
IntervalAction::Init(target);
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
|
|
@ -166,7 +167,7 @@ namespace easy2d
|
||||||
|
|
||||||
void JumpBy::Update(Node* target, Duration const& dt)
|
void JumpBy::Update(Node* target, Duration const& dt)
|
||||||
{
|
{
|
||||||
FiniteTimeAction::Update(target, dt);
|
IntervalAction::Update(target, dt);
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
|
|
@ -208,14 +209,14 @@ namespace easy2d
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
ScaleBy::ScaleBy(Duration const& duration, float scale)
|
ScaleBy::ScaleBy(Duration const& duration, float scale)
|
||||||
: FiniteTimeAction(duration)
|
: IntervalAction(duration)
|
||||||
{
|
{
|
||||||
delta_x_ = scale;
|
delta_x_ = scale;
|
||||||
delta_y_ = scale;
|
delta_y_ = scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScaleBy::ScaleBy(Duration const& duration, float scale_x, float scale_y)
|
ScaleBy::ScaleBy(Duration const& duration, float scale_x, float scale_y)
|
||||||
: FiniteTimeAction(duration)
|
: IntervalAction(duration)
|
||||||
{
|
{
|
||||||
delta_x_ = scale_x;
|
delta_x_ = scale_x;
|
||||||
delta_y_ = scale_y;
|
delta_y_ = scale_y;
|
||||||
|
|
@ -223,7 +224,7 @@ namespace easy2d
|
||||||
|
|
||||||
void ScaleBy::Init(Node* target)
|
void ScaleBy::Init(Node* target)
|
||||||
{
|
{
|
||||||
FiniteTimeAction::Init(target);
|
IntervalAction::Init(target);
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
|
|
@ -234,7 +235,7 @@ namespace easy2d
|
||||||
|
|
||||||
void ScaleBy::Update(Node* target, Duration const& dt)
|
void ScaleBy::Update(Node* target, Duration const& dt)
|
||||||
{
|
{
|
||||||
FiniteTimeAction::Update(target, dt);
|
IntervalAction::Update(target, dt);
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
|
|
@ -284,14 +285,14 @@ namespace easy2d
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
OpacityBy::OpacityBy(Duration const& duration, float opacity)
|
OpacityBy::OpacityBy(Duration const& duration, float opacity)
|
||||||
: FiniteTimeAction(duration)
|
: IntervalAction(duration)
|
||||||
{
|
{
|
||||||
delta_val_ = opacity;
|
delta_val_ = opacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpacityBy::Init(Node* target)
|
void OpacityBy::Init(Node* target)
|
||||||
{
|
{
|
||||||
FiniteTimeAction::Init(target);
|
IntervalAction::Init(target);
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
|
|
@ -301,7 +302,7 @@ namespace easy2d
|
||||||
|
|
||||||
void OpacityBy::Update(Node* target, Duration const& dt)
|
void OpacityBy::Update(Node* target, Duration const& dt)
|
||||||
{
|
{
|
||||||
FiniteTimeAction::Update(target, dt);
|
IntervalAction::Update(target, dt);
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
|
|
@ -352,14 +353,14 @@ namespace easy2d
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
RotateBy::RotateBy(Duration const& duration, float rotation)
|
RotateBy::RotateBy(Duration const& duration, float rotation)
|
||||||
: FiniteTimeAction(duration)
|
: IntervalAction(duration)
|
||||||
, delta_val_(rotation)
|
, delta_val_(rotation)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void RotateBy::Init(Node* target)
|
void RotateBy::Init(Node* target)
|
||||||
{
|
{
|
||||||
FiniteTimeAction::Init(target);
|
IntervalAction::Init(target);
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
|
|
@ -369,7 +370,7 @@ namespace easy2d
|
||||||
|
|
||||||
void RotateBy::Update(Node* target, Duration const& dt)
|
void RotateBy::Update(Node* target, Duration const& dt)
|
||||||
{
|
{
|
||||||
FiniteTimeAction::Update(target, dt);
|
IntervalAction::Update(target, dt);
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
|
|
@ -405,6 +406,53 @@ namespace easy2d
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
// PathAction
|
||||||
|
//-------------------------------------------------------
|
||||||
|
|
||||||
|
PathAction::PathAction(Duration const & duration, spGeometry const& geo, bool rotating, float start, float end)
|
||||||
|
: IntervalAction(duration)
|
||||||
|
, start_(start)
|
||||||
|
, end_(end)
|
||||||
|
, geo_(geo)
|
||||||
|
, rotating_(rotating)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
spAction PathAction::Clone() const
|
||||||
|
{
|
||||||
|
return new PathAction(duration_, geo_, rotating_, start_, end_);
|
||||||
|
}
|
||||||
|
|
||||||
|
spAction PathAction::Reverse() const
|
||||||
|
{
|
||||||
|
return new PathAction(duration_, geo_, rotating_, end_, start_);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathAction::Update(Node * target, Duration const & dt)
|
||||||
|
{
|
||||||
|
IntervalAction::Update(target, dt);
|
||||||
|
|
||||||
|
if (target)
|
||||||
|
{
|
||||||
|
float percent = std::min(std::max((end_ - start_) * process_ + start_, 0.f), 1.f);
|
||||||
|
float length = geo_->GetLength() * percent;
|
||||||
|
Point point, tangent;
|
||||||
|
if (geo_->ComputePointAt(length, &point, &tangent))
|
||||||
|
{
|
||||||
|
target->SetPosition(point);
|
||||||
|
|
||||||
|
if (rotating_)
|
||||||
|
{
|
||||||
|
float ac = math::Acos(tangent.x);
|
||||||
|
float rotation = (tangent.y < 0.f) ? 360.f - ac : ac;
|
||||||
|
target->SetRotation(rotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// Delay
|
// Delay
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
@ -447,4 +495,5 @@ namespace easy2d
|
||||||
{
|
{
|
||||||
return new (std::nothrow) Delay(delay_);
|
return new (std::nothrow) Delay(delay_);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -24,24 +24,19 @@
|
||||||
|
|
||||||
namespace easy2d
|
namespace easy2d
|
||||||
{
|
{
|
||||||
// 持续动作
|
class IntervalAction
|
||||||
class FiniteTimeAction
|
|
||||||
: public Action
|
: public Action
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// 创建特定时长的持续动作
|
explicit IntervalAction(
|
||||||
explicit FiniteTimeAction(
|
|
||||||
Duration const& duration
|
Duration const& duration
|
||||||
);
|
);
|
||||||
|
|
||||||
// 重置动作
|
|
||||||
virtual void Reset() override;
|
virtual void Reset() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 初始化动作
|
|
||||||
virtual void Init(Node* target) override;
|
virtual void Init(Node* target) override;
|
||||||
|
|
||||||
// 更新动作
|
|
||||||
virtual void Update(Node* target, Duration const& dt) override;
|
virtual void Update(Node* target, Duration const& dt) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -52,7 +47,7 @@ namespace easy2d
|
||||||
|
|
||||||
// 相对位移动作
|
// 相对位移动作
|
||||||
class MoveBy
|
class MoveBy
|
||||||
: public FiniteTimeAction
|
: public IntervalAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit MoveBy(
|
explicit MoveBy(
|
||||||
|
|
@ -67,10 +62,8 @@ namespace easy2d
|
||||||
virtual spAction Reverse() const override;
|
virtual spAction Reverse() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 初始化动作
|
|
||||||
virtual void Init(Node* target) override;
|
virtual void Init(Node* target) override;
|
||||||
|
|
||||||
// 更新动作
|
|
||||||
virtual void Update(Node* target, Duration const& dt) override;
|
virtual void Update(Node* target, Duration const& dt) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -101,7 +94,6 @@ namespace easy2d
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 初始化动作
|
|
||||||
virtual void Init(Node* target) override;
|
virtual void Init(Node* target) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -111,7 +103,7 @@ namespace easy2d
|
||||||
|
|
||||||
// 相对跳跃动作
|
// 相对跳跃动作
|
||||||
class JumpBy
|
class JumpBy
|
||||||
: public FiniteTimeAction
|
: public IntervalAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit JumpBy(
|
explicit JumpBy(
|
||||||
|
|
@ -128,10 +120,8 @@ namespace easy2d
|
||||||
virtual spAction Reverse() const override;
|
virtual spAction Reverse() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 初始化动作
|
|
||||||
virtual void Init(Node* target) override;
|
virtual void Init(Node* target) override;
|
||||||
|
|
||||||
// 更新动作
|
|
||||||
virtual void Update(Node* target, Duration const& dt) override;
|
virtual void Update(Node* target, Duration const& dt) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -166,7 +156,6 @@ namespace easy2d
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 初始化动作
|
|
||||||
virtual void Init(Node* target) override;
|
virtual void Init(Node* target) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -176,7 +165,7 @@ namespace easy2d
|
||||||
|
|
||||||
// 相对缩放动作
|
// 相对缩放动作
|
||||||
class ScaleBy
|
class ScaleBy
|
||||||
: public FiniteTimeAction
|
: public IntervalAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit ScaleBy(
|
explicit ScaleBy(
|
||||||
|
|
@ -197,10 +186,8 @@ namespace easy2d
|
||||||
virtual spAction Reverse() const override;
|
virtual spAction Reverse() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 初始化动作
|
|
||||||
virtual void Init(Node* target) override;
|
virtual void Init(Node* target) override;
|
||||||
|
|
||||||
// 更新动作
|
|
||||||
virtual void Update(Node* target, Duration const& dt) override;
|
virtual void Update(Node* target, Duration const& dt) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -238,7 +225,6 @@ namespace easy2d
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 初始化动作
|
|
||||||
virtual void Init(Node* target) override;
|
virtual void Init(Node* target) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -249,7 +235,7 @@ namespace easy2d
|
||||||
|
|
||||||
// 透明度相对渐变动作
|
// 透明度相对渐变动作
|
||||||
class OpacityBy
|
class OpacityBy
|
||||||
: public FiniteTimeAction
|
: public IntervalAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit OpacityBy(
|
explicit OpacityBy(
|
||||||
|
|
@ -264,10 +250,8 @@ namespace easy2d
|
||||||
virtual spAction Reverse() const override;
|
virtual spAction Reverse() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 初始化动作
|
|
||||||
virtual void Init(Node* target) override;
|
virtual void Init(Node* target) override;
|
||||||
|
|
||||||
// 更新动作
|
|
||||||
virtual void Update(Node* target, Duration const& dt) override;
|
virtual void Update(Node* target, Duration const& dt) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -297,7 +281,6 @@ namespace easy2d
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 初始化动作
|
|
||||||
virtual void Init(Node* target) override;
|
virtual void Init(Node* target) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -331,7 +314,7 @@ namespace easy2d
|
||||||
|
|
||||||
// 相对旋转动作
|
// 相对旋转动作
|
||||||
class RotateBy
|
class RotateBy
|
||||||
: public FiniteTimeAction
|
: public IntervalAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit RotateBy(
|
explicit RotateBy(
|
||||||
|
|
@ -346,10 +329,8 @@ namespace easy2d
|
||||||
virtual spAction Reverse() const override;
|
virtual spAction Reverse() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 初始化动作
|
|
||||||
virtual void Init(Node* target) override;
|
virtual void Init(Node* target) override;
|
||||||
|
|
||||||
// 更新动作
|
|
||||||
virtual void Update(Node* target, Duration const& dt) override;
|
virtual void Update(Node* target, Duration const& dt) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -379,7 +360,6 @@ namespace easy2d
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 初始化动作
|
|
||||||
virtual void Init(Node* target) override;
|
virtual void Init(Node* target) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -387,6 +367,36 @@ namespace easy2d
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 路径动作
|
||||||
|
class PathAction
|
||||||
|
: public IntervalAction
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit PathAction(
|
||||||
|
Duration const& duration, /* 持续时长 */
|
||||||
|
spGeometry const& geo, /* 几何图形 */
|
||||||
|
bool rotating = false, /* 沿路径切线方向旋转 */
|
||||||
|
float start = 0.f, /* 起点 */
|
||||||
|
float end = 1.f /* 终点 */
|
||||||
|
);
|
||||||
|
|
||||||
|
// 获取该动作的拷贝对象
|
||||||
|
virtual spAction Clone() const override;
|
||||||
|
|
||||||
|
// 获取该动作的倒转
|
||||||
|
virtual spAction Reverse() const override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void Update(Node* target, Duration const& dt) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool rotating_;
|
||||||
|
float start_;
|
||||||
|
float end_;
|
||||||
|
spGeometry geo_;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// 延时动作
|
// 延时动作
|
||||||
class Delay
|
class Delay
|
||||||
: public Action
|
: public Action
|
||||||
|
|
@ -406,10 +416,8 @@ namespace easy2d
|
||||||
virtual void Reset() override;
|
virtual void Reset() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// 初始化动作
|
|
||||||
virtual void Init(Node* target) override;
|
virtual void Init(Node* target) override;
|
||||||
|
|
||||||
// 更新动作
|
|
||||||
virtual void Update(Node* target, Duration const& dt) override;
|
virtual void Update(Node* target, Duration const& dt) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -44,16 +44,6 @@ namespace easy2d
|
||||||
|
|
||||||
virtual ~Geometry();
|
virtual ~Geometry();
|
||||||
|
|
||||||
cpGeometry const& GetD2DGeometry() const { return geo_; }
|
|
||||||
|
|
||||||
float GetLength();
|
|
||||||
|
|
||||||
bool ComputePointAt(
|
|
||||||
float length,
|
|
||||||
Point* point,
|
|
||||||
Point* tangent
|
|
||||||
);
|
|
||||||
|
|
||||||
// 判断图形是否包含点
|
// 判断图形是否包含点
|
||||||
bool ContainsPoint(
|
bool ContainsPoint(
|
||||||
Point const& point
|
Point const& point
|
||||||
|
|
@ -64,6 +54,18 @@ namespace easy2d
|
||||||
spGeometry const& other
|
spGeometry const& other
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 获取图形展开成一条直线的长度
|
||||||
|
float GetLength();
|
||||||
|
|
||||||
|
// 计算图形路径上点的位置和切线向量
|
||||||
|
bool ComputePointAt(
|
||||||
|
float length,
|
||||||
|
Point* point,
|
||||||
|
Point* tangent
|
||||||
|
);
|
||||||
|
|
||||||
|
cpGeometry const& GetD2DGeometry() const { return geo_; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
cpGeometry geo_;
|
cpGeometry geo_;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ namespace easy2d
|
||||||
E2D_DECLARE_SMART_PTR(FadeOut);
|
E2D_DECLARE_SMART_PTR(FadeOut);
|
||||||
E2D_DECLARE_SMART_PTR(RotateBy);
|
E2D_DECLARE_SMART_PTR(RotateBy);
|
||||||
E2D_DECLARE_SMART_PTR(RotateTo);
|
E2D_DECLARE_SMART_PTR(RotateTo);
|
||||||
|
E2D_DECLARE_SMART_PTR(PathAction);
|
||||||
E2D_DECLARE_SMART_PTR(Delay);
|
E2D_DECLARE_SMART_PTR(Delay);
|
||||||
E2D_DECLARE_SMART_PTR(Animation);
|
E2D_DECLARE_SMART_PTR(Animation);
|
||||||
E2D_DECLARE_SMART_PTR(Animate);
|
E2D_DECLARE_SMART_PTR(Animate);
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
#include "base/Task.h"
|
#include "base/Task.h"
|
||||||
#include "base/Action.hpp"
|
#include "base/Action.hpp"
|
||||||
#include "base/ActionCombined.h"
|
#include "base/ActionCombined.h"
|
||||||
#include "base/ActionFiniteTime.h"
|
#include "base/ActionInterval.h"
|
||||||
#include "base/Animation.h"
|
#include "base/Animation.h"
|
||||||
#include "base/CallFunc.h"
|
#include "base/CallFunc.h"
|
||||||
#include "base/Transition.h"
|
#include "base/Transition.h"
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,18 @@ namespace easy2d
|
||||||
|
|
||||||
inline double Tan(double val) { return ::tan(val * constants::PId / 180.0); }
|
inline double Tan(double val) { return ::tan(val * constants::PId / 180.0); }
|
||||||
|
|
||||||
|
inline float Asin(float val) { return ::asinf(val) * 180.f / constants::PIf; }
|
||||||
|
|
||||||
|
inline double Asin(double val) { return ::asin(val) * 180.f / constants::PIf; }
|
||||||
|
|
||||||
|
inline float Acos(float val) { return ::acosf(val) * 180.f / constants::PIf; }
|
||||||
|
|
||||||
|
inline double Acos(double val) { return ::acos(val) * 180.f / constants::PIf; }
|
||||||
|
|
||||||
|
inline float Atan(float val) { return ::atanf(val) * 180.f / constants::PIf; }
|
||||||
|
|
||||||
|
inline double Atan(double val) { return ::atan(val) * 180.f / constants::PIf; }
|
||||||
|
|
||||||
inline float Ceil(float val) { return ::ceil(val); }
|
inline float Ceil(float val) { return ::ceil(val); }
|
||||||
|
|
||||||
inline double Ceil(double val) { return ::ceil(val); }
|
inline double Ceil(double val) { return ::ceil(val); }
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\core\base\Action.hpp" />
|
<ClInclude Include="..\..\core\base\Action.hpp" />
|
||||||
<ClInclude Include="..\..\core\base\ActionCombined.h" />
|
<ClInclude Include="..\..\core\base\ActionCombined.h" />
|
||||||
<ClInclude Include="..\..\core\base\ActionFiniteTime.h" />
|
<ClInclude Include="..\..\core\base\ActionInterval.h" />
|
||||||
<ClInclude Include="..\..\core\base\ActionManager.h" />
|
<ClInclude Include="..\..\core\base\ActionManager.h" />
|
||||||
<ClInclude Include="..\..\core\base\Animation.h" />
|
<ClInclude Include="..\..\core\base\Animation.h" />
|
||||||
<ClInclude Include="..\..\core\base\audio.h" />
|
<ClInclude Include="..\..\core\base\audio.h" />
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\core\base\ActionCombined.cpp" />
|
<ClCompile Include="..\..\core\base\ActionCombined.cpp" />
|
||||||
<ClCompile Include="..\..\core\base\ActionFiniteTime.cpp" />
|
<ClCompile Include="..\..\core\base\ActionInterval.cpp" />
|
||||||
<ClCompile Include="..\..\core\base\ActionManager.cpp" />
|
<ClCompile Include="..\..\core\base\ActionManager.cpp" />
|
||||||
<ClCompile Include="..\..\core\base\Animation.cpp" />
|
<ClCompile Include="..\..\core\base\Animation.cpp" />
|
||||||
<ClCompile Include="..\..\core\base\audio.cpp" />
|
<ClCompile Include="..\..\core\base\audio.cpp" />
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@
|
||||||
<ClInclude Include="..\..\core\base\ActionCombined.h">
|
<ClInclude Include="..\..\core\base\ActionCombined.h">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\core\base\ActionFiniteTime.h">
|
|
||||||
<Filter>base</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\core\base\Animation.h">
|
<ClInclude Include="..\..\core\base\Animation.h">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
@ -185,6 +182,9 @@
|
||||||
<ClInclude Include="..\..\core\base\Unit.h">
|
<ClInclude Include="..\..\core\base\Unit.h">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\core\base\ActionInterval.h">
|
||||||
|
<Filter>base</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="base">
|
<Filter Include="base">
|
||||||
|
|
@ -207,9 +207,6 @@
|
||||||
<ClCompile Include="..\..\core\base\ActionCombined.cpp">
|
<ClCompile Include="..\..\core\base\ActionCombined.cpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\core\base\ActionFiniteTime.cpp">
|
|
||||||
<Filter>base</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\core\base\Animation.cpp">
|
<ClCompile Include="..\..\core\base\Animation.cpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
@ -330,5 +327,8 @@
|
||||||
<ClCompile Include="..\..\core\base\Unit.cpp">
|
<ClCompile Include="..\..\core\base\Unit.cpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\core\base\ActionInterval.cpp">
|
||||||
|
<Filter>base</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\core\base\Action.hpp" />
|
<ClInclude Include="..\..\core\base\Action.hpp" />
|
||||||
<ClInclude Include="..\..\core\base\ActionCombined.h" />
|
<ClInclude Include="..\..\core\base\ActionCombined.h" />
|
||||||
<ClInclude Include="..\..\core\base\ActionFiniteTime.h" />
|
<ClInclude Include="..\..\core\base\ActionInterval.h" />
|
||||||
<ClInclude Include="..\..\core\base\ActionManager.h" />
|
<ClInclude Include="..\..\core\base\ActionManager.h" />
|
||||||
<ClInclude Include="..\..\core\base\Animation.h" />
|
<ClInclude Include="..\..\core\base\Animation.h" />
|
||||||
<ClInclude Include="..\..\core\base\audio.h" />
|
<ClInclude Include="..\..\core\base\audio.h" />
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\core\base\ActionCombined.cpp" />
|
<ClCompile Include="..\..\core\base\ActionCombined.cpp" />
|
||||||
<ClCompile Include="..\..\core\base\ActionFiniteTime.cpp" />
|
<ClCompile Include="..\..\core\base\ActionInterval.cpp" />
|
||||||
<ClCompile Include="..\..\core\base\ActionManager.cpp" />
|
<ClCompile Include="..\..\core\base\ActionManager.cpp" />
|
||||||
<ClCompile Include="..\..\core\base\Animation.cpp" />
|
<ClCompile Include="..\..\core\base\Animation.cpp" />
|
||||||
<ClCompile Include="..\..\core\base\audio.cpp" />
|
<ClCompile Include="..\..\core\base\audio.cpp" />
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@
|
||||||
<ClInclude Include="..\..\core\base\ActionCombined.h">
|
<ClInclude Include="..\..\core\base\ActionCombined.h">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\core\base\ActionFiniteTime.h">
|
|
||||||
<Filter>base</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\core\base\Animation.h">
|
<ClInclude Include="..\..\core\base\Animation.h">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
@ -185,6 +182,9 @@
|
||||||
<ClInclude Include="..\..\core\base\Unit.h">
|
<ClInclude Include="..\..\core\base\Unit.h">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\core\base\ActionInterval.h">
|
||||||
|
<Filter>base</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="base">
|
<Filter Include="base">
|
||||||
|
|
@ -207,9 +207,6 @@
|
||||||
<ClCompile Include="..\..\core\base\ActionCombined.cpp">
|
<ClCompile Include="..\..\core\base\ActionCombined.cpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\core\base\ActionFiniteTime.cpp">
|
|
||||||
<Filter>base</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\core\base\Animation.cpp">
|
<ClCompile Include="..\..\core\base\Animation.cpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
@ -330,5 +327,8 @@
|
||||||
<ClCompile Include="..\..\core\base\Unit.cpp">
|
<ClCompile Include="..\..\core\base\Unit.cpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\core\base\ActionInterval.cpp">
|
||||||
|
<Filter>base</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\core\base\Action.hpp" />
|
<ClInclude Include="..\..\core\base\Action.hpp" />
|
||||||
<ClInclude Include="..\..\core\base\ActionCombined.h" />
|
<ClInclude Include="..\..\core\base\ActionCombined.h" />
|
||||||
<ClInclude Include="..\..\core\base\ActionFiniteTime.h" />
|
<ClInclude Include="..\..\core\base\ActionInterval.h" />
|
||||||
<ClInclude Include="..\..\core\base\ActionManager.h" />
|
<ClInclude Include="..\..\core\base\ActionManager.h" />
|
||||||
<ClInclude Include="..\..\core\base\Animation.h" />
|
<ClInclude Include="..\..\core\base\Animation.h" />
|
||||||
<ClInclude Include="..\..\core\base\audio.h" />
|
<ClInclude Include="..\..\core\base\audio.h" />
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\core\base\ActionCombined.cpp" />
|
<ClCompile Include="..\..\core\base\ActionCombined.cpp" />
|
||||||
<ClCompile Include="..\..\core\base\ActionFiniteTime.cpp" />
|
<ClCompile Include="..\..\core\base\ActionInterval.cpp" />
|
||||||
<ClCompile Include="..\..\core\base\ActionManager.cpp" />
|
<ClCompile Include="..\..\core\base\ActionManager.cpp" />
|
||||||
<ClCompile Include="..\..\core\base\Animation.cpp" />
|
<ClCompile Include="..\..\core\base\Animation.cpp" />
|
||||||
<ClCompile Include="..\..\core\base\audio.cpp" />
|
<ClCompile Include="..\..\core\base\audio.cpp" />
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@
|
||||||
<ClInclude Include="..\..\core\base\ActionCombined.h">
|
<ClInclude Include="..\..\core\base\ActionCombined.h">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\core\base\ActionFiniteTime.h">
|
|
||||||
<Filter>base</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\core\base\Animation.h">
|
<ClInclude Include="..\..\core\base\Animation.h">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
@ -185,6 +182,9 @@
|
||||||
<ClInclude Include="..\..\core\base\Unit.h">
|
<ClInclude Include="..\..\core\base\Unit.h">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\core\base\ActionInterval.h">
|
||||||
|
<Filter>base</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="base">
|
<Filter Include="base">
|
||||||
|
|
@ -207,9 +207,6 @@
|
||||||
<ClCompile Include="..\..\core\base\ActionCombined.cpp">
|
<ClCompile Include="..\..\core\base\ActionCombined.cpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\core\base\ActionFiniteTime.cpp">
|
|
||||||
<Filter>base</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\core\base\Animation.cpp">
|
<ClCompile Include="..\..\core\base\Animation.cpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
@ -330,5 +327,8 @@
|
||||||
<ClCompile Include="..\..\core\base\Unit.cpp">
|
<ClCompile Include="..\..\core\base\Unit.cpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\core\base\ActionInterval.cpp">
|
||||||
|
<Filter>base</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
Loading…
Reference in New Issue