This commit is contained in:
tangziwen 2014-10-15 11:36:44 +08:00
parent 29b255fa36
commit cd1d2289a6
1 changed files with 2 additions and 2 deletions

View File

@ -576,8 +576,8 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
if (mesh->_isTransparent) if (mesh->_isTransparent)
{ {
Vec4 local_pos(_position.x,_position.y,_positionZ,1); Vec4 local_pos(_position.x,_position.y,_positionZ,1);
Vec4 result = Camera::getVisitingCamera()->getViewMatrix() *getNodeToWorldTransform()* local_pos; Mat4 result = Camera::getVisitingCamera()->getViewMatrix() *transform;
globalZ = -result.z; globalZ = -result.m[14];
} }
meshCommand.init(globalZ, textureID, programstate, _blend, mesh->getVertexBuffer(), mesh->getIndexBuffer(), mesh->getPrimitiveType(), mesh->getIndexFormat(), mesh->getIndexCount(), transform); meshCommand.init(globalZ, textureID, programstate, _blend, mesh->getVertexBuffer(), mesh->getIndexBuffer(), mesh->getPrimitiveType(), mesh->getIndexFormat(), mesh->getIndexCount(), transform);