|
|
|
@ -147,6 +147,24 @@ enum class MeshAttribute: UnsignedShort { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
ObjectId, |
|
|
|
ObjectId, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Weights. Type is usually @ref VertexFormat::Vector4, but can be also |
|
|
|
|
|
|
|
* @ref VertexFormat::Vector4h, @ref VertexFormat::Vector4bNormalized or |
|
|
|
|
|
|
|
* @ref VertexFormat::Vector4sNormalized. Corresponds to |
|
|
|
|
|
|
|
* @ref Shaders::Generic::Weights. |
|
|
|
|
|
|
|
* @see @ref MeshData::weightsAsArray() |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
Weights, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* JointIndices. Type is usually @ref VertexFormat::Vector4ui, but can be also |
|
|
|
|
|
|
|
* @ref VertexFormat::Vector4i, @ref VertexFormat::Vector4s, @ref VertexFormat::Vector4us, |
|
|
|
|
|
|
|
* @ref VertexFormat::Vector4ub or @ref VertexFormat::Vector4b. Corresponds to |
|
|
|
|
|
|
|
* @ref Shaders::Generic::JointIndices. |
|
|
|
|
|
|
|
* @see @ref MeshData::jointIndicesAsArray() |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
JointIndices, |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This and all higher values are for importer-specific attributes. Can be |
|
|
|
* This and all higher values are for importer-specific attributes. Can be |
|
|
|
* of any type. See documentation of a particular importer for details. |
|
|
|
* of any type. See documentation of a particular importer for details. |
|
|
|
@ -613,10 +631,11 @@ the @ref Primitives library. |
|
|
|
The simplest usage is through the convenience functions @ref positions2DAsArray(), |
|
|
|
The simplest usage is through the convenience functions @ref positions2DAsArray(), |
|
|
|
@ref positions3DAsArray(), @ref tangentsAsArray(), @ref bitangentsAsArray(), |
|
|
|
@ref positions3DAsArray(), @ref tangentsAsArray(), @ref bitangentsAsArray(), |
|
|
|
@ref normalsAsArray(), @ref tangentsAsArray(), @ref textureCoordinates2DAsArray(), |
|
|
|
@ref normalsAsArray(), @ref tangentsAsArray(), @ref textureCoordinates2DAsArray(), |
|
|
|
@ref colorsAsArray() and @ref objectIdsAsArray(). Each of these takes an index |
|
|
|
@ref colorsAsArray(), @ref objectIdsAsArray(), @ref weightsAsArray() and |
|
|
|
(as there can be multiple sets of texture coordinates, for example) and you're |
|
|
|
@ref jointIndicesAsArray(). Each of these takes an index (as there can be multiple |
|
|
|
expected to check for attribute presence first with either @ref hasAttribute() |
|
|
|
sets of texture coordinates, for example) and you're expected to check for |
|
|
|
or @ref attributeCount(MeshAttribute) const: |
|
|
|
attribute presence first with either @ref hasAttribute() or |
|
|
|
|
|
|
|
@ref attributeCount(MeshAttribute) const: |
|
|
|
|
|
|
|
|
|
|
|
@snippet MagnumTrade.cpp MeshData-usage |
|
|
|
@snippet MagnumTrade.cpp MeshData-usage |
|
|
|
|
|
|
|
|
|
|
|
@ -1717,6 +1736,54 @@ class MAGNUM_TRADE_EXPORT MeshData { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void objectIdsInto(Containers::StridedArrayView1D<UnsignedInt> destination, UnsignedInt id = 0) const; |
|
|
|
void objectIdsInto(Containers::StridedArrayView1D<UnsignedInt> destination, UnsignedInt id = 0) const; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Weights as 4D float vectors |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Convenience alternative to @ref attribute(MeshAttribute, UnsignedInt) const |
|
|
|
|
|
|
|
* with @ref MeshAttribute::Weights as the first argument. Converts |
|
|
|
|
|
|
|
* the weights array from an arbitrary underlying type and returns it |
|
|
|
|
|
|
|
* in a newly-allocated array. Expects that the vertex format is *not* |
|
|
|
|
|
|
|
* implementation-specific, in that case you can only access the |
|
|
|
|
|
|
|
* attribute via the typeless @ref attribute(MeshAttribute, UnsignedInt) const. |
|
|
|
|
|
|
|
* @see @ref weightsInto(), @ref attributeFormat(), |
|
|
|
|
|
|
|
* @ref isVertexFormatImplementationSpecific() |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
Containers::Array<Vector4> weightsAsArray(UnsignedInt id = 0) const; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Weights as 4D float vectors into a pre-allocated view |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Like @ref weightsAsArray(), but puts the result into |
|
|
|
|
|
|
|
* @p destination instead of allocating a new array. Expects that |
|
|
|
|
|
|
|
* @p destination is sized to contain exactly all data. |
|
|
|
|
|
|
|
* @see @ref vertexCount() |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
void weightsInto(Containers::StridedArrayView1D<Vector4> destination, UnsignedInt id = 0) const; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Weights as 4D unsigned short vectors |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Convenience alternative to @ref attribute(MeshAttribute, UnsignedInt) const |
|
|
|
|
|
|
|
* with @ref MeshAttribute::JointIndices as the first argument. Converts |
|
|
|
|
|
|
|
* the joint indices array from an arbitrary underlying type and returns it |
|
|
|
|
|
|
|
* in a newly-allocated array. Expects that the vertex format is *not* |
|
|
|
|
|
|
|
* implementation-specific, in that case you can only access the |
|
|
|
|
|
|
|
* attribute via the typeless @ref attribute(MeshAttribute, UnsignedInt) const. |
|
|
|
|
|
|
|
* @see @ref jointIndicesInto(), @ref attributeFormat(), |
|
|
|
|
|
|
|
* @ref isVertexFormatImplementationSpecific() |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
Containers::Array<Vector4us> jointIndicesAsArray(UnsignedInt id = 0) const; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Weights as 4D unsigned short vectors into a pre-allocated view |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Like @ref jointIndicesAsArray(), but puts the result into |
|
|
|
|
|
|
|
* @p destination instead of allocating a new array. Expects that |
|
|
|
|
|
|
|
* @p destination is sized to contain exactly all data. |
|
|
|
|
|
|
|
* @see @ref vertexCount() |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
void jointIndicesInto(Containers::StridedArrayView1D<Vector4us> destination, UnsignedInt id = 0) const; |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @brief Release index data storage |
|
|
|
* @brief Release index data storage |
|
|
|
* |
|
|
|
* |
|
|
|
|