载入中...
搜索中...
未找到
eve::physics::GeometryCollectionRenderer类 参考final

Presentation bridge for a borrowed geometry-collection instance. 更多...

#include <GeometryCollectionRenderer.h>

类

struct  DepthRegistration
 

Public 成员函数

 GeometryCollectionRenderer (GeometryCollectionInstance *instance) noexcept
 Construct a renderer that borrows an instance.
 
 GeometryCollectionRenderer (const GeometryCollectionRenderer &)=delete
 
GeometryCollectionRenderer & operator= (const GeometryCollectionRenderer &)=delete
 
 ~GeometryCollectionRenderer ()
 Geometry collection renderer.
 
void setInstance (GeometryCollectionInstance *instance)
 Replace the borrowed instance; null disables drawing. @ownership Does not take ownership of instance. @lifetime instance must outlive subsequent draws, or be cleared again.
 
GeometryCollectionInstance * getInstance () const noexcept
 Return the currently borrowed instance. @ownership Borrowed; caller must not delete through this pointer. @lifetime Valid until setInstance or renderer destruction.
 
void setExteriorColor (float r, float g, float b, float a)
 Exterior-face RGBA; also used for Attached legacy box bones.
 
void setInteriorColor (float r, float g, float b, float a)
 Cut-face RGBA; also used for Detached legacy box bones.
 
eve::Result< void > setGroupExteriorColor (int groupId, float r, float g, float b, float a)
 Set exterior RGBA for one authored structural group (clusterId).
 
void setSleepColor (float r, float g, float b, float a)
 Sleeping-batch RGBA.
 
eve::Result< void > draw (graphics::Graphics *graphics)
 Synchronize caches and draw all bones into the current 3D frame.
 
int lastActiveDrawCount () const noexcept
 Number of bones drawn individually on the last successful draw.
 
int lastSleepBatchCount () const noexcept
 Number of bones included in the sleeping batch on the last draw.
 
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.
 
eve::Result< void > prepareAnimation (const CollapseAnimation &animation, graphics::Graphics *graphics)
 Upload embedded meshes once before baked playback.
 
eve::Result< void > prepareInstance (graphics::Graphics *graphics)
 Upload the bound live instance geometry before drawing it. @cost Same offline GPU allocation as prepareAnimation, amortized over live draws.
 
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.
 
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 call; shares its immutable geometry. Graphics outlives renderer. @thread Render thread only, no callbacks. @cost GPU allocation proportional to triangles; prepare once per renderer and asset.
 
eve::Result< void > submitPlayback (const CollapsePlayback &player)
 Submit this player's placed poses to forward, shadow and depth passes. @ownership Copies samples during call; no player reference survives the call. @thread Render thread only, no callbacks. Failed submission disables the prior submission. @cost Linear sampling and vertex upload per frame; prepared resources are reused across passes.
 

详细描述

Presentation bridge for a borrowed geometry-collection instance.

Fractured collections use prepared exterior/cut-face mesh batches. Legacy box collections keep per-bone proxies and revision-based sleeping batches. Animation submission copies poses into renderer-owned scratch before the engine forward-pass callback; graphics must outlive the renderer. Current submitted meshes also fill the same-frame GBuffer for fog occlusion. One process-lifetime dispatcher holds weak registrations; renderer teardown expires its registration before releasing meshes. Render-thread only, no reentrant teardown.

@ownership Never owns Instance, Graphics, or Body3D. Mesh caches are produced through Graphics and not retained as exclusive ownership. @lifetime Borrows Instance and Graphics only for each call; do not call draw after Instance or its World3D is destroyed.

在文件 GeometryCollectionRenderer.h 第 41 行定义.

构造及析构函数说明

◆ GeometryCollectionRenderer() [1/2]

eve::physics::GeometryCollectionRenderer::GeometryCollectionRenderer ( GeometryCollectionInstance *  instance)
explicitnoexcept

Construct a renderer that borrows an instance.

参数
instanceBorrowed instance, or null to disable drawing. @ownership Does not take ownership of instance. @lifetime instance must outlive draws, or be cleared via setInstance(null).

在文件 GeometryCollectionRenderer.cpp 第 67 行定义.

◆ GeometryCollectionRenderer() [2/2]

eve::physics::GeometryCollectionRenderer::GeometryCollectionRenderer ( const GeometryCollectionRenderer &  )
delete

◆ ~GeometryCollectionRenderer()

eve::physics::GeometryCollectionRenderer::~GeometryCollectionRenderer ( )

成员函数说明

◆ draw()

eve::Result< void > eve::physics::GeometryCollectionRenderer::draw ( graphics::Graphics *  graphics)

