Class SkinnedMesh
Represents part of the skinned model that is made of vertices and can be rendered using custom material, transformation and skeleton bones hierarchy.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Graphics/Models/SkinnedMesh.h
Syntax
public class SkinnedMesh : public MeshBase
Constructors
DEPRECATED("Use Init intead.")
Load mesh data and Initialize GPU buffers [Deprecated in v1.10]
Declaration
public DEPRECATED("Use Init intead.") bool Load(uint32 vertices
Parameters
"Use Init intead."
SkinnedMesh_DEPRECATED__Use_Init_intead___
|
Fields
ib
Declaration
public uint32 void void* ib
Field Value
uint32 void void
|
triangles
Declaration
public uint32 triangles
Field Value
uint32
|
use16BitIndexBuffer
Declaration
public uint32 void void bool use16BitIndexBuffer
Field Value
uint32 void void bool
|
vb0
Declaration
public uint32 void* vb0
Field Value
uint32 void
|
Methods
Draw(const RenderContext& renderContext, const DrawInfo& info, float lodDitherFactor)
Draws the mesh.
Declaration
public void Draw(const RenderContext& renderContext, const DrawInfo& info, float lodDitherFactor) const
Parameters
RenderContext
renderContext
The rendering context. |
DrawInfo
info
The packed drawing info data. |
float
lodDitherFactor
The LOD transition dither factor. |
Draw(const RenderContextBatch& renderContextBatch, const DrawInfo& info, float lodDitherFactor)
Draws the mesh.
Declaration
public void Draw(const RenderContextBatch& renderContextBatch, const DrawInfo& info, float lodDitherFactor) const
Parameters
RenderContextBatch
renderContextBatch
The rendering context batch. |
DrawInfo
info
The packed drawing info data. |
float
lodDitherFactor
The LOD transition dither factor. |
Release()
Releases the mesh data (GPU buffers and local cache).
Declaration
public virtual void Release() override
Overrides
UpdateMesh(uint32 vertexCount, uint32 triangleCount, const Float3* vertices, const uint16* triangles, const Int4* blendIndices, const Float4* blendWeights, const Float3* normals=nullptr, const Float3* tangents=nullptr, const Float2* uvs=nullptr, const Color32* colors=nullptr)
Updates the model mesh (used by the virtual models created with Init rather than Load). Can be used only for virtual assets (see IsVirtual() and CreateVirtualAsset()). Mesh data will be cached and uploaded to the GPU with a delay.
Declaration
public bool UpdateMesh(uint32 vertexCount, uint32 triangleCount, const Float3* vertices, const uint16* triangles, const Int4* blendIndices, const Float4* blendWeights, const Float3* normals=nullptr, const Float3* tangents=nullptr, const Float2* uvs=nullptr, const Color32* colors=nullptr)
Parameters
uint32
vertexCount
The amount of vertices in the vertex buffer. |
uint32
triangleCount
The amount of triangles in the index buffer. |
Float3
vertices
The mesh vertices positions. Cannot be null. |
uint16
triangles
The mesh index buffer (clockwise triangles). Uses 32-bit stride buffer. Cannot be null. |
Int4
blendIndices
The skeletal bones indices to use for skinning. |
Float4
blendWeights
The skeletal bones weights to use for skinning (matches blendIndices). |
Float3
normals
The normal vectors (per vertex). |
Float3
tangents
The normal vectors (per vertex). Use null to compute them from normal vectors. |
Float2
uvs
The texture coordinates (per vertex). |
Color32
colors
The vertex colors (per vertex). |
Returns
bool
True if failed, otherwise false. |
UpdateMesh(uint32 vertexCount, uint32 triangleCount, const Float3* vertices, const uint32* triangles, const Int4* blendIndices, const Float4* blendWeights, const Float3* normals=nullptr, const Float3* tangents=nullptr, const Float2* uvs=nullptr, const Color32* colors=nullptr)
Updates the model mesh (used by the virtual models created with Init rather than Load). Can be used only for virtual assets (see IsVirtual() and CreateVirtualAsset()). Mesh data will be cached and uploaded to the GPU with a delay.
Declaration
public bool UpdateMesh(uint32 vertexCount, uint32 triangleCount, const Float3* vertices, const uint32* triangles, const Int4* blendIndices, const Float4* blendWeights, const Float3* normals=nullptr, const Float3* tangents=nullptr, const Float2* uvs=nullptr, const Color32* colors=nullptr)
Parameters
uint32
vertexCount
The amount of vertices in the vertex buffer. |
uint32
triangleCount
The amount of triangles in the index buffer. |
Float3
vertices
The mesh vertices positions. Cannot be null. |
uint32
triangles
The mesh index buffer (clockwise triangles). Uses 32-bit stride buffer. Cannot be null. |
Int4
blendIndices
The skeletal bones indices to use for skinning. |
Float4
blendWeights
The skeletal bones weights to use for skinning (matches blendIndices). |
Float3
normals
The normal vectors (per vertex). |
Float3
tangents
The normal vectors (per vertex). Use null to compute them from normal vectors. |
Float2
uvs
The texture coordinates (per vertex). |
Color32
colors
The vertex colors (per vertex). |
Returns
bool
True if failed, otherwise false. |
UpdateMesh(uint32 vertexCount, uint32 triangleCount, const VB0SkinnedElementType* vb, const int32* ib)
Updates the model mesh (used by the virtual models created with Init rather than Load). [Deprecated in v1.10]
Declaration
public bool UpdateMesh(uint32 vertexCount, uint32 triangleCount, const VB0SkinnedElementType* vb, const int32* ib)
Parameters
uint32
vertexCount
The amount of vertices in the vertex buffer. |
uint32
triangleCount
The amount of triangles in the index buffer. |
VB0SkinnedElementType
vb
The vertex buffer data. |
int32
ib
The index buffer in clockwise order. |
Returns
bool
True if failed, otherwise false. |
UpdateMesh(uint32 vertexCount, uint32 triangleCount, const VB0SkinnedElementType* vb, const uint16* ib)
Updates the model mesh (used by the virtual models created with Init rather than Load). [Deprecated in v1.10]
Declaration
public bool UpdateMesh(uint32 vertexCount, uint32 triangleCount, const VB0SkinnedElementType* vb, const uint16* ib)
Parameters
uint32
vertexCount
The amount of vertices in the vertex buffer. |
uint32
triangleCount
The amount of triangles in the index buffer. |
VB0SkinnedElementType
vb
The vertex buffer data. |
uint16
ib
The index buffer, clockwise order. |
Returns
bool
True if failed, otherwise false. |
UpdateMesh(uint32 vertexCount, uint32 triangleCount, const VB0SkinnedElementType* vb, const uint32* ib)
Updates the model mesh (used by the virtual models created with Init rather than Load). [Deprecated in v1.10]
Declaration
public bool UpdateMesh(uint32 vertexCount, uint32 triangleCount, const VB0SkinnedElementType* vb, const uint32* ib)
Parameters
uint32
vertexCount
The amount of vertices in the vertex buffer. |
uint32
triangleCount
The amount of triangles in the index buffer. |
VB0SkinnedElementType
vb
The vertex buffer data. |
uint32
ib
The index buffer in clockwise order. |
Returns
bool
True if failed, otherwise false. |
UpdateMesh(uint32 vertexCount, uint32 triangleCount, const VB0SkinnedElementType* vb, const void* ib, bool use16BitIndices)
Updates the model mesh (used by the virtual models created with Init rather than Load). [Deprecated in v1.10]
Declaration
public bool UpdateMesh(uint32 vertexCount, uint32 triangleCount, const VB0SkinnedElementType* vb, const void* ib, bool use16BitIndices)
Parameters
uint32
vertexCount
The amount of vertices in the vertex buffer. |
uint32
triangleCount
The amount of triangles in the index buffer. |
VB0SkinnedElementType
vb
The vertex buffer data. |
void
ib
The index buffer in clockwise order. |
bool
use16BitIndices
True if index buffer uses 16-bit index buffer, otherwise 32-bit. |
Returns
bool
True if failed, otherwise false. |