uint32_t readSize = 0;
uint32_t totalSize = (descriptor.mLength / descriptor.mElementSizeHint) * descriptor.mStride;
while(readSize < totalSize &&
- source.read(reinterpret_cast<char*>(target), descriptor.mElementSizeHint) &&
- source.seekg(diff, std::istream::cur))
+ source.read(reinterpret_cast<char*>(target), descriptor.mElementSizeHint))
{
readSize += descriptor.mStride;
target += descriptor.mElementSizeHint;
+ source.seekg(diff, std::istream::cur);
}
return readSize == totalSize;
}
raw.mAttribs.push_back({"aVertexColor", propertyType, static_cast<uint32_t>(bufferSize / propertySize), std::move(buffer)});
}
}
+ else
+ {
+ std::vector<uint8_t> buffer(raw.mAttribs[0].mNumElements * sizeof(Vector4));
+ auto colors = reinterpret_cast<Vector4*>(buffer.data());
+
+ for(uint32_t i = 0; i < raw.mAttribs[0].mNumElements; i++)
+ {
+ colors[i] = Vector4::ONE;
+ }
+
+ raw.mAttribs.push_back({"aVertexColor", Property::VECTOR4, raw.mAttribs[0].mNumElements, std::move(buffer)});
+ }
if(IsSkinned())
{
return meshGeometry;
}
+void MeshDefinition::RetrieveBlendShapeComponents(bool& hasPositions, bool& hasNormals, bool& hasTangents) const
+{
+ for(const auto& blendShape : mBlendShapes)
+ {
+ hasPositions = hasPositions || blendShape.deltas.IsDefined();
+ hasNormals = hasNormals || blendShape.normals.IsDefined();
+ hasTangents = hasTangents || blendShape.tangents.IsDefined();
+ }
+}
+
} // namespace Dali::Scene3D::Loader