Changeset 737

Show
Ignore:
Timestamp:
06/23/09 21:13:51 (9 months ago)
Author:
hagish
Message:

Gfx3D:SetVisible changed. Now its possible to change the cascading behavior with the 2. parameter. The change is backward compatible.

Location:
trunk/lugre
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/lugre/include/lugre_gfx3D.h

    r735 r737  
    127127        void    SetScale                        (const Vector3& vScale); 
    128128        void    SetNormaliseNormals     (const bool bNormalise); 
    129         void    SetVisible              (const bool bVisible); 
     129        void    SetVisible              (const bool bVisible, const bool bCascade); 
    130130        void    SetCastShadows          (const bool bCastShadows); 
    131131        void    SetMaterial             (const char* szMat); 
  • trunk/lugre/src/lugre_gfx3D.cpp

    r735 r737  
    636636void    cGfx3D::SetNormaliseNormals     (const bool bNormalise) {  PROFILE /* if (mpEntity) TODO removed in ogresvn mpEntity->setNormaliseNormals(bNormalise); */ } 
    637637void    cGfx3D::SetOrientation  (const Quaternion& qRot)        { PROFILE if (mpSceneNode) mpSceneNode->setOrientation(qRot); } 
    638 void    cGfx3D::SetVisible              (const bool bVisible)           { PROFILE if (mpSceneNode) mpSceneNode->setVisible(bVisible); } 
     638void    cGfx3D::SetVisible              (const bool bVisible, const bool bCascade)              { PROFILE if (mpSceneNode) mpSceneNode->setVisible(bVisible, bCascade); } 
    639639void    cGfx3D::SetCastShadows          (const bool bCastShadows) { PROFILE 
    640640        if (mpEntity) mpEntity->setCastShadows(bCastShadows);  
  • trunk/lugre/src/lugre_gfx3D_L.cpp

    r735 r737  
    478478                } 
    479479                 
    480                 /// gfx3D:SetVisible( bool) 
     480                /// gfx3D:SetVisible( bool visible, bool cascade=true) 
    481481                static int      SetVisible                              (lua_State *L) { PROFILE 
    482                         checkudata_alive(L)->SetVisible(lua_toboolean(L,2)); 
     482                        bool bCascade = (lua_gettop(L) >= 3 && !lua_isnil(L,3)) ? lua_toboolean(L,3) : true; 
     483                        checkudata_alive(L)->SetVisible(lua_toboolean(L,2), bCascade); 
    483484                        return 0; 
    484485                }