| 1293 | } |
| 1294 | |
| 1295 | char* MeshFactory::GetGeometricChannel(std::shared_ptr<VertexBuffer> const& vbuffer, |
| 1296 | VASemantic semantic, float w) |
| 1297 | { |
| 1298 | char* channel = nullptr; |
| 1299 | int32_t index = mVFormat.GetIndex(semantic, 0); |
| 1300 | if (index >= 0) |
| 1301 | { |
| 1302 | channel = vbuffer->GetChannel(semantic, 0, std::set<uint32_t>()); |
| 1303 | LogAssert(channel != nullptr, "Unexpected condition."); |
| 1304 | if (mVFormat.GetType(index) == DF_R32G32B32A32_FLOAT) |
| 1305 | { |
| 1306 | // Fill in the w-components. |
| 1307 | int32_t const numVertices = vbuffer->GetNumElements(); |
| 1308 | for (int32_t i = 0; i < numVertices; ++i) |
| 1309 | { |
| 1310 | auto tuple4 = reinterpret_cast<float*>(channel + |
| 1311 | static_cast<size_t>(i) * mVFormat.GetVertexSize()); |
| 1312 | tuple4[3] = w; |
| 1313 | } |
| 1314 | } |
| 1315 | } |
| 1316 | return channel; |
| 1317 | } |
| 1318 | |
| 1319 | void MeshFactory::SetPlatonicTCoord(uint32_t i, Vector3<float> const& pos) |
| 1320 | { |
nothing calls this directly
no test coverage detected