修改游戏底层矩阵相关
This commit is contained in:
@@ -8,8 +8,8 @@ private:
|
||||
CharacterObject *m_pCharacter = nullptr;
|
||||
|
||||
public:
|
||||
VecFPos LeftStick = {0.f, 0.f};
|
||||
VecFPos RightStick = {0.f, 0.f};
|
||||
Vec2 LeftStick = {0.f, 0.f};
|
||||
Vec2 RightStick = {0.f, 0.f};
|
||||
|
||||
// 用于将SDL的轴值(-32768到32767)转换为-1到1之间的浮点数
|
||||
float ConvertAxisValue(Sint16 rawValue);
|
||||
@@ -19,6 +19,6 @@ public:
|
||||
void HandleEvents(SDL_Event *e) override;
|
||||
|
||||
// 获取摇杆位置的方法
|
||||
const VecFPos &GetLeftStick() const { return LeftStick; }
|
||||
const VecFPos &GetRightStick() const { return RightStick; }
|
||||
const Vec2 &GetLeftStick() const { return LeftStick; }
|
||||
const Vec2 &GetRightStick() const { return RightStick; }
|
||||
};
|
||||
|
||||
@@ -30,15 +30,15 @@ void Chr_Shadow::SetAction(std::string actionName)
|
||||
|
||||
void Chr_Shadow::SetDirection(int dir)
|
||||
{
|
||||
VecFPos sc = GetScale();
|
||||
Vec2 sc = GetScale();
|
||||
// 朝右
|
||||
if (dir == 0)
|
||||
{
|
||||
SetScale(VecFPos({SDL_fabsf(sc.x), sc.y}));
|
||||
SetScale(Vec2({SDL_fabsf(sc.x), sc.y}));
|
||||
}
|
||||
// 朝左
|
||||
else if (dir == 1)
|
||||
{
|
||||
SetScale(VecFPos({-SDL_fabsf(sc.x), sc.y}));
|
||||
SetScale(Vec2({-SDL_fabsf(sc.x), sc.y}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user