Synchronize caches and draw all bones into the current 3D frame.

参数
graphicsBorrowed Graphics used for mesh allocation and drawMesh.
返回
Success, or StaleHandle/InvalidArgument when the instance/world is gone. @ownership Does not take ownership of graphics. @lifetime graphics must remain live for the duration of this call.

在文件 GeometryCollectionRenderer.cpp 第 189 行定义.

引用了 bone, eve::physics::GeometryCollectionInstance::boneCount(), eve::physics::GeometryCollectionInstance::bonePresentation(), eve::physics::Detached, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::physics::GeometryCollectionInstance::fragmentGeometry(), geometry, graphics, eve::physics::GeometryCollectionInstance::hasLiveWorld(), eve::InvalidArgument, model, pose, eve::PreconditionViolation, presentation, eve::physics::GeometryCollectionInstance::sleepBatchRevision(), eve::physics::Sleeping, eve::StaleHandle, eve::Result< T >::success(), tint , 以及 updated.

◆ drawAnimation()

eve::Result< void > eve::physics::GeometryCollectionRenderer::drawAnimation ( const CollapseAnimation &  animation,
graphics::Graphics *  graphics,
float  seconds,
float  offsetX,
float  offsetY,
float  offsetZ 
)

Draw a baked animation without a live physics instance.

参数
animationBorrowed only for this call; caller owns the asset.
graphicsBorrowed graphics, must outlive renderer mesh caches.
secondsPlayback time; endpoints clamp, caller controls speed/loop/seek.
offsetXInstance translation in metres.
offsetYInstance translation in metres.
offsetZInstance translation in metres.
返回
Checked draw status; single render thread, no callbacks.

在文件 GeometryCollectionRenderer.cpp 第 251 行定义.

引用了 bone, eve::physics::CollapseAnimation::boneCount(), eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::physics::CollapseAnimation::fragmentGeometry(), geometry, graphics, eve::InvalidArgument, model, offsetX, offsetY, eve::PreconditionViolation, eve::physics::CollapseAnimation::sample(), eve::Result< T >::success() , 以及 updated.

◆ getInstance()

GeometryCollectionInstance * eve::physics::GeometryCollectionRenderer::getInstance ( ) const
inlinenoexcept

Return the currently borrowed instance. @ownership Borrowed; caller must not delete through this pointer. @lifetime Valid until setInstance or renderer destruction.

在文件 GeometryCollectionRenderer.h 第 67 行定义.

◆ lastActiveDrawCount()

int eve::physics::GeometryCollectionRenderer::lastActiveDrawCount ( ) const
inlinenoexcept

Number of bones drawn individually on the last successful draw.

在文件 GeometryCollectionRenderer.h 第 98 行定义.

◆ lastSleepBatchCount()

int eve::physics::GeometryCollectionRenderer::lastSleepBatchCount ( ) const
inlinenoexcept

Number of bones included in the sleeping batch on the last draw.

在文件 GeometryCollectionRenderer.h 第 100 行定义.

◆ operator=()

GeometryCollectionRenderer & eve::physics::GeometryCollectionRenderer::operator= ( const GeometryCollectionRenderer &  )
delete

◆ prepareAnimation()

eve::Result< void > eve::physics::GeometryCollectionRenderer::prepareAnimation ( const CollapseAnimation &  animation,
graphics::Graphics *  graphics 
)

Upload embedded meshes once before baked playback.

参数
animationBorrowed during call; immutable geometry ownership is shared by caches.
graphicsBorrowed graphics owner, must outlive renderer.
返回
Failure releases candidate meshes and retains the previous prepared asset. @cost GPU allocation proportional to triangles; prepare once per renderer/asset, never per frame. @thread Render thread; no callbacks or locks.

在文件 FractureRenderer.cpp 第 40 行定义.

引用了 bone, eve::physics::CollapseAnimation::boneCount(), eve::Result< T >::failure(), eve::physics::CollapseAnimation::fragmentGeometry(), graphics, groups, pose , 以及 eve::physics::CollapseAnimation::sample().

被这些函数引用 preparePlayback().

◆ prepareInstance()

eve::Result< void > eve::physics::GeometryCollectionRenderer::prepareInstance ( graphics::Graphics *  graphics)

Upload the bound live instance geometry before drawing it. @cost Same offline GPU allocation as prepareAnimation, amortized over live draws.

返回
Checked status; same ownership/thread contract as prepareAnimation.

在文件 FractureRenderer.cpp 第 50 行定义.

