From fed2021707a5eaa1426abe4f506d53fbe691ce93 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Wed, 3 Sep 2014 09:02:32 +0800 Subject: [PATCH] Fixme: frustum culling --- cocos/3d/CCBillBoard.cpp | 4 +--- cocos/3d/CCBillBoard.h | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cocos/3d/CCBillBoard.cpp b/cocos/3d/CCBillBoard.cpp index 7d7523772e..293811faf7 100644 --- a/cocos/3d/CCBillBoard.cpp +++ b/cocos/3d/CCBillBoard.cpp @@ -103,10 +103,8 @@ void BillBorad::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) _zDepthInView = -modelViewMat.m[14]; _mv = viewInverseMat; } - //// Don't do calculate the culling if the transform was not updated - //_insideBounds = (flags & FLAGS_TRANSFORM_DIRTY) ? renderer->checkVisibility(transMat, _contentSize) : _insideBounds; - //if(_insideBounds) + //FIXME: frustum culling here { _quadCommand.init(_zDepthInView, _texture->getName(), getGLProgramState(), _blendFunc, &_quad, 1, transform * _mv); renderer->addTransparentCommand(&_quadCommand); diff --git a/cocos/3d/CCBillBoard.h b/cocos/3d/CCBillBoard.h index 96a5e45bad..369c798d57 100644 --- a/cocos/3d/CCBillBoard.h +++ b/cocos/3d/CCBillBoard.h @@ -76,6 +76,7 @@ public: */ static BillBorad* createWithTexture(Texture2D *texture); + //override /** draw BillBorad object */ virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;