GPU mesh handle (+ optional CPU morph targets). 更多...
#include <Mesh.h>
Public 成员函数 | |
| bool | hasGpuSkinning () const |
| True after joint and weight data has been uploaded for GPU skinning. | |
| int | getSkinPaletteCount () const |
| Number of matrices in the current skinning palette. | |
| Result< void > | setSkinPalette (const float *matrices, int matrixCount) |
| Copy a dynamically sized column-major palette on the render thread. Invalid/non-finite input leaves the previous palette unchanged. No borrowed pointer survives this call. GPU uploads enforce device storage-buffer limits. | |
| const std::vector< float > & | skinPalette () const |
| Packed column-major matrix palette used by graphics backends. | |
| void | markGpuSkinned (bool value) |
| Mark whether the backend vertex stream contains skin attributes. | |
| Result< void > | setTexcoordSet (uint32_t set, std::span< const float > values) |
| Copy one packed ST channel; finite values/count are checked atomically. Render-thread only, no callbacks. Input is borrowed only during this call. | |
| std::span< const float > | texcoordSet (uint32_t set) const |
| Borrow a channel until mutation/destruction; empty means absent. Render-thread only. | |
| uint64_t | texcoordRevision () const |
| Revision used to invalidate backend UV uploads after a channel changes. | |
| bool | hasBounds () const |
| True when a valid bounding sphere is available for culling. | |
| void | computeBounds (const float *posXYZ, int vertexCount) |
| Compute the bounding sphere (centroid + max radius) from positions. | |
| void | draw (Graphics *, const glm::mat4 &) const override |
| Draws . | |
| void | drawOcclusion (Graphics *gfx, const glm::mat4 &matrix) const override |
| Screen-space black proxy for volumetric occlusion. Interprets matrix as 2D affine (translation + scale) and fills a solid rect — callers should pass a pixel-space placement (e.g. projected AABB). | |
| void | clearMorphData () |
| Clears morph data. | |
| void | initMorphBase (int vertexCount, const float *posXYZ, const float *nrmXYZ=nullptr, const float *uvST=nullptr) |
| Capture base pose (xyz packed). Optional normals/uvs (same vertex count). | |
| bool | addMorphTarget (const std::string &name, const float *deltaPosXYZ) |
| Adds morph target. | |
| bool | addMorphTargetAbsolute (const std::string &name, const float *absPosXYZ) |
| Absolute morph (Assimp aiAnimMesh style): stored as delta from base. | |
| int | getVertexCount () const |
| Returns the vertex count. | |
| int | getMorphCount () const |
| Returns the morph count. | |
| std::string | getMorphName (int index) const |
| Returns the morph name. | |
| bool | hasMorph (const std::string &name) const |
| True when morph. | |
| bool | setMorphWeight (const std::string &name, float weight) |
| Sets the morph weight. | |
| float | getMorphWeight (const std::string &name) const |
| Returns the morph weight. | |
| void | clearMorphWeights () |
| Clears morph weights. | |
| bool | isMorphDirty () const |
| True when morph dirty. | |
| void | markMorphClean () |
| Mark morph clean. | |
| bool | hasMorphData () const |
| True when morph data. | |
| void | computeMorphedPositions (std::vector< float > &outPos, std::vector< float > &outNrm) const |
| Bake current weights into outPos / outNrm (xyz packed). | |
| const std::vector< float > & | baseUv () const |
| Base uv. | |
| void | captureImportedAttributes (const ::aiMesh &mesh) |
| Retain imported UV/color/tangent streams for custom pipelines and baking. | |
| Result< void > | setTangentFrame (std::span< const float > tangents, std::span< const float > bitangents) |
| Atomically copy authored tangent and bitangent XYZ streams, or clear both with empty spans. | |
| Result< void > | validateTangentFrame (std::span< const float > tangents, std::span< const float > bitangents) const |
| Validate a frame against current vertex count without mutation or allocation on success. | |
| Result< void > | adoptTangentFrame (std::vector< float > &&tangents, std::vector< float > &&bitangents) |
| Validate then take owning frame buffers without allocating on success. | |
| Result< void > | validateMotionHighlights (std::span< const float > values) const |
| Validate an optional per-vertex motion-highlight stream without mutation. | |
| Result< void > | adoptMotionHighlights (std::vector< float > &&values) |
| Validate and transfer an owning motion-highlight stream without allocating on success. | |
| std::span< const float > | motionHighlights () const |
| Borrow motion-highlight scalars until replacement or mesh destruction. | |
| Result< void > | validateVegetationFactors (std::span< const float > values) const |
| Validate optional interleaved vegetation variation/occlusion pairs without mutation. | |
| Result< void > | adoptVegetationFactors (std::vector< float > &&values) |
| Validate and take ownership of interleaved vegetation variation/occlusion pairs. | |
| std::span< const float > | vegetationFactors () const |
| Borrow interleaved variation/occlusion pairs until mesh mutation or destruction. | |
| Result< void > | validateVegetationDeformationFactors (std::span< const float > values) const |
| Validate optional TVE rest-deformation data without mutation. Nine floats per vertex are pivot XYZ, bending, branch, flutter, variation, bounds height, and bounds radius. Masks are unit values and | |
| Result< void > | adoptVegetationDeformationFactors (std::vector< float > &&values) |
| Validate and atomically take ownership of a TVE rest-deformation stream. Failure preserves the mesh and input. Success swaps prior storage into the moved-from vector without allocating after validation. | |
| std::span< const float > | vegetationDeformationFactors () const |
| Borrow TVE rest-deformation data until mesh mutation or destruction. | |
| int | getUvChannelCount () const |
| int | getColorChannelCount () const |
| Returns the color channel count. | |
| bool | hasImportedTangents () const |
| True when imported tangents. | |
| const std::vector< float > & | importedUv (int channel) const |
| Imported uv. | |
| const std::vector< float > & | importedColor (int channel) const |
| Imported color. | |
| const std::vector< float > & | importedTangents () const |
| Imported tangents. | |
| const std::vector< float > & | importedBitangents () const |
| Imported bitangents. | |
Public 成员函数 继承自 eve::graphics::Drawable | |
| virtual | ~Drawable () |
| Releases Drawable resources. | |
| bool | getCastOcclusion () const |
| When false, skipped by Graphics::drawOcclusion / volumetric occluder passes. | |
| void | setCastOcclusion (bool cast) |
| Sets the cast occlusion. | |
Public 属性 | |
| int | indexCount = 0 |
| void * | gpuHandle = nullptr |
| int | gpuVertexCount = 0 |
| Vertex count of the GPU buffer (morph CPU base may be empty). | |
| float | boundsCx = 0.f |
| Model-space bounding sphere used for view/cascade frustum culling. Computed from vertex positions at upload time (see computeBounds). boundsRadius <= 0 means unknown — callers must treat the mesh as always visible (no culling). | |
| float | boundsCy = 0.f |
| float | boundsCz = 0.f |
| float | boundsRadius = 0.f |
详细描述
GPU mesh handle (+ optional CPU morph targets).
Morph pipeline: initMorphBase / addMorphTarget* → setMorphWeight → Graphics::bakeMeshMorph (uploads blended positions to the host-visible VBO).
成员函数说明
◆ addMorphTarget()
| bool eve::graphics::Mesh::addMorphTarget | ( | const std::string & | name, |
| const float * | deltaPosXYZ | ||
| ) |
◆ addMorphTargetAbsolute()
| bool eve::graphics::Mesh::addMorphTargetAbsolute | ( | const std::string & | name, |
| const float * | absPosXYZ | ||
| ) |
Absolute morph (Assimp aiAnimMesh style): stored as delta from base.
引用了 hasMorph(), name , 以及 t.
◆ adoptMotionHighlights()
| Result< void > eve::graphics::Mesh::adoptMotionHighlights | ( | std::vector< float > && | values | ) |
Validate and transfer an owning motion-highlight stream without allocating on success.
- 备注
- Render-thread only, no callbacks. Failure preserves both mesh and input; success swaps old storage into input. Data lives until replacement or mesh destruction.
- 返回
- Checked validity, including empty-stream clearing.
在文件 MeshTangent.cpp 第 63 行定义.
引用了 eve::Result< T >::success(), valid, validateMotionHighlights() , 以及 values.
◆ adoptTangentFrame()
| Result< void > eve::graphics::Mesh::adoptTangentFrame | ( | std::vector< float > && | tangents, |
| std::vector< float > && | bitangents | ||
| ) |
Validate then take owning frame buffers without allocating on success.
- 备注
- Render-thread only, no callbacks. Failure does not consume inputs or change mesh state. Success transfers ownership; previous buffers are returned in the moved-from input vectors.
- 返回
- Checked validity. Useful after prevalidation for coupled geometry updates.
在文件 MeshTangent.cpp 第 93 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::Result< T >::success(), valid , 以及 validateTangentFrame().
◆ adoptVegetationDeformationFactors()
| Result< void > eve::graphics::Mesh::adoptVegetationDeformationFactors | ( | std::vector< float > && | values | ) |
Validate and atomically take ownership of a TVE rest-deformation stream. Failure preserves the mesh and input. Success swaps prior storage into the moved-from vector without allocating after validation.
在文件 MeshTangent.cpp 第 45 行定义.
引用了 eve::Result< T >::success(), valid, validateVegetationDeformationFactors() , 以及 values.
◆ adoptVegetationFactors()
| Result< void > eve::graphics::Mesh::adoptVegetationFactors | ( | std::vector< float > && | values | ) |
Validate and take ownership of interleaved vegetation variation/occlusion pairs.
- 备注
- Render-thread only, no callbacks. Failure preserves mesh and input. Success swaps previous storage into the moved-from vector, so the operation cannot allocate after validation.
- 返回
- Checked validity, including the empty-stream clear operation.
在文件 MeshTangent.cpp 第 19 行定义.
引用了 eve::Result< T >::success(), valid, validateVegetationFactors() , 以及 values.
◆ baseUv()
|
inline |
◆ captureImportedAttributes()
| void eve::graphics::Mesh::captureImportedAttributes | ( | const ::aiMesh & | mesh | ) |
◆ clearMorphData()
| void eve::graphics::Mesh::clearMorphData | ( | ) |
◆ clearMorphWeights()
◆ computeBounds()
| void eve::graphics::Mesh::computeBounds | ( | const float * | posXYZ, |
| int | vertexCount | ||
| ) |
Compute the bounding sphere (centroid + max radius) from positions.
引用了 boundsCx, boundsCy, boundsCz, boundsRadius, c, d, dx, dy, dz, n, r, u , 以及 vertexCount.
被这些函数引用 eve::graphics::vulkan::Graphics::newMeshFromArraysColored() , 以及 eve::graphics::updateVegetationMesh().
◆ computeMorphedPositions()
| void eve::graphics::Mesh::computeMorphedPositions | ( | std::vector< float > & | outPos, |
| std::vector< float > & | outNrm | ||
| ) | const |
◆ draw()
|
inlineoverridevirtual |
◆ drawOcclusion()
|
overridevirtual |
Screen-space black proxy for volumetric occlusion. Interprets matrix as 2D affine (translation + scale) and fills a solid rect — callers should pass a pixel-space placement (e.g. projected AABB).
引用了 eve::graphics::Graphics::drawOcclusionSolid(), eve::graphics::Drawable::getCastOcclusion(), h, w, x , 以及 y.
◆ getColorChannelCount()
|
inline |
◆ getMorphCount()
| int eve::graphics::Mesh::getMorphCount | ( | ) | const |
Returns the morph count.
被这些函数引用 eve::avatar::AvatarInstance::setExpression() , 以及 eve::avatar::AvatarInstance::transitionExpression().
◆ getMorphName()
| std::string eve::graphics::Mesh::getMorphName | ( | int | index | ) | const |
Returns the morph name.
引用了 index.
被这些函数引用 eve::avatar::AvatarInstance::setExpression() , 以及 eve::avatar::AvatarInstance::transitionExpression().
◆ getMorphWeight()
| float eve::graphics::Mesh::getMorphWeight | ( | const std::string & | name | ) | const |
◆ getSkinPaletteCount()
|
inline |
◆ getUvChannelCount()
◆ getVertexCount()
| int eve::graphics::Mesh::getVertexCount | ( | ) | const |
◆ hasBounds()
|
inline |
True when a valid bounding sphere is available for culling.
◆ hasGpuSkinning()
|
inline |
◆ hasImportedTangents()
|
inline |
◆ hasMorph()
| bool eve::graphics::Mesh::hasMorph | ( | const std::string & | name | ) | const |
True when morph.
引用了 name.
被这些函数引用 addMorphTarget(), addMorphTargetAbsolute(), eve::avatar::AvatarInstance::mapViseme() , 以及 eve::avatar::AvatarInstance::setParameter().
◆ hasMorphData()
|
inline |
True when morph data.
被这些函数引用 eve::avatar::AvatarInstance::setExpression() , 以及 eve::avatar::AvatarInstance::transitionExpression().
◆ importedBitangents()
|
inline |
◆ importedColor()
| const std::vector< float > & eve::graphics::Mesh::importedColor | ( | int | channel | ) | const |
◆ importedTangents()
|
inline |
◆ importedUv()
| const std::vector< float > & eve::graphics::Mesh::importedUv | ( | int | channel | ) | const |
◆ initMorphBase()
| void eve::graphics::Mesh::initMorphBase | ( | int | vertexCount, |
| const float * | posXYZ, | ||
| const float * | nrmXYZ = nullptr, |
||
| const float * | uvST = nullptr |
||
| ) |
Capture base pose (xyz packed). Optional normals/uvs (same vertex count).
引用了 clearMorphData(), n , 以及 vertexCount.
◆ isMorphDirty()
|
inline |
◆ markGpuSkinned()
|
inline |
◆ markMorphClean()
◆ motionHighlights()
|
inline |
◆ setMorphWeight()
| bool eve::graphics::Mesh::setMorphWeight | ( | const std::string & | name, |
| float | weight | ||
| ) |
Sets the morph weight.
◆ setSkinPalette()
| Result< void > eve::graphics::Mesh::setSkinPalette | ( | const float * | matrices, |
| int | matrixCount | ||
| ) |
Copy a dynamically sized column-major palette on the render thread. Invalid/non-finite input leaves the previous palette unchanged. No borrowed pointer survives this call. GPU uploads enforce device storage-buffer limits.
- 返回
- Success or InvalidArgument; allocation failure leaves state unchanged.
引用了 count, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::Result< T >::success().
◆ setTangentFrame()
| Result< void > eve::graphics::Mesh::setTangentFrame | ( | std::span< const float > | tangents, |
| std::span< const float > | bitangents | ||
| ) |
Atomically copy authored tangent and bitangent XYZ streams, or clear both with empty spans.
- 返回
- Checked invalid-input/allocation failure leaves both streams unchanged.
- 备注
- Render-thread only, no callbacks. Inputs are borrowed during the call; mesh owns the copies until replacement or destruction. Both streams must match vertex count and contain finite, nonzero, nonparallel vectors. No normalization or coordinate conversion.
在文件 MeshTangent.cpp 第 103 行定义.
引用了 b, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Result< T >::success(), t, valid , 以及 validateTangentFrame().
◆ setTexcoordSet()
| Result< void > eve::graphics::Mesh::setTexcoordSet | ( | uint32_t | set, |
| std::span< const float > | values | ||
| ) |
Copy one packed ST channel; finite values/count are checked atomically. Render-thread only, no callbacks. Input is borrowed only during this call.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), gpuVertexCount, eve::InvalidArgument, owned, eve::Result< T >::success(), values , 以及 x.
◆ skinPalette()
|
inline |
◆ texcoordRevision()
|
inline |
◆ texcoordSet()
| std::span< const float > eve::graphics::Mesh::texcoordSet | ( | uint32_t | set | ) | const |
◆ validateMotionHighlights()
| Result< void > eve::graphics::Mesh::validateMotionHighlights | ( | std::span< const float > | values | ) | const |
Validate an optional per-vertex motion-highlight stream without mutation.
- 备注
- Render-thread only; synchronous borrowed input, no callbacks or retained references. Empty clears the stream; otherwise one finite nonnegative scalar is required per vertex.
- 返回
- Checked validity; no allocation on success.
在文件 MeshTangent.cpp 第 51 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), gpuVertexCount, eve::InvalidArgument, eve::Result< T >::success(), value , 以及 values.
被这些函数引用 adoptMotionHighlights() , 以及 eve::graphics::updateVegetationMesh().
◆ validateTangentFrame()
| Result< void > eve::graphics::Mesh::validateTangentFrame | ( | std::span< const float > | tangents, |
| std::span< const float > | bitangents | ||
| ) | const |
Validate a frame against current vertex count without mutation or allocation on success.
- 备注
- Render-thread only, synchronous borrowed spans, no callbacks.
- 返回
- Checked validity, including the empty-frame clear operation.
在文件 MeshTangent.cpp 第 69 行定义.
引用了 b, c, eve::Diagnostic::error(), eve::Result< T >::failure(), gpuVertexCount, eve::InvalidArgument, eve::Result< T >::success(), t , 以及 tb.
被这些函数引用 adoptTangentFrame(), setTangentFrame() , 以及 eve::graphics::updateVegetationMesh().
◆ validateVegetationDeformationFactors()
| Result< void > eve::graphics::Mesh::validateVegetationDeformationFactors | ( | std::span< const float > | values | ) | const |
Validate optional TVE rest-deformation data without mutation. Nine floats per vertex are pivot XYZ, bending, branch, flutter, variation, bounds height, and bounds radius. Masks are unit values and
- bounds are finite nonnegative world units. Empty clears the stream.
- 备注
- Render-thread only; the input is borrowed synchronously and no callbacks run.
在文件 MeshTangent.cpp 第 25 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), gpuVertexCount, eve::InvalidArgument, eve::Result< T >::success() , 以及 values.
被这些函数引用 adoptVegetationDeformationFactors().
◆ validateVegetationFactors()
| Result< void > eve::graphics::Mesh::validateVegetationFactors | ( | std::span< const float > | values | ) | const |
Validate optional interleaved vegetation variation/occlusion pairs without mutation.
- 备注
- Render-thread only; values are borrowed for this call. Empty clears the stream; otherwise two finite unit values are required per vertex.
- 返回
- Checked validity; no allocation or callbacks.
在文件 MeshTangent.cpp 第 6 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), gpuVertexCount, eve::InvalidArgument, eve::Result< T >::success() , 以及 values.
被这些函数引用 adoptVegetationFactors() , 以及 eve::graphics::updateVegetationMesh().
◆ vegetationDeformationFactors()
|
inline |
◆ vegetationFactors()
|
inline |
类成员变量说明
◆ boundsCx
| float eve::graphics::Mesh::boundsCx = 0.f |
Model-space bounding sphere used for view/cascade frustum culling. Computed from vertex positions at upload time (see computeBounds). boundsRadius <= 0 means unknown — callers must treat the mesh as always visible (no culling).
被这些函数引用 computeBounds() , 以及 eve::graphics::RenderSystem3D::render().
◆ boundsCy
| float eve::graphics::Mesh::boundsCy = 0.f |
被这些函数引用 computeBounds() , 以及 eve::graphics::RenderSystem3D::render().
◆ boundsCz
| float eve::graphics::Mesh::boundsCz = 0.f |
被这些函数引用 computeBounds() , 以及 eve::graphics::RenderSystem3D::render().
◆ boundsRadius
| float eve::graphics::Mesh::boundsRadius = 0.f |
被这些函数引用 computeBounds() , 以及 eve::graphics::RenderSystem3D::render().
◆ gpuHandle
◆ gpuVertexCount
| int eve::graphics::Mesh::gpuVertexCount = 0 |
Vertex count of the GPU buffer (morph CPU base may be empty).
被这些函数引用 getVertexCount(), setTexcoordSet(), validateMotionHighlights(), validateTangentFrame(), validateVegetationDeformationFactors() , 以及 validateVegetationFactors().
◆ indexCount
该类的文档由以下文件生成:
- src/modules/graphics/Mesh.h
- src/modules/graphics/Mesh.cpp
- src/modules/graphics/MeshTangent.cpp
Public 成员函数 继承自