载入中...
搜索中...
未找到
FractureRenderer.cpp
浏览该文件的文档.
18eve::Result<void> GeometryCollectionRenderer::setGroupExteriorColor(int groupId, float r, float g, float b, float a) {
19 if (groupId < 0 || groupId > 4095 || !std::isfinite(r) || !std::isfinite(g) || !std::isfinite(b) ||
22 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "group/color out of range", "palette"));
40eve::Result<void> GeometryCollectionRenderer::prepareAnimation(const CollapseAnimation& animation,
53 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "no instance to prepare", "instance"));
62eve::Result<void> GeometryCollectionRenderer::prepareGeometry(std::shared_ptr<const FractureGeometry> geometry,
68 if (preparedGeometry_ == geometry && meshOwner_ == graphics) return eve::Result<void>::success();
119 batch.mesh = graphics->newMeshFromArrays(batch.positions.data(), batch.normals.data(), batch.uv.data(),
166 if (shadowToken != shadowToken_) graphics::RenderSystem3D::removeShadowExtraDrawer(shadowToken);
173 if (shadowToken != shadowToken_) graphics::RenderSystem3D::removeShadowExtraDrawer(shadowToken);
176 eve::Diagnostic::error(eve::DiagnosticCode::Failed, "forward contributor registration failed", "geometry"));
195eve::Result<void> GeometryCollectionRenderer::beginAnimationSubmission(const CollapseAnimation& animation) {
201 "scene submission requires embedded mesh geometry; legacy boxes use drawAnimation inside an active 3D pass",
205 return eve::Result<void>::failure(eve::Diagnostic::error(eve::DiagnosticCode::PreconditionViolation,
222eve::Result<void> GeometryCollectionRenderer::submitAnimation(const CollapseAnimation& animation, float seconds,
228 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "submission values must be finite", "time"));
250 return eve::Result<void>::failure(eve::Diagnostic::error(eve::DiagnosticCode::PreconditionViolation,
256 glm::translate(glm::mat4(1.f), glm::vec3(b.worldX, b.worldY, b.worldZ)) * glm::mat4_cast(glm::normalize(q));
269 batch.positions[offset + axis] = m[axis] * x + m[4 + axis] * y + m[8 + axis] * z + m[12 + axis];
273 if (!graphics.updateMeshVertices(batch.mesh, batch.positions.data(), batch.normals.data(), batch.uv.data(),
277 eve::Diagnostic::error(eve::DiagnosticCode::Failed, "fragment batch upload failed", "geometry"));
287 graphics::Color color = batch.interior ? graphics::Color(interiorR_, interiorG_, interiorB_, interiorA_)
EVEngine assertion entry point, backed by zeroerr.
#define EV_ASSERT(cond,...)
Assert an internal engine invariant (state that must always hold).
Definition Assert.h:37
std::array< std::uint64_t, kPixelChunkSize *kPixelChunkSize > updated
Definition PixelWorld.cpp:53
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
Definition Graphics.h:134
static void removeShadowExtraDrawer(uint64_t token)
Remove one shadow callback before destroying its captured state.
Definition RenderSystem3D.cpp:650
static void removeForwardExtraDrawer(uint64_t token)
Unregister a main forward-pass contributor.
Definition RenderSystem3D.cpp:620
static uint64_t addShadowExtraDrawer(ShadowExtraDrawer drawer)
Adds shadow extra drawer.
Definition RenderSystem3D.cpp:643
static uint64_t addForwardExtraDrawer(ForwardExtraDrawer drawer)
Register a main forward-pass contributor.
Definition RenderSystem3D.cpp:613
Owning, solver-independent baked rigid-fragment animation within Physics. @ownership Owns all samples...
Definition CollapseAnimation.h:27
Result< BonePresentation > sample(float seconds, int bone) const
Sample a fragment, clamping time to endpoints; linear translation and shortest quaternion nlerp.
Definition CollapseAnimation.cpp:80
std::shared_ptr< const FractureGeometry > fragmentGeometry() const noexcept
Shared immutable embedded meshes; empty for v1/box animations. @ownership Return value extends mesh l...
Definition CollapseAnimation.cpp:74
Independent clock over a frozen, shared collapse animation. @ownership Owns a shared immutable snapsh...
Definition CollapsePlayback.h:20
std::shared_ptr< const CollapseAnimation > animation() const noexcept
Shared immutable clip; returned ownership survives this player's destruction.
Definition CollapsePlayback.cpp:47
Result< BonePresentation > sample(int bone) const
Sample at current time using the clip's interpolation and discrete-state contract.
Definition CollapsePlayback.cpp:29
std::shared_ptr< const FractureGeometry > fragmentGeometry() const noexcept override
Shared immutable geometry; empty for legacy box collections. @ownership Returned shared value keeps g...
Definition GeometryCollectionInstance.cpp:44
int boneCount() const noexcept override
Stable positive fragment count for this sample.
Definition GeometryCollectionInstance.h:131
eve::Result< BonePresentation > bonePresentation(int boneIndex) const override
Sample one bone's world pose and proxy extents for presentation.
Definition GeometryCollectionInstance.cpp:484
eve::Result< void > submitPlayback(const CollapsePlayback &player)
Submit this player's placed poses to forward, shadow and depth passes. @ownership Copies samples duri...
Definition FractureRenderer.cpp:211
eve::Result< void > prepareAnimation(const CollapseAnimation &animation, graphics::Graphics *graphics)
Upload embedded meshes once before baked playback.
Definition FractureRenderer.cpp:40
eve::Result< void > submitAnimation(const CollapseAnimation &animation, float seconds, float offsetX, float offsetY, float offsetZ)
Queue one sampled mesh animation for the engine's next main forward and CSM shadow passes.
Definition FractureRenderer.cpp:222
eve::Result< void > prepareInstance(graphics::Graphics *graphics)
Upload the bound live instance geometry before drawing it. @cost Same offline GPU allocation as prepa...
Definition FractureRenderer.cpp:50
eve::Result< void > preparePlayback(const CollapsePlayback &player, graphics::Graphics *graphics)
Prepare meshes for a frozen player without retaining its clock. @ownership Borrows player during the ...
Definition FractureRenderer.cpp:191
eve::Result< void > setGroupExteriorColor(int groupId, float r, float g, float b, float a)
Set exterior RGBA for one authored structural group (clusterId).
Definition FractureRenderer.cpp:18
eve::Color Color
RGBA color used by every graphics draw call. Lives inside eve::graphics so including a graphics heade...
Definition Color.h:13
@ InvalidArgument
@ PreconditionViolation
@ Unsupported
@ Failed
glm::vec4 Color
Render-neutral RGBA color shared by graphics-facing modules.
Definition RenderTypes.h:8