mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/super626/cocos2d-x into merge-bundle
This commit is contained in:
commit
4dd9102e87
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue