载入中...
搜索中...
未找到
CinemaDirector.cpp
浏览该文件的文档.
15 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, message, where));
31 if (isActive()) return fail("unbind is required before rebinding an active director", "camera.cinema.bind");
37Result<void> CinemaDirector::defineOverview(const std::string& name, float eyeX, float eyeY, float eyeZ,
70Result<void> CinemaDirector::sampleLivePose(glm::vec3& eye, glm::vec3& target, float& fov) const {
83Result<void> CinemaDirector::writeActivePose(const glm::vec3& eye, const glm::vec3& target, float fov) {
86 auto written = controller_->setView(name, eye.x, eye.y, eye.z, target.x, target.y, target.z, fov);
98 controller_->setView(shot.name, shot.eye.x, shot.eye.y, shot.eye.z, shot.target.x, shot.target.y,
137 if (!isActive()) return fail("push an overview before playing a film move", "camera.cinema.move");
173 if (next.orbitRadius < 1e-4f) return fail("orbit reveal needs horizontal radius", "camera.cinema.orbitReveal");
178 target + glm::vec3(std::sin(endAz) * next.orbitRadius, next.orbitElevation, std::cos(endAz) * next.orbitRadius);
230 if (!std::isfinite(dt) || dt < 0.f) return fail("dt must be finite and >= 0", "camera.cinema.update");
266 "CinemaDirector", std::function<CinemaDirector*()>([]() { return new CinemaDirector(); }), true);
272 [vm](CinemaDirector* self, const std::string& name, float ex, float ey, float ez, float tx, float ty,
297 cls.addFunc("getActiveOverview", [](const CinemaDirector* self) { return self->getActiveOverview(); });
The single Squirrel projection for common Result, Status and Value.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
3D 摄像机控制器(eve.Camera / eve.CameraController)。
Definition CameraController.h:104
CameraFramingSnapshot captureFraming() const
Snapshot gameplay framing so a story director can restore it later. @cost Constant copy of scalar fra...
Definition CameraController.cpp:424
Result< void > restoreFraming(const CameraFramingSnapshot &snapshot, float blendTime)
Restore a previously captured framing, optionally blending from the live pose. @cost One pose evaluat...
Definition CameraController.cpp:458
bool switchTo(const std::string &name, float blendTime)
Switch to.
Definition CameraController.cpp:519
Result< void > setView(const std::string &name, float ex, float ey, float ez, float tx, float ty, float tz, float fov)
Insert or replace a named cinematic view including FOV. @cost Constant; amortised over the next blend...
Definition CameraController.cpp:395
void setDirectorEnabled(bool enabled)
Pause or resume priority-rig director selection (story cameras need this off).
Definition CameraController.cpp:517
Story-scene cinema director that push/pops overview shots and film moves on a CameraController.
Definition CinemaDirector.h:24
Result< void > orbitReveal(float degrees, float duration)
Orbit the eye around the current look target by a finite yaw arc. @cost Constant setup; amortized acr...
Definition CinemaDirector.cpp:195
Result< void > bind(CameraController *controller)
Bind the gameplay camera controller this director will temporarily override. @ownership Borrowed; the...
Definition CinemaDirector.cpp:29
bool isActive() const noexcept
True while at least one story shot is on the stack.
Definition CinemaDirector.h:66
bool isMovePlaying() const noexcept
True while a dolly/crane/orbitReveal is in progress.
Definition CinemaDirector.h:70
Result< void > dolly(float distance, float duration)
Dolly the eye along the look axis (positive toward subject). @cost Constant setup; amortized across u...
Definition CinemaDirector.cpp:187
std::string getActiveOverview() const
Name of the top overview, or empty when inactive.
Definition CinemaDirector.cpp:260
Result< void > defineOverview(const std::string &name, float eyeX, float eyeY, float eyeZ, float targetX, float targetY, float targetZ, float fov)
Register or replace a named establishing / overview shot.
Definition CinemaDirector.cpp:37
Result< void > pushOverview(const std::string &name, float blendTime)
Push an overview shot onto the story stack, blending from the live pose. @cost One framing capture (f...
Definition CinemaDirector.cpp:110
Result< void > update(float dt)
Advance the active film move; call before CameraController::update. @cost Constant per frame while a ...
Definition CinemaDirector.cpp:227
Result< void > crane(float deltaY, float duration)
Raise or lower the eye while keeping the look target fixed. @cost Constant setup; amortized across up...
Definition CinemaDirector.cpp:191
Result< void > pop(float blendTime)
Pop the top story shot and restore the previous overview or gameplay framing. @cost One framing resto...
Definition CinemaDirector.cpp:199
Result< T > fail(std::string message, DiagnosticCode code=DiagnosticCode::InvalidArgument)
Definition BuildingAssemblyInternal.h:35
Definition CameraController.cpp:21
void exposeCinemaDirectorBindings(ssq::Table &table)
Register CinemaDirector EveScript bindings on the camera module table.
Definition CinemaDirector.cpp:264
constexpr HexDirection next(HexDirection d) noexcept
The next direction clockwise (NW wraps to NE).
Definition HexMetrics.h:76
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
Definition SquirrelBinding.cpp:540
@ InvalidArgument