mirror of
https://github.com/Nexoniarz/Fry3DX.git
synced 2026-11-03 12:34:27 +00:00
Fly camera (as in games, Unreal, Unity): right drag turns it where it stands, WASD (Q / E down, up) while held and the arrows any time move where it looks, the wheel goes forward and back (never creeping to a stop), Shift + wheel sets how fast every way of moving goes (kept), Alt + right drag orbits round what's picked; it keeps track of what it looks at (the near plane and shade in corners go by what's nearest). Close up in Rendered no longer turns into a pattern: the shade in corners reaches a share of the view (its +1 a share of the reach in the engine). The grid made again: four sets of lines, each line's look only from how far apart it and its like are on the screen (no jumps as the view moves or the steps change, no gaps, soft edges), pieces short near the eye. F3 and Escape close the command search (the engine takes Escape first). fry_hold / fry_mouse / fry_orbit target for trying it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
de749dba11
commit
415f8fa352
9 changed files with 206 additions and 80 deletions
|
|
@ -275,6 +275,7 @@ extern keel::Cvar fry_touch;
|
|||
extern keel::Cvar fry_uiscale;
|
||||
extern keel::Cvar fry_uisize;
|
||||
extern keel::Cvar fry_theme;
|
||||
extern keel::Cvar fry_movespeed;
|
||||
extern keel::Cvar fry_pluginsoff;
|
||||
extern keel::Cvar fry_autosave;
|
||||
|
||||
|
|
@ -356,7 +357,8 @@ private:
|
|||
ImVec2 viewMin_{0, 0}, viewMax_{1, 1};
|
||||
glm::mat4 vp_{1.0f};
|
||||
glm::vec3 eye_{0.0f};
|
||||
bool orbiting_ = false, panning_ = false;
|
||||
bool orbiting_ = false, panning_ = false, looking_ = false; // (looking: right drag turns the camera where it stands)
|
||||
float nearest_ = 1.0f; // (how far the nearest thing is from the eye, m: worked out with the view)
|
||||
bool xray_ = false, showGrid_ = true, renderGrid_ = false;
|
||||
std::string appliedLook_;
|
||||
keel::ModelId ground_{};
|
||||
|
|
@ -1464,6 +1466,11 @@ private:
|
|||
std::vector<double> ms;
|
||||
} bench_;
|
||||
std::vector<std::pair<ImGuiKey, int>> holding_; // (fry_hold: keys held down for that many more frames)
|
||||
float aoReach() const;
|
||||
void lookBy(ImVec2 d);
|
||||
void refocus();
|
||||
float nearestThing();
|
||||
float viewScale() const { return std::max(std::min(dist_, nearest_), 0.001f); } // (how big the view is where it matters: what's ahead, or nearer)
|
||||
void benchStep();
|
||||
void benchEnd(std::chrono::steady_clock::time_point began);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue