SIBEdge edge;
edge.creased = false;
edge.faceA = edge.faceB = 0xffffffff;
- mesh->edgeMap[pair] = mesh->edges.size();
+ mesh->edgeMap[pair] = static_cast<uint32_t>(mesh->edges.size());
mesh->edges.push_back(edge);
return mesh->edges.back();
}
mesh->idx[pos-1] = numPoints;
uint32_t *idx = &mesh->idx[pos];
- mesh->faceStart.push_back(pos-1);
+ mesh->faceStart.push_back(static_cast<uint32_t>(pos-1));
mesh->mtls.push_back(0);
// Read all the position data.
// This gives potentially undesirable normals when used
// with non-2-manifold surfaces, but then so does Silo to begin with.
if (edge.faceA == 0xffffffff)
- edge.faceA = faceIdx;
+ edge.faceA = static_cast<uint32_t>(faceIdx);
else
- edge.faceB = faceIdx;
+ edge.faceB = static_cast<uint32_t>(faceIdx);
prev = next;
}
{
uint32_t pos = idx[i*N+POS];
uint32_t nrm = idx[i*N+NRM];
- aiVector3D vtxNorm = CalculateVertexNormal(mesh, faceIdx, pos, faceNormals);
+ aiVector3D vtxNorm = CalculateVertexNormal(mesh, static_cast<uint32_t>(faceIdx), pos, faceNormals);
mesh->nrm[nrm] = vtxNorm;
}
}
for (unsigned pt=0;pt<face.mNumIndices;pt++,idx+=N)
{
size_t vtxIdx = dest.vtx.size();
- face.mIndices[pt] = vtxIdx;
+ face.mIndices[pt] = static_cast<unsigned int>(vtxIdx);
// De-index it. We don't need to validate here as
// we did it when creating the data.
aiMesh* mesh = new aiMesh;
mesh->mName = name;
- mesh->mNumFaces = src.faces.size();
+ mesh->mNumFaces = static_cast<unsigned int>(src.faces.size());
mesh->mFaces = new aiFace[mesh->mNumFaces];
- mesh->mNumVertices = src.vtx.size();
+ mesh->mNumVertices = static_cast<unsigned int>(src.vtx.size());
mesh->mVertices = new aiVector3D[mesh->mNumVertices];
mesh->mNormals = new aiVector3D[mesh->mNumVertices];
mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices];
mesh->mNumUVComponents[0] = 2;
- mesh->mMaterialIndex = n;
+ mesh->mMaterialIndex = static_cast<unsigned int>(n);
for (unsigned i=0;i<mesh->mNumVertices;i++)
{
sib.insts.clear();
// Transfer to the aiScene.
- pScene->mNumMaterials = sib.mtls.size();
- pScene->mNumMeshes = sib.meshes.size();
- pScene->mNumLights = sib.lights.size();
+ pScene->mNumMaterials = static_cast<unsigned int>(sib.mtls.size());
+ pScene->mNumMeshes = static_cast<unsigned int>(sib.meshes.size());
+ pScene->mNumLights = static_cast<unsigned int>(sib.lights.size());
pScene->mMaterials = pScene->mNumMaterials ? new aiMaterial*[pScene->mNumMaterials] : NULL;
pScene->mMeshes = pScene->mNumMeshes ? new aiMesh*[pScene->mNumMeshes] : NULL;
pScene->mLights = pScene->mNumLights ? new aiLight*[pScene->mNumLights] : NULL;
size_t childIdx = 0;
aiNode *root = new aiNode();
root->mName.Set("<SIBRoot>");
- root->mNumChildren = sib.objs.size() + sib.lights.size();
+ root->mNumChildren = static_cast<unsigned int>(sib.objs.size() + sib.lights.size());
root->mChildren = root->mNumChildren ? new aiNode*[root->mNumChildren] : NULL;
pScene->mRootNode = root;
node->mParent = root;
node->mTransformation = obj.axis;
- node->mNumMeshes = obj.meshCount;
+ node->mNumMeshes = static_cast<unsigned int>(obj.meshCount);
node->mMeshes = node->mNumMeshes ? new unsigned[node->mNumMeshes] : NULL;
for (unsigned i=0;i<node->mNumMeshes;i++)
- node->mMeshes[i] = obj.meshIdx + i;
+ node->mMeshes[i] = static_cast<unsigned int>(obj.meshIdx + i);
// Mark instanced objects as being so.
if (n >= firstInst)