diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 026a0fdd38..854e06c870 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -157,6 +157,7 @@ Sprite3D::Sprite3D() : _skeleton(nullptr) , _blend(BlendFunc::ALPHA_NON_PREMULTIPLIED) , _aabbDirty(true) +, _lightMask(-1) { } diff --git a/cocos/3d/CCSprite3D.h b/cocos/3d/CCSprite3D.h index c7ab28893c..90ca39f785 100644 --- a/cocos/3d/CCSprite3D.h +++ b/cocos/3d/CCSprite3D.h @@ -112,6 +112,10 @@ public: void setCullFace(GLenum cullFace); // set cull face enable or not void setCullFaceEnabled(bool enable); + + /** light mask getter & setter, light works only when _lightmask */ + void setLightMask(unsigned short mask) { _lightMask = mask; } + unsigned short getLightMask() const { return _lightMask; } CC_CONSTRUCTOR_ACCESS: @@ -162,6 +166,7 @@ protected: mutable AABB _aabb; // cache current aabb mutable Mat4 _nodeToWorldTransform; // cache the matrix bool _aabbDirty; + unsigned short _lightMask; }; ///////////////////////////////////////////////////////