载入中...
搜索中...
未找到
GeometryCollectionRenderer.cpp
浏览该文件的文档.
22void appendBox(std::vector<float>& positions, std::vector<float>& normals, std::vector<float>& uv,
53 glm::mat4 model = glm::translate(glm::mat4(1.f), glm::vec3(bone.worldX, bone.worldY, bone.worldZ));
67GeometryCollectionRenderer::GeometryCollectionRenderer(GeometryCollectionInstance* instance) noexcept
157 eve::DiagnosticCode::InvalidArgument, "geometry-collection renderer has no instance", "instance"));
185 eve::DiagnosticCode::Failed, "geometry-collection sleep batch mesh allocation failed", "mesh"));
194 eve::DiagnosticCode::InvalidArgument, "geometry-collection draw requires Graphics", "graphics"));
197 eve::DiagnosticCode::InvalidArgument, "geometry-collection renderer has no instance", "instance"));
204 return eve::Result<void>::failure(eve::Diagnostic::error(eve::DiagnosticCode::PreconditionViolation,
237 const graphics::Color tint(detached ? interiorR_ : exteriorR_, detached ? interiorG_ : exteriorG_,
254 if (!graphics || animation.boneCount() == 0 || !std::isfinite(seconds) || !std::isfinite(offsetX) ||
260 return eve::Result<void>::failure(eve::Diagnostic::error(eve::DiagnosticCode::PreconditionViolation,
279 auto model = glm::scale(boneModel(bone), glm::vec3(bone.halfExtentX, bone.halfExtentY, bone.halfExtentZ));
280 graphics->drawMesh(unitBox_, model, nullptr, graphics::Color(exteriorR_, exteriorG_, exteriorB_, exteriorA_));
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::unique_ptr< DeformMeshPresentation > presentation
Definition PhysicsBakeGraphics.cpp:71
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
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
Runtime owner of bone state, connection strain, and PhysicsLink bindings.
Definition GeometryCollectionInstance.h:70
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
std::uint64_t sleepBatchRevision() const noexcept
Monotonic revision bumped when any bone enters Sleeping (for batch rebuild).
Definition GeometryCollectionInstance.h:159
int boneCount() const noexcept override
Stable positive fragment count for this sample.
Definition GeometryCollectionInstance.h:131
bool hasLiveWorld() const noexcept
Whether the owning world handle still resolves.
Definition GeometryCollectionInstance.cpp:163
eve::Result< BonePresentation > bonePresentation(int boneIndex) const override
Sample one bone's world pose and proxy extents for presentation.
Definition GeometryCollectionInstance.cpp:484
void setInteriorColor(float r, float g, float b, float a)
Cut-face RGBA; also used for Detached legacy box bones.
Definition GeometryCollectionRenderer.cpp:90
void setExteriorColor(float r, float g, float b, float a)
Exterior-face RGBA; also used for Attached legacy box bones.
Definition GeometryCollectionRenderer.cpp:82
eve::Result< void > draw(graphics::Graphics *graphics)
Synchronize caches and draw all bones into the current 3D frame.
Definition GeometryCollectionRenderer.cpp:189
GeometryCollectionRenderer(GeometryCollectionInstance *instance) noexcept
Construct a renderer that borrows an instance.
Definition GeometryCollectionRenderer.cpp:67
void setSleepColor(float r, float g, float b, float a)
Sleeping-batch RGBA.
Definition GeometryCollectionRenderer.cpp:98
eve::Result< void > drawAnimation(const CollapseAnimation &animation, graphics::Graphics *graphics, float seconds, float offsetX, float offsetY, float offsetZ)
Draw a baked animation without a live physics instance.
Definition GeometryCollectionRenderer.cpp:251
void setInstance(GeometryCollectionInstance *instance)
Replace the borrowed instance; null disables drawing. @ownership Does not take ownership of instance....
Definition GeometryCollectionRenderer.cpp:77
~GeometryCollectionRenderer()
Geometry collection renderer.
Definition GeometryCollectionRenderer.cpp:70
eve::Color Color
RGBA color used by every graphics draw call. Lives inside eve::graphics so including a graphics heade...
Definition Color.h:13
@ Detached
@ Sleeping
void appendBox(MeshBuild &mesh, V3 center, V3 side, V3 up, V3 forward, float hx, float hy, float hz, RoadMaterial material)
Module-private road bake implementation helper.
Definition RoadBake.cpp:402
@ InvalidArgument
@ PreconditionViolation
@ Failed
@ StaleHandle