Merge branch 'v3' of https://github.com/super626/cocos2d-x into merge-bundle

This commit is contained in:
lvlong 2014-08-16 15:45:28 +08:00
commit 4dd9102e87
3 changed files with 14 additions and 1 deletions

View File

@ -399,6 +399,13 @@ bool Bundle3D::loadNodes(NodeDatas& nodedatas)
}
}
nodedatas.skeleton.push_back(nodeDatas[skinData.rootBoneIndex]);
auto modelnode = new ModelNodeData();
modelnode->matrialId = "";
modelnode->subMeshId = "";
modelnode->id = "";
modelnode->bones = skinData.skinBoneNames;
modelnode->invBindPose = skinData.inverseBindPoseMatrices;
nodedatas.nodes.push_back(modelnode);
}
else
{

View File

@ -306,7 +306,7 @@ struct NMaterialData
{
std::vector<NTextureData> textures;
std::string id;
const NTextureData* getTextureData(NTextureData::Usage& type) const
const NTextureData* getTextureData(const NTextureData::Usage& type) const
{
for(const auto& it : textures)
{

View File

@ -345,6 +345,12 @@ void Sprite3D::createNode(NodeData* nodedata, Node* root, const MaterialDatas& m
subMeshState->setSubMesh(getSubMesh(modelNodeData->subMeshId));
auto skin = MeshSkin::create(_skeleton, modelNodeData->bones, modelNodeData->invBindPose);
subMeshState->setSkin(skin);
if (modelNodeData->matrialId == "" && matrialdatas.materials.size())
{
NTextureData::Usage type = NTextureData::Usage::Diffuse;
const NTextureData* textureData = matrialdatas.materials[0].getTextureData(type);
}
const NMaterialData* materialData=matrialdatas.getMaterialData(modelNodeData->matrialId);
if(materialData)
{