From 5b61e569f54cb8e7061ce0eedf3d1cf28ceaba1e Mon Sep 17 00:00:00 2001 From: yangxiao Date: Fri, 19 Sep 2014 14:50:20 +0800 Subject: [PATCH] light mask --- cocos/3d/CCSprite3D.cpp | 1 + cocos/3d/CCSprite3D.h | 5 +++++ 2 files changed, 6 insertions(+) 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; }; ///////////////////////////////////////////////////////