引用了 bone, eve::physics::GeometryCollectionInstance::boneCount(), eve::physics::GeometryCollectionInstance::bonePresentation(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::physics::GeometryCollectionInstance::fragmentGeometry(), graphics, groups, eve::InvalidArgument , 以及 pose.

◆ preparePlayback()

eve::Result< void > eve::physics::GeometryCollectionRenderer::preparePlayback ( const CollapsePlayback &  player,
graphics::Graphics *  graphics 
)

Prepare meshes for a frozen player without retaining its clock. @ownership Borrows player during the call; shares its immutable geometry. Graphics outlives renderer. @thread Render thread only, no callbacks. @cost GPU allocation proportional to triangles; prepare once per renderer and asset.

返回
Same checked preparation status as prepareAnimation.

在文件 FractureRenderer.cpp 第 191 行定义.

引用了 eve::physics::CollapsePlayback::animation(), graphics , 以及 prepareAnimation().

◆ setExteriorColor()

void eve::physics::GeometryCollectionRenderer::setExteriorColor ( float  r,
float  g,
float  b,
float  a 
)

Exterior-face RGBA; also used for Attached legacy box bones.

在文件 GeometryCollectionRenderer.cpp 第 82 行定义.

引用了 a, b, g , 以及 r.

◆ setGroupExteriorColor()

eve::Result< void > eve::physics::GeometryCollectionRenderer::setGroupExteriorColor ( int  groupId,
float  r,
float  g,
float  b,
float  a 
)

Set exterior RGBA for one authored structural group (clusterId).

参数
groupIdAuthor-defined group in [0,4095].
rRed linear color in [0,1].
gGreen linear color in [0,1].
bBlue linear color in [0,1].
aAlpha in [0,1].
返回
InvalidArgument leaves palette and prepared batches unchanged. @ownership Renderer owns color values; no borrowed resources. @thread Render thread, synchronous and reentrant-free; no callbacks. @cost Constant-size edit per matching material batch; no mesh rebuild/upload.

在文件 FractureRenderer.cpp 第 18 行定义.

引用了 a, b, eve::Diagnostic::error(), eve::Result< T >::failure(), g, eve::InvalidArgument, r , 以及 eve::Result< T >::success().

◆ setInstance()

void eve::physics::GeometryCollectionRenderer::setInstance ( GeometryCollectionInstance *  instance)

Replace the borrowed instance; null disables drawing. @ownership Does not take ownership of instance. @lifetime instance must outlive subsequent draws, or be cleared again.

在文件 GeometryCollectionRenderer.cpp 第 77 行定义.

◆ setInteriorColor()

void eve::physics::GeometryCollectionRenderer::setInteriorColor ( float  r,
float  g,
float  b,
float  a 
)

Cut-face RGBA; also used for Detached legacy box bones.

在文件 GeometryCollectionRenderer.cpp 第 90 行定义.

引用了 a, b, g , 以及 r.

◆ setSleepColor()

void eve::physics::GeometryCollectionRenderer::setSleepColor ( float  r,
float  g,
float  b,
float  a 
)

Sleeping-batch RGBA.

在文件 GeometryCollectionRenderer.cpp 第 98 行定义.

引用了 a, b, g , 以及 r.

◆ submitAnimation()

eve::Result< void > eve::physics::GeometryCollectionRenderer::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.

返回
Checked status; call after prepareAnimation and before gfx.render3D. @ownership Samples are copied immediately; no clip pointer is retained across frames. @thread Render thread; renderer owns forward/shadow contributor tokens and unregisters both before destruction. @cost Linear pose sampling and vertex upload once per frame; all passes reuse prepared GPU resources.

在文件 FractureRenderer.cpp 第 222 行定义.

引用了 eve::physics::CollapseAnimation::boneCount(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, p, pose, eve::physics::CollapseAnimation::sample(), x, y , 以及 z.

◆ submitPlayback()

eve::Result< void > eve::physics::GeometryCollectionRenderer::submitPlayback ( const CollapsePlayback &  player)

Submit this player's placed poses to forward, shadow and depth passes. @ownership Copies samples during call; no player reference survives the call. @thread Render thread only, no callbacks. Failed submission disables the prior submission. @cost Linear sampling and vertex upload per frame; prepared resources are reused across passes.

返回
Checked status; requires preparePlayback and embedded mesh geometry.

在文件 FractureRenderer.cpp 第 211 行定义.

引用了 eve::physics::CollapsePlayback::animation(), eve::physics::CollapseAnimation::boneCount(), eve::Result< T >::failure(), pose , 以及 eve::physics::CollapsePlayback::sample().


该类的文档由以下文件生成: