From 6e1f38fdc47045fcbe14b219c39a7c61e2ae21be Mon Sep 17 00:00:00 2001 From: yangxiao Date: Tue, 8 Dec 2015 16:32:06 +0800 Subject: [PATCH] fxi model bug --- cocos/3d/CCSprite3D.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 4a3ec6ca69..1e490a704e 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -364,6 +364,13 @@ Sprite3D* Sprite3D::createSprite3DNode(NodeData* nodedata,ModelData* modeldata,c { sprite->setName(nodedata->id); auto mesh = Mesh::create(nodedata->id, getMeshIndexData(modeldata->subMeshId)); + + if (_skeleton && modeldata->bones.size()) + { + auto skin = MeshSkin::create(_skeleton, modeldata->bones, modeldata->invBindPose); + mesh->setSkin(skin); + } + if (modeldata->matrialId == "" && materialdatas.materials.size()) { const NTextureData* textureData = materialdatas.materials[0].getTextureData(NTextureData::Usage::Diffuse); @@ -748,7 +755,7 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) { #if CC_USE_CULLING // camera clipping - if(Camera::getVisitingCamera() && !Camera::getVisitingCamera()->isVisibleInFrustum(&this->getAABB())) + if(_children.size() == 0 && Camera::getVisitingCamera() && !Camera::getVisitingCamera()->isVisibleInFrustum(&getAABB())) return; #endif