浏览代码

3DS: Add Material constructor which takes material name

Turo Lamminen 7 年之前
父节点
当前提交
d49996d8a6
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. 14 0
      code/3DSHelper.h

+ 14 - 0
code/3DSHelper.h

@@ -388,6 +388,20 @@ struct Material
     }
     }
 
 
 
 
+    //! Constructor with explicit name
+    explicit Material(const std::string &name)
+    : mDiffuse            ( ai_real( 0.6 ), ai_real( 0.6 ), ai_real( 0.6 ) ) // FIX ... we won't want object to be black
+    , mSpecularExponent   ( ai_real( 0.0 ) )
+    , mShininessStrength  ( ai_real( 1.0 ) )
+    , mShading(Discreet3DS::Gouraud)
+    , mTransparency       ( ai_real( 1.0 ) )
+    , mBumpHeight         ( ai_real( 1.0 ) )
+    , mTwoSided           (false)
+    {
+        mName = name;
+    }
+
+
     Material(const Material &other)            = default;
     Material(const Material &other)            = default;
     Material(Material &&other)                 = default;
     Material(Material &&other)                 = default;