修复编辑器相机与 game 形态黑屏;中文字体与 Q 选择热键
FPS 式视角合成(yaw 世界轴/pitch 本地轴,永不 roll); RMB 自由视角后环绕 pivot 失效待重建(修 Focus 后 MMB/滚轮 瞬移锁回);SceneRenderer 默认 kDisplayDirect(game 形态 Blit 空转+清屏黑屏根因);swapchain 优先 Opaque 合成; ImGui 加载思源黑体(CJK 常用集);Q=纯选择不出杆; 新增 InputMap 动作映射
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "Engine/Core/Types.h"
|
||||
#include "Engine/Input/InputAction.h"
|
||||
|
||||
namespace Engine {
|
||||
|
||||
@@ -103,6 +104,37 @@ namespace Engine {
|
||||
// 滚轮增量(上行 = +1,一档 ≈1):读后清零。UI 捕获鼠标
|
||||
//(面板悬停)时不累积——滚轮归 ImGui
|
||||
f32 ConsumeScrollDelta();
|
||||
|
||||
// ---- 输入动作层(具名动作,键鼠+手柄混绑;InputMap 藏在 cpp)----
|
||||
// 采样:主循环单点调用 Poll(物理/脚本/OnUpdate 之前),整帧
|
||||
// 一致。active=false(GameFlow 非 Running)时全部动作静默清零。
|
||||
// 默认绑定表在 Init 时内建(Move=Axis2D、Jump=Button)
|
||||
|
||||
// 装配期(编辑器/游戏配置阶段调用;运行中 Define 也可,索引重建)
|
||||
void DefineAction(const std::string& name, ActionKind kind);
|
||||
// 追加绑定:绑定到具名动作(动作不存在则忽略)
|
||||
void BindAction(const std::string& name, const ActionBinding& b);
|
||||
// 就地重绑定(bindingIdx = 该动作绑定表下标;下帧生效)
|
||||
bool RebindAction(const std::string& name, size_t bindingIdx,
|
||||
const ActionBinding& b);
|
||||
|
||||
// 持久化(yaml;Load 文件不存在静默失败保持现状表)
|
||||
bool SaveActionMap(const std::string& path);
|
||||
bool LoadActionMap(const std::string& path);
|
||||
|
||||
// 每帧采样(Application::Run 专用单点;上层勿调)
|
||||
void Poll(bool active);
|
||||
|
||||
// 查询(按动作名;未定义动作返回 false/0)。Button 用
|
||||
// Pressed/Down/Released 边沿语义,Axis 用 Value/Value2
|
||||
bool ActionPressed(const std::string& name);
|
||||
bool ActionDown(const std::string& name);
|
||||
bool ActionReleased(const std::string& name);
|
||||
f32 ActionValue(const std::string& name);
|
||||
glm::vec2 ActionValue2(const std::string& name);
|
||||
|
||||
// 手柄连接态(Poll 时更新)
|
||||
bool IsGamepadConnected();
|
||||
}
|
||||
|
||||
} // namespace Engine
|
||||
|
||||
Reference in New Issue
Block a user