📄 material.cpp
字号:
#include "Material.h"void Material::setDefault(){ // Standard Material Textures and Parameters textureType = 0; // for none numParams = 0; // Whitted Variables reflectivity = transparency = 0.0; speedOfLight = 1.0; nudgeValue = 0.000001; // Other variables specularFraction = 1.0; surfaceRoughness = 0.5; specularExponent = 1; // Standard Material Colors ambient.set(0.1f,0.1f,0.1f); diffuse.set(0.8f,0.8f,0.8f); specular.set(0,0,0); emissive.set(0,0,0);}void Material::set(Material m){ // Standard Material Textures and Parameters textureType = m.textureType; numParams = m.numParams; for(int i = 0; i < numParams; i++) params[i] = m.params[i]; // Whitted Variables transparency = m.transparency; speedOfLight = m.speedOfLight; reflectivity = m.reflectivity; nudgeValue = m.nudgeValue; // Other variables specularFraction = m.specularFraction; surfaceRoughness = m.surfaceRoughness; specularExponent = m.specularExponent; // Standard Material Colors ambient.set(m.ambient); diffuse.set(m.diffuse); specular.set(m.specular); emissive.set(m.emissive);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -