CPU-side decoded 3D model (Assimp scene owned via medialoader::ModelScene). Does not upload to GPU — use graphics::Graphics::newMeshFromAssimp on getMesh(). 更多...
#include <ModelData.h>
Public 成员函数 | |
| ModelData (medialoader::ModelScene scene, std::string uri="", bool uvFlipped=false) | |
| Own a decoded scene and the UV postprocessing state used to produce it. | |
| bool | hasFlippedUvs () const noexcept |
| Whether the loader applied the UV-flip postprocess to this owned scene. | |
| ~ModelData () override | |
| Model data. | |
| bool | empty () const |
| Empty. | |
| int | getMeshCount () const |
| Returns the mesh count. | |
| int | getMaterialCount () const |
| Returns the material count. | |
| int | getVertexCount (int meshIndex) const |
| Returns the vertex count. | |
| int | getFaceCount (int meshIndex) const |
| Returns the face count. | |
| float | getVertexPosition (int meshIndex, int vertexIndex, int component) const |
| Source position component for one vertex (component 0=x, 1=y, 2=z). | |
| float | getVertexNormal (int meshIndex, int vertexIndex, int component) const |
| Source normal component for one vertex (component 0=x, 1=y, 2=z). | |
| eve::Result< void > | setVertexNormal (int meshIndex, int vertexIndex, float x, float y, float z) |
| Write one unit (or zero) object-space vertex normal. Allocates the normal stream when the mesh has positions but no normals. | |
| eve::Result< void > | applyVertexNormals (int meshIndex, std::string_view kind) |
| Replace every vertex normal on a mesh from a named procedure. | |
| eve::Result< void > | applyVertexNormalsFrom (int meshIndex, std::string_view kind, float originX, float originY, float originZ) |
Like applyVertexNormals, but "radial" uses an explicit origin. | |
| eve::Result< std::unique_ptr< image::ImageData > > | bakeNormalMap (int meshIndex, int width, int height, int uvChannel=0, std::string_view space="tangent") const |
| Rasterize current object-space vertex normals into an RGBA8 normal map. | |
| int | getFaceVertexIndex (int meshIndex, int triangleIndex, int corner) const |
| Source vertex index for one triangle corner (corner 0..2). | |
| bool | hasNormals (int meshIndex) const |
| True when normals. | |
| bool | hasTexCoords (int meshIndex) const |
| True when tex coords. | |
| int | getTexCoordChannelCount (int meshIndex) const |
| Number of populated UV channels (0..AI_MAX_NUMBER_OF_TEXTURECOORDS). | |
| bool | hasTexCoordChannel (int meshIndex, int channel) const |
| Whether a mesh has the requested UV channel. | |
| float | getTexCoord (int meshIndex, int channel, int vertexIndex, int component) const |
| UV component in channel for vertex (component 0=u, 1=v, 2=w). | |
| eve::Result< SurfaceUv > | mapSurfacePointToUv (int meshIndex, int triangleIndex, float localX, float localY, float localZ, int channel=0) const |
| Map a point on one source triangle to UV coordinates by barycentric interpolation. | |
| bool | hasTangents (int meshIndex) const |
| Whether imported tangent and bitangent streams exist. | |
| float | getTangent (int meshIndex, int vertexIndex, int component) const |
| Tangent XYZ component for a vertex. | |
| float | getBitangent (int meshIndex, int vertexIndex, int component) const |
| Bitangent XYZ component for a vertex. | |
| int | getVertexColorChannelCount (int meshIndex) const |
| Number of populated vertex-color channels. | |
| bool | hasVertexColorChannel (int meshIndex, int channel) const |
| Whether a mesh has the requested vertex-color channel. | |
| float | getVertexColor (int meshIndex, int channel, int vertexIndex, int component) const |
| RGBA component (0..3) in a vertex-color channel. | |
| int | getMaterialIndex (int meshIndex) const |
| Assimp material slot referenced by a mesh; -1 when invalid. | |
| std::string | getMaterialName (int matIndex) const |
| Returns the material name. | |
| float | getMaterialBaseColorR (int matIndex) const |
| Base color: glTF BASE_COLOR, falling back to OBJ/legacy DIFFUSE. | |
| float | getMaterialBaseColorG (int matIndex) const |
| Returns the material base color g. | |
| float | getMaterialBaseColorB (int matIndex) const |
| Returns the material base color b. | |
| float | getMaterialBaseColorA (int matIndex) const |
| Returns the material base color a. | |
| float | getMaterialMetallicFactor (int matIndex) const |
| PBR factors; defaults 0 (metallic) / 0.45 (roughness) when absent. | |
| float | getMaterialRoughnessFactor (int matIndex) const |
| Returns the material roughness factor. | |
| float | getMaterialOpacity (int matIndex) const |
| Returns the material opacity. | |
| bool | getMaterialTwoSided (int matIndex) const |
| Returns the material two sided. | |
| std::string | getMaterialAlphaMode (int matIndex) const |
| glTF alpha mode normalized to "OPAQUE", "MASK", or "BLEND". | |
| float | getMaterialAlphaCutoff (int matIndex) const |
| Returns the material alpha cutoff. | |
| int | getMaterialTextureSlotCount (int matIndex, const std::string &type) const |
| Texture type names (Squirrel strings): "base_color", "diffuse", "normals", "height", "emissive", "metalness", "roughness", "ambient_occlusion", "lightmap", "opacity", "specular", "shininess". | |
| std::string | getMaterialTexturePath (int matIndex, const std::string &type, int slot=0) const |
| External file path, or "*N" for an embedded texture. Empty when absent. | |
| int | getMaterialTextureEmbeddedIndex (int matIndex, const std::string &type, int slot=0) const |
| Scene texture index for embedded "*N" references; -1 for external files. | |
| int | getEmbeddedTextureCount () const |
| Returns the embedded texture count. | |
| std::string | getEmbeddedTextureName (int idx) const |
| Returns the embedded texture name. | |
| int | getEmbeddedTextureWidth (int idx) const |
| Returns the embedded texture width. | |
| int | getEmbeddedTextureHeight (int idx) const |
| 0 means a compressed blob (use getEmbeddedTextureImageData to decode). | |
| image::ImageData * | getEmbeddedTextureImageData (int idx) const |
| Returns the embedded texture image data. | |
| int | getMorphTargetCount (int meshIndex) const |
| Assimp morph / blend-shape targets on a mesh (aiAnimMesh). | |
| std::string | getMorphTargetName (int meshIndex, int morphIndex) const |
| Returns the morph target name. | |
| bool | hasBones (int meshIndex) const |
| Assimp skeletal skin data (aiBone / vertex weights) on a mesh. | |
| int | getBoneCount (int meshIndex) const |
| Returns the bone count. | |
| std::string | getBoneName (int meshIndex, int boneIndex) const |
| Returns the bone name. | |
| float | getInverseBindMatrixElement (int meshIndex, int boneIndex, int elementIndex) const |
| Inverse-bind (offset) matrix element, column-major, elementIndex in [0,15]. | |
| int | getBoneWeightCount (int meshIndex, int boneIndex) const |
| Returns the bone weight count. | |
| int | getBoneWeightVertex (int meshIndex, int boneIndex, int weightIndex) const |
| Returns the bone weight vertex. | |
| float | getBoneWeightValue (int meshIndex, int boneIndex, int weightIndex) const |
| Returns the bone weight value. | |
| int | getAnimationCount () const |
| Scene-level animation clips (aiAnimation). | |
| std::string | getAnimationName (int animIndex) const |
| Returns the animation name. | |
| const aiScene * | getScene () const |
| Returns the scene. | |
| const aiMesh * | getMesh (int meshIndex) const |
| Raw Assimp mesh at meshIndex; returns nullptr when out of range. | |
| void | adopt (eve::Resource &replacement) override |
Replace this scene with replacement's (cache reload). | |
Public 成员函数 继承自 eve::Resource | |
| virtual | ~Resource () |
| Releases Resource resources. | |
| Resource (const Resource &)=delete | |
| Resources own keep-alive pins, so they are not copyable. | |
| Resource & | operator= (const Resource &)=delete |
| std::string | getUri () const |
| Returns the uri. | |
| EVENGINE_API_FOUNDATION std::vector< Resource * > | getDependencies () const |
| Borrowed views of the resources this instance keeps alive. | |
| EVENGINE_API_FOUNDATION eve::Result< void > | addDependency (Resource &dependency) |
Keeps dependency alive for as long as this instance lives. | |
额外继承的成员函数 | |
Protected 成员函数 继承自 eve::Resource | |
| Resource (std::string uri) | |
| Constructs a Resource. | |
| void | setUri (std::string value) |
| Set the resource URI (the cache key). Used by ResourceManager. | |
Protected 属性 继承自 eve::Resource | |
| std::string | uri |
| std::vector< ResourcePin > | dependencies |
| Keep-alive pins; see getDependencies()/addDependency(). | |
详细描述
CPU-side decoded 3D model (Assimp scene owned via medialoader::ModelScene). Does not upload to GPU — use graphics::Graphics::newMeshFromAssimp on getMesh().
在文件 ModelData.h 第 39 行定义.
构造及析构函数说明
◆ ModelData()
|
explicit |
Own a decoded scene and the UV postprocessing state used to produce it.
- 参数
-
scene Transferred owning Assimp scene. uri Resource identity, copied into the resource owner. uvFlipped Whether aiProcess_FlipUVs was applied after format decoding. @thread Creation/adoption follow the owning resource thread; no callbacks.
在文件 ModelData.cpp 第 54 行定义.
引用了 scene.
◆ ~ModelData()
|
overridedefault |
Model data.
成员函数说明
◆ adopt()
|
overridevirtual |
Replace this scene with replacement's (cache reload).
实现了 eve::Resource.
在文件 ModelData.cpp 第 59 行定义.
◆ applyVertexNormals()
| eve::Result< void > eve::model3d::ModelData::applyVertexNormals | ( | int | meshIndex, |
| std::string_view | kind | ||
| ) |
Replace every vertex normal on a mesh from a named procedure.
- 参数
-
meshIndex Mesh slot in this ModelData. kind "radial": each normal is the unit vector from the mesh AABB center to that vertex (outward). Vertices coinciding with the center receive (0,0,1).
- 返回
- Applied on success. Does not mutate on failure. @ownership Borrowed
this. @thread Affine to this mutable ModelData; same cache caveat as setVertexNormal. @reentrancy Does not invoke callbacks.
在文件 ModelNormals.cpp 第 167 行定义.
引用了 applyVertexNormalsFrom(), eve::Result< T >::failure(), kind, mesh , 以及 origin.
◆ applyVertexNormalsFrom()
| eve::Result< void > eve::model3d::ModelData::applyVertexNormalsFrom | ( | int | meshIndex, |
| std::string_view | kind, | ||
| float | originX, | ||
| float | originY, | ||
| float | originZ | ||
| ) |
Like applyVertexNormals, but "radial" uses an explicit origin.
- 参数
-
meshIndex Mesh slot in this ModelData. kind Currently only "radial".originX Radial origin X in the mesh local space. originY Radial origin Y in the mesh local space. originZ Radial origin Z in the mesh local space.
- 返回
- Applied on success. Does not mutate on failure. @ownership Borrowed
this. @thread Affine to this mutable ModelData; same cache caveat as setVertexNormal. @reentrancy Does not invoke callbacks.
在文件 ModelNormals.cpp 第 179 行定义.
引用了 eve::Applied, eve::Result< T >::failure(), kind, mesh, eve::Status::success() , 以及 eve::Result< T >::success().
被这些函数引用 applyVertexNormals().
◆ bakeNormalMap()
| eve::Result< std::unique_ptr< image::ImageData > > eve::model3d::ModelData::bakeNormalMap | ( | int | meshIndex, |
| int | width, | ||
| int | height, | ||
| int | uvChannel = 0, |
||
| std::string_view | space = "tangent" |
||
| ) | const |
Rasterize current object-space vertex normals into an RGBA8 normal map.
- 参数
-
meshIndex Mesh slot; faces must be triangles with the given UV channel. width Map width in pixels; must be positive. height Map height in pixels; must be positive. uvChannel UV set to unwrap (usually 0). Image Y is (1-v) (top-left). space "tangent"(default): encode TBN-space normals for PBR sampling."object": encode interpolated object-space normals. Uncovered texels are tangent (0.5,0.5,1) or object (0.5,0.5,1).
- 返回
- Owning ImageData on success. Does not mutate this ModelData. @ownership Caller owns the ImageData unique_ptr. @thread Affine to this ModelData; the returned image is independent. @reentrancy Does not invoke callbacks.
在文件 ModelNormals.cpp 第 195 行定义.
引用了 eve::Diagnostic::error(), f, eve::Result< T >::failure(), height, i0, i1, i2, image, mesh, eve::NotFound, object, scale, eve::Result< T >::success(), width, x , 以及 y.
◆ empty()
| bool eve::model3d::ModelData::empty | ( | ) | const |
Empty.
在文件 ModelData.cpp 第 65 行定义.
◆ getAnimationCount()
| int eve::model3d::ModelData::getAnimationCount | ( | ) | const |
◆ getAnimationName()
| std::string eve::model3d::ModelData::getAnimationName | ( | int | animIndex | ) | const |
◆ getBitangent()
| float eve::model3d::ModelData::getBitangent | ( | int | meshIndex, |
| int | vertexIndex, | ||
| int | component | ||
| ) | const |
◆ getBoneCount()
| int eve::model3d::ModelData::getBoneCount | ( | int | meshIndex | ) | const |
◆ getBoneName()
| std::string eve::model3d::ModelData::getBoneName | ( | int | meshIndex, |
| int | boneIndex | ||
| ) | const |
◆ getBoneWeightCount()
| int eve::model3d::ModelData::getBoneWeightCount | ( | int | meshIndex, |
| int | boneIndex | ||
| ) | const |
◆ getBoneWeightValue()
| float eve::model3d::ModelData::getBoneWeightValue | ( | int | meshIndex, |
| int | boneIndex, | ||
| int | weightIndex | ||
| ) | const |
◆ getBoneWeightVertex()
| int eve::model3d::ModelData::getBoneWeightVertex | ( | int | meshIndex, |
| int | boneIndex, | ||
| int | weightIndex | ||
| ) | const |
◆ getEmbeddedTextureCount()
| int eve::model3d::ModelData::getEmbeddedTextureCount | ( | ) | const |
◆ getEmbeddedTextureHeight()
| int eve::model3d::ModelData::getEmbeddedTextureHeight | ( | int | idx | ) | const |
0 means a compressed blob (use getEmbeddedTextureImageData to decode).
在文件 ModelData.cpp 第 422 行定义.
引用了 getScene() , 以及 idx.
◆ getEmbeddedTextureImageData()
| image::ImageData * eve::model3d::ModelData::getEmbeddedTextureImageData | ( | int | idx | ) | const |
Returns the embedded texture image data.
Decode an embedded texture to RGBA8 ImageData (caller owns the result). Compressed blobs (PNG/JPEG/...) go through the image module; raw BGRA texels (mHeight > 0) are converted in place. Returns nullptr on failure.
在文件 ModelData.cpp 第 429 行定义.
引用了 bytes, getScene(), h, idx , 以及 w.
◆ getEmbeddedTextureName()
| std::string eve::model3d::ModelData::getEmbeddedTextureName | ( | int | idx | ) | const |
◆ getEmbeddedTextureWidth()
| int eve::model3d::ModelData::getEmbeddedTextureWidth | ( | int | idx | ) | const |
◆ getFaceCount()
| int eve::model3d::ModelData::getFaceCount | ( | int | meshIndex | ) | const |
Returns the face count.
- 异常
-
eve::Exception when meshIndex is out of range.
在文件 ModelData.cpp 第 108 行定义.
引用了 m.
◆ getFaceVertexIndex()
| int eve::model3d::ModelData::getFaceVertexIndex | ( | int | meshIndex, |
| int | triangleIndex, | ||
| int | corner | ||
| ) | const |
◆ getInverseBindMatrixElement()
| float eve::model3d::ModelData::getInverseBindMatrixElement | ( | int | meshIndex, |
| int | boneIndex, | ||
| int | elementIndex | ||
| ) | const |
Inverse-bind (offset) matrix element, column-major, elementIndex in [0,15].
在文件 ModelData.cpp 第 497 行定义.
◆ getMaterialAlphaCutoff()
| float eve::model3d::ModelData::getMaterialAlphaCutoff | ( | int | matIndex | ) | const |
Returns the material alpha cutoff.
在文件 ModelData.cpp 第 366 行定义.
◆ getMaterialAlphaMode()
| std::string eve::model3d::ModelData::getMaterialAlphaMode | ( | int | matIndex | ) | const |
glTF alpha mode normalized to "OPAQUE", "MASK", or "BLEND".
在文件 ModelData.cpp 第 354 行定义.
引用了 getMaterialOpacity() , 以及 value.
◆ getMaterialBaseColorA()
| float eve::model3d::ModelData::getMaterialBaseColorA | ( | int | matIndex | ) | const |
Returns the material base color a.
在文件 ModelData.cpp 第 314 行定义.
◆ getMaterialBaseColorB()
| float eve::model3d::ModelData::getMaterialBaseColorB | ( | int | matIndex | ) | const |
Returns the material base color b.
在文件 ModelData.cpp 第 310 行定义.
◆ getMaterialBaseColorG()
| float eve::model3d::ModelData::getMaterialBaseColorG | ( | int | matIndex | ) | const |
Returns the material base color g.
在文件 ModelData.cpp 第 306 行定义.
◆ getMaterialBaseColorR()
| float eve::model3d::ModelData::getMaterialBaseColorR | ( | int | matIndex | ) | const |
Base color: glTF BASE_COLOR, falling back to OBJ/legacy DIFFUSE.
在文件 ModelData.cpp 第 302 行定义.
◆ getMaterialCount()
| int eve::model3d::ModelData::getMaterialCount | ( | ) | const |
◆ getMaterialIndex()
| int eve::model3d::ModelData::getMaterialIndex | ( | int | meshIndex | ) | const |
◆ getMaterialMetallicFactor()
| float eve::model3d::ModelData::getMaterialMetallicFactor | ( | int | matIndex | ) | const |
PBR factors; defaults 0 (metallic) / 0.45 (roughness) when absent.
在文件 ModelData.cpp 第 318 行定义.
引用了 metallic.
◆ getMaterialName()
| std::string eve::model3d::ModelData::getMaterialName | ( | int | matIndex | ) | const |
◆ getMaterialOpacity()
| float eve::model3d::ModelData::getMaterialOpacity | ( | int | matIndex | ) | const |
Returns the material opacity.
在文件 ModelData.cpp 第 336 行定义.
引用了 opacity.
被这些函数引用 getMaterialAlphaMode().
◆ getMaterialRoughnessFactor()
| float eve::model3d::ModelData::getMaterialRoughnessFactor | ( | int | matIndex | ) | const |
◆ getMaterialTextureEmbeddedIndex()
| int eve::model3d::ModelData::getMaterialTextureEmbeddedIndex | ( | int | matIndex, |
| const std::string & | type, | ||
| int | slot = 0 |
||
| ) | const |
Scene texture index for embedded "*N" references; -1 for external files.
在文件 ModelData.cpp 第 394 行定义.
引用了 getMaterialTexturePath(), path , 以及 type.
◆ getMaterialTexturePath()
| std::string eve::model3d::ModelData::getMaterialTexturePath | ( | int | matIndex, |
| const std::string & | type, | ||
| int | slot = 0 |
||
| ) | const |
External file path, or "*N" for an embedded texture. Empty when absent.
在文件 ModelData.cpp 第 382 行定义.
被这些函数引用 getMaterialTextureEmbeddedIndex().
◆ getMaterialTextureSlotCount()
| int eve::model3d::ModelData::getMaterialTextureSlotCount | ( | int | matIndex, |
| const std::string & | type | ||
| ) | const |
Texture type names (Squirrel strings): "base_color", "diffuse", "normals", "height", "emissive", "metalness", "roughness", "ambient_occlusion", "lightmap", "opacity", "specular", "shininess".
在文件 ModelData.cpp 第 374 行定义.
引用了 type.
◆ getMaterialTwoSided()
| bool eve::model3d::ModelData::getMaterialTwoSided | ( | int | matIndex | ) | const |
Returns the material two sided.
在文件 ModelData.cpp 第 345 行定义.
◆ getMesh()
| const aiMesh * eve::model3d::ModelData::getMesh | ( | int | meshIndex | ) | const |
Raw Assimp mesh at meshIndex; returns nullptr when out of range.
在文件 ModelData.cpp 第 87 行定义.
◆ getMeshCount()
| int eve::model3d::ModelData::getMeshCount | ( | ) | const |
◆ getMorphTargetCount()
| int eve::model3d::ModelData::getMorphTargetCount | ( | int | meshIndex | ) | const |
Assimp morph / blend-shape targets on a mesh (aiAnimMesh).
在文件 ModelData.cpp 第 457 行定义.
引用了 m.
被这些函数引用 eve::avatar::AvatarInstance::loadMorphNamesFromModel().
◆ getMorphTargetName()
| std::string eve::model3d::ModelData::getMorphTargetName | ( | int | meshIndex, |
| int | morphIndex | ||
| ) | const |
Returns the morph target name.
在文件 ModelData.cpp 第 463 行定义.
引用了 m.
被这些函数引用 eve::avatar::AvatarInstance::loadMorphNamesFromModel().
◆ getScene()
| const aiScene * eve::model3d::ModelData::getScene | ( | ) | const |
Returns the scene.
在文件 ModelData.cpp 第 67 行定义.
被这些函数引用 eve::sceneloader::SceneLoader::diff(), getAnimationCount(), getAnimationName(), getEmbeddedTextureCount(), getEmbeddedTextureHeight(), getEmbeddedTextureImageData(), getEmbeddedTextureName(), getEmbeddedTextureWidth(), getMaterialCount() , 以及 getMeshCount().
◆ getTangent()
| float eve::model3d::ModelData::getTangent | ( | int | meshIndex, |
| int | vertexIndex, | ||
| int | component | ||
| ) | const |
◆ getTexCoord()
| float eve::model3d::ModelData::getTexCoord | ( | int | meshIndex, |
| int | channel, | ||
| int | vertexIndex, | ||
| int | component | ||
| ) | const |
UV component in channel for vertex (component 0=u, 1=v, 2=w).
在文件 ModelData.cpp 第 142 行定义.
◆ getTexCoordChannelCount()
| int eve::model3d::ModelData::getTexCoordChannelCount | ( | int | meshIndex | ) | const |
Number of populated UV channels (0..AI_MAX_NUMBER_OF_TEXTURECOORDS).
在文件 ModelData.cpp 第 129 行定义.
引用了 m.
◆ getVertexColor()
| float eve::model3d::ModelData::getVertexColor | ( | int | meshIndex, |
| int | channel, | ||
| int | vertexIndex, | ||
| int | component | ||
| ) | const |
◆ getVertexColorChannelCount()
| int eve::model3d::ModelData::getVertexColorChannelCount | ( | int | meshIndex | ) | const |
◆ getVertexCount()
| int eve::model3d::ModelData::getVertexCount | ( | int | meshIndex | ) | const |
Returns the vertex count.
- 异常
-
eve::Exception when meshIndex is out of range.
在文件 ModelData.cpp 第 101 行定义.
引用了 m.
◆ getVertexNormal()
| float eve::model3d::ModelData::getVertexNormal | ( | int | meshIndex, |
| int | vertexIndex, | ||
| int | component | ||
| ) | const |
Source normal component for one vertex (component 0=x, 1=y, 2=z).
- 异常
-
eve::Exception when the mesh/vertex/component is invalid or the mesh has no normals.
在文件 ModelData.cpp 第 161 行定义.
◆ getVertexPosition()
| float eve::model3d::ModelData::getVertexPosition | ( | int | meshIndex, |
| int | vertexIndex, | ||
| int | component | ||
| ) | const |
Source position component for one vertex (component 0=x, 1=y, 2=z).
在文件 ModelData.cpp 第 152 行定义.
◆ hasBones()
| bool eve::model3d::ModelData::hasBones | ( | int | meshIndex | ) | const |
◆ hasFlippedUvs()
|
inlinenoexcept |
Whether the loader applied the UV-flip postprocess to this owned scene.
在文件 ModelData.h 第 49 行定义.
◆ hasNormals()
| bool eve::model3d::ModelData::hasNormals | ( | int | meshIndex | ) | const |
True when normals.
- 异常
-
eve::Exception when meshIndex is out of range.
在文件 ModelData.cpp 第 115 行定义.
引用了 m.
◆ hasTangents()
| bool eve::model3d::ModelData::hasTangents | ( | int | meshIndex | ) | const |
◆ hasTexCoordChannel()
| bool eve::model3d::ModelData::hasTexCoordChannel | ( | int | meshIndex, |
| int | channel | ||
| ) | const |
◆ hasTexCoords()
| bool eve::model3d::ModelData::hasTexCoords | ( | int | meshIndex | ) | const |
True when tex coords.
- 异常
-
eve::Exception when meshIndex is out of range.
在文件 ModelData.cpp 第 122 行定义.
引用了 m.
◆ hasVertexColorChannel()
| bool eve::model3d::ModelData::hasVertexColorChannel | ( | int | meshIndex, |
| int | channel | ||
| ) | const |
◆ mapSurfacePointToUv()
| eve::Result< SurfaceUv > eve::model3d::ModelData::mapSurfacePointToUv | ( | int | meshIndex, |
| int | triangleIndex, | ||
| float | localX, | ||
| float | localY, | ||
| float | localZ, | ||
| int | channel = 0 |
||
| ) | const |
Map a point on one source triangle to UV coordinates by barycentric interpolation.
- 参数
-
meshIndex Source mesh index. triangleIndex Source triangle index, matching a triangle-mesh collider built from this mesh. localX Point X in the model mesh's local coordinate space. localY Point Y in the model mesh's local coordinate space. localZ Point Z in the model mesh's local coordinate space. channel UV channel to sample.
- 返回
- Owning UV/barycentric snapshot, or a structured failure for invalid or degenerate input. @thread Safe for concurrent calls while this ModelData is not hot-reloaded. @reentrancy Does not invoke callbacks.
在文件 ModelData.cpp 第 178 行定义.
引用了 a, b, eve::model3d::SurfaceUv::barycentricA, eve::model3d::SurfaceUv::barycentricB, eve::model3d::SurfaceUv::barycentricC, c, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::InvariantViolation, mesh, eve::NotFound, p, eve::PreconditionViolation, eve::Result< T >::success(), ta, tb, eve::model3d::SurfaceUv::triangleIndex, eve::model3d::SurfaceUv::u, eve::Unsupported, eve::model3d::SurfaceUv::uvChannel , 以及 eve::model3d::SurfaceUv::v.
◆ setVertexNormal()
| eve::Result< void > eve::model3d::ModelData::setVertexNormal | ( | int | meshIndex, |
| int | vertexIndex, | ||
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
Write one unit (or zero) object-space vertex normal. Allocates the normal stream when the mesh has positions but no normals.
- 参数
-
meshIndex Mesh slot in this ModelData. vertexIndex Vertex in that mesh. x Object-space normal X. y Object-space normal Y. z Object-space normal Z. A zero vector is stored as (0,0,1).
- 返回
- Applied on success. Does not mutate on failure. @ownership Borrowed
this; no new object is created. @thread Affine to this mutable ModelData. Unsafe on a ResourceManager-shared file cache entry used by other owners — decode from bytes first. @reentrancy Does not invoke callbacks.
在文件 ModelNormals.cpp 第 154 行定义.
引用了 eve::Applied, eve::Result< T >::failure(), mesh, eve::Status::success(), eve::Result< T >::success(), x, y , 以及 z.
该类的文档由以下文件生成:
- src/modules/model3d/ModelData.h
- src/modules/model3d/ModelData.cpp
- src/modules/model3d/ModelNormals.cpp
Public 成员函数 继承自