diff --git a/cocos/2d/CCCamera.cpp b/cocos/2d/CCCamera.cpp index 93a066a422..89baefd956 100644 --- a/cocos/2d/CCCamera.cpp +++ b/cocos/2d/CCCamera.cpp @@ -259,7 +259,7 @@ void Camera::enableFrustumCulling(bool enalbe, bool clipZ) _frustum.setClipZ(clipZ); } -bool Camera::isVisibleInFrustum(const AABB& aabb) const +bool Camera::isVisibleInFrustum(const AABB* aabb) const { if (_enableFrustumCulling) { @@ -268,7 +268,7 @@ bool Camera::isVisibleInFrustum(const AABB& aabb) const _frustum.initFrustum(this); _frustumDirty = false; } - return !_frustum.isOutOfFrustum(aabb); + return !_frustum.isOutOfFrustum(*aabb); } return true; } diff --git a/cocos/2d/CCCamera.h b/cocos/2d/CCCamera.h index a166651cfb..bd4e73fb15 100644 --- a/cocos/2d/CCCamera.h +++ b/cocos/2d/CCCamera.h @@ -144,7 +144,7 @@ public: /** * Is this aabb visible in frustum */ - bool isVisibleInFrustum(const AABB& aabb)const; + bool isVisibleInFrustum(const AABB* aabb)const; //override virtual void onEnter() override; diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 1d7668fb9b..43103be25a 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -538,7 +538,7 @@ static Texture2D * getDummyTexture() void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) { // camera clipping - if(!Camera::getVisitingCamera()->isVisibleInFrustum(this->getAABB())) + if(!Camera::getVisitingCamera()->isVisibleInFrustum(&this->getAABB())) return; if (_skeleton) diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index a9520e8bdf..bd35583662 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -60904,9 +60904,9 @@ int lua_cocos2dx_Camera_isVisibleInFrustum(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::AABB arg0; + const cocos2d::AABB* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.AABB",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.AABB",&arg0); if(!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Camera_isVisibleInFrustum'", nullptr);