fxi model bug

This commit is contained in:
yangxiao 2015-12-08 16:32:06 +08:00
parent 8d546828f4
commit 6e1f38fdc4
1 changed files with 8 additions and 1 deletions

View File

@ -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