即時通訊新手,所以我希望你能幫助我。我可以在其他班級內創建班級嗎?並呼籲所有在一起
我有這個班出場,我展示了一下CPP
Appearances::Appearances(const char* id, float shininess,const char* textureref)
{this->id = id;
setShininess(shininess);
this->textureref = textureref;
}
的代碼,我想加入其他類「組件」像這樣
Component(float ambient[4] , float diffuse[4] , float specular[4])
{setAmbient(ambient);
setDiffuse(diffuse);
setSpecular(specular);
}
而且我想要什麼是,我可以打電話出場與這一切加入,例如:
app = new Appearances(idAppearance, vAmb, vDif, vSpec, shininess, txtRef);
IM試圖讓這個在C + +
<appearance id="app1" shininess="6.0" textureref="ss" >
<component type="ambient" value="5 5 5 5" />
<component type="diffuse" value="5 5 5 5" />
<component type="specular" value="0.6 0.6 0.6 0.6" />
</appearance>
我不知道我是否很好地解釋了我想要的,但有人能幫助我嗎? :)
我編輯了我的問題,最後我展示了我需要做的事 – terrorista 2014-10-19 11:09:34
你的組件只能是float [4]嗎? – 2014-10-19 12:15:30
是的,3浮動[4],環境漫反射和鏡面 – terrorista 2014-10-19 12:51:19