Rebel Fork Framework
Urho3D::ModelVertex Struct Reference

#include <Urho3D/Graphics/ModelView.h>

Public Types

using BoneArray = ea::array< ea::pair< unsigned, float >, MaxBones >
 

Public Member Functions

void SetPosition (const Vector3 &position)
 Set position from 3-vector.
 
void SetNormal (const Vector3 &normal)
 Set normal from 3-vector.
 
void SetColor (unsigned i, const Color &color)
 Set color for given channel.
 
Vector3 GetPosition () const
 Return position as 3-vector.
 
Vector3 GetNormal () const
 Return normal as 3-vector.
 
Vector3 GetTangent () const
 Return tangent as 3-vector.
 
Color GetColor (unsigned i=0) const
 Return color from given channel.
 
BoneArray GetBlendIndicesAndWeights () const
 Return blend indices as integers.
 
bool HasNormal () const
 Return whether the vertex has normal.
 
bool HasTangent () const
 Return whether the vertex has tangent.
 
bool HasBinormal () const
 Return whether the vertex has binormal.
 
bool HasTangentBinormalCombined () const
 Return whether the vertex has tangent and binormal combined.
 
bool ReplaceElement (const ModelVertex &source, const VertexElement &element)
 Replace given semantics from another vector.
 
void Repair ()
 Repair missing vertex elements if possible.
 
void PruneElements (const ModelVertexFormat &format)
 Prune vertex elements not represented in the format.
 
bool operator== (const ModelVertex &rhs) const
 
bool operator!= (const ModelVertex &rhs) const
 

Public Attributes

Vector4 position_
 Position.
 
Vector4 normal_
 Normal. W-component must be zero.
 
Vector4 tangent_
 Tangent. W-component is the sign of binormal direction.
 
Vector4 binormal_
 Binormal. W-component must be zero.
 
Vector4 blendIndices_
 Blend indices for skeletal animations. Must be integers.
 
Vector4 blendWeights_
 Blend weights for skeletal animations. Must be in range [0, 1].
 
Vector4 color_ [MaxColors]
 Colors.
 
Vector4 uv_ [MaxUVs]
 UV coordinates.
 

Static Public Attributes

static const unsigned MaxBones = 4
 
static const unsigned MaxColors = ModelVertexFormat::MaxColors
 
static const unsigned MaxUVs = ModelVertexFormat::MaxUVs
 
static const ea::vector< VertexElementVertexElements
 Vertex elements corresponding to full ModelVertex. More...
 

Detailed Description

Model vertex, unpacked for easy editing. Warning: ModelVertex must be equivalent to an array of Vector4.

Member Data Documentation

◆ VertexElements

const ea::vector< VertexElement > Urho3D::ModelVertex::VertexElements
static
Initial value:
=
{
VertexElement{ TYPE_VECTOR4, SEM_POSITION },
VertexElement{ TYPE_VECTOR4, SEM_NORMAL },
VertexElement{ TYPE_VECTOR4, SEM_TANGENT },
VertexElement{ TYPE_VECTOR4, SEM_BINORMAL },
VertexElement{ TYPE_VECTOR4, SEM_BLENDINDICES },
VertexElement{ TYPE_VECTOR4, SEM_BLENDWEIGHTS },
VertexElement{ TYPE_VECTOR4, SEM_COLOR, 0 },
VertexElement{ TYPE_VECTOR4, SEM_COLOR, 1 },
VertexElement{ TYPE_VECTOR4, SEM_COLOR, 2 },
VertexElement{ TYPE_VECTOR4, SEM_COLOR, 3 },
VertexElement{ TYPE_VECTOR4, SEM_TEXCOORD, 0 },
VertexElement{ TYPE_VECTOR4, SEM_TEXCOORD, 1 },
VertexElement{ TYPE_VECTOR4, SEM_TEXCOORD, 2 },
VertexElement{ TYPE_VECTOR4, SEM_TEXCOORD, 3 },
}

Vertex elements corresponding to full ModelVertex.


The documentation for this struct was generated from the following files: