载入中...
搜索中...
未找到
LightingRuntime.cpp
浏览该文件的文档.
18double component(const EditorValue::Array& values, size_t index) { return *values[index].getIf<double>(); }
22Result<void> Light3DRuntimeApplier::apply(const Light3DDocumentTarget& document, graphics::Light3D* light) const {
24 return lightError(EditorStatus::Rejected, "editor.light.runtime-required", "Runtime Light3D is required");
34 light->setPosition(static_cast<float>(component(position, 0)), static_cast<float>(component(position, 1)),
36 light->setDirection(static_cast<float>(component(direction, 0)), static_cast<float>(component(direction, 1)),
38 light->setColor(static_cast<float>(component(color, 0)), static_cast<float>(component(color, 1)),
43 if (const auto* degrees = angle->getIf<double>()) light->setSpotAngle(static_cast<float>(*degrees));
46 if (const auto* value = soft->getIf<double>()) light->setSpotSoftness(static_cast<float>(*value));
53 light->setShadowStrength(static_cast<float>(*document.value("shadow.strength")->getIf<double>()));
A structured explanation of a failed, degraded, or noteworthy result.
Definition Diagnostic.h:94
Declarative 3D light. Collected by RenderSystem3D (max 8 per frame). type: "point" | "dir" | "spot" (...
Definition Light.h:191
Serializable property target matching graphics::Light3D.
Definition LightingTarget.h:101
std::vector< EditorDiagnostic > validate() const
Validate direction, shadow and point/directional cross-field rules.
Definition LightingTarget.cpp:253
Result< void > apply(const Light3DDocumentTarget &document, graphics::Light3D *light) const
Applies .
Definition LightingRuntime.cpp:22
const EditorValue * value(const std::string &path) const
Read a typed runtime-neutral property value by path.
Definition LightingTarget.cpp